Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#157 Add python support #161

Merged
merged 7 commits into from
May 6, 2018
Merged

Conversation

julian-berbel
Copy link
Member

Fixes #157.

We may want to hold on to merge this since the travis build fails because of high build times?

@ghost ghost assigned julian-berbel Apr 24, 2018
@ghost ghost added the pending-review label Apr 24, 2018
@julian-berbel julian-berbel force-pushed the issue#157-add-python-support branch from ee959f2 to 3c2251c Compare April 24, 2018 15:31
py "True" `shouldBe` MuBool True

it "parses strings" $ do
py "\"some string\"" `shouldBe` MuString "\"some string\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the extra quotes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parsed strings include them.
"something" gets parsed to Strings ["\"something\""].

I didn't remove those because the parser makes no distinction between normal strings and multline strings, and in case someone actually wanted a string which starts with quotes. E.g. "\"something\"".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rethinking that though, if one were to want to parse a string which starts with quotes, this would be parsed as a triple escaped quote.
"\"something\"" would become Strings ["\"\\\"something\\\"\""].

So I guess I could take them out?

Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I thought multiline strings got parsed to a list with as many elements as there were lines in the string (that's the why of the intercalate "\n" here), but apparently that's not the case. They also get parsed to a single element list.
So I have no clue as to why they get parsed to a list in the first place.

@flbulgarelli flbulgarelli requested a review from afska April 27, 2018 15:54
@flbulgarelli
Copy link
Member

@rodri042 could you investigate alternative ways of speeding up the build time? Perhaps improving caching or using docker?

@julian-berbel julian-berbel force-pushed the issue#157-add-python-support branch 2 times, most recently from 74bcebd to 054b5d7 Compare May 3, 2018 18:33
@flbulgarelli flbulgarelli force-pushed the issue#157-add-python-support branch from 054b5d7 to 21e1ea1 Compare May 4, 2018 18:41
@ghost ghost assigned flbulgarelli May 4, 2018
@flbulgarelli
Copy link
Member

I have being investigating about the slow build times in python library. This is apparently a problem with GHC itself, which is slowing down happy-generated parsers.

See:

@flbulgarelli flbulgarelli force-pushed the issue#157-add-python-support branch from 59eb3a9 to 7eb5b46 Compare May 6, 2018 04:45
@flbulgarelli
Copy link
Member

Apparently this project has coped with this situation and is actually building things in travis 😮 We should check its https://github.com/diku-dk/futhark/blob/master/.travis.yml

@flbulgarelli
Copy link
Member

flbulgarelli commented May 6, 2018

🆙 Building language-python from source and using resolver: ghc-8.4.1 makes compilation actually end. However, using that resolver is not trivial with mulang.

So, an option could be updating mulang to that - nightly- resolver and pointing language-python to its github's master branch - is that even possible with stack ?.

An other option could be forking it, and applying this patch: antalsz/hs-to-coq@c538e6a

@flbulgarelli flbulgarelli changed the title Issue#157 add python support Issue#157 Add python support May 6, 2018
@flbulgarelli
Copy link
Member

Also using a more stable lts like 10.2 (ghc 8.2.22), see https://github.com/bjpop/language-python/blob/a5aeabfa58b65a742a6a6745720b4864c0ea770c/stack.yaml#L18, and applying the patch makes language-python compile in good-enough time. But this implies forking, and I'd like to avoid that if possible.

Now - after fixing the travis timeouts with travis_wait - the whole build is taking 25 - 30 minutes, and 6 minutes using travis cache - which is ok. I insist this is not ideal, but it works.

And, in any case, we need to update our lts to be more up-to-date, since both solutions require moving to more recent snapshots. So I will merge this PR by now and then work on the deps update #170

@flbulgarelli flbulgarelli merged commit 2c2b09e into master May 6, 2018
@ghost ghost removed the pending-review label May 6, 2018
@flbulgarelli flbulgarelli deleted the issue#157-add-python-support branch May 6, 2018 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants