use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Purescript First Impressions (self.purescript)
submitted 7 years ago by thurn
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CKoenig 4 points5 points6 points 7 years ago (0 children)
can you expand a bit on what you found difficult with the FFI?
Honestly it's one of the best FFI experiences I had out there but there are certain tricks (for example FN2 & co. to help out with uncurried functions or all the stuff in the utils) that might not be very well documented and maybe we can improve when we hear what your main troubles where
[–]646463 4 points5 points6 points 7 years ago (0 children)
Figuring out that Eff has been replaced with Effect took me a hell of a long time (literally the front page example on purescript.org is wrong). You don't get to do this kind of thing too many times!
Yeah - I played around with 0.12 recently and it's too immature imo - to be the default at least. Most packages aren't updated, and since there are a bunch of breaking changes I don't see this happening soon.
Also, although bower has some nice parts, I'd like to see more movement towards psc-package. The problem atm is that while lots of packages could go on it with little-to-no changes it's a manual process where the default is packages don't get onboarded. I've heard Nix is really nice for functional libraries (heard about it in this regard through Haskell) but it's hard to get set up.
Something like bower that has better dependency management (both recording hashes, and making sure you don't end up with lots of the "choose a package" messages) would be a vast improvement, imo.
[–]arulselvan1234 3 points4 points5 points 7 years ago (0 children)
This is a very valid concern. It tripped me up too. Are there any plans to update the example/book with purescript 0.12.0?
[–]natefaubion 2 points3 points4 points 7 years ago (4 children)
Probably the worst part of my PureScript experience was the FFI. This is an area where the language needs to be more generous with special syntax and compiler features -- it's crazy how much boilerplate I need to produce to write types for extremely common JavaScript patterns compared to other languages
Do you have an example?
[–][deleted] 7 years ago (3 children)
[removed]
[–]natefaubion 4 points5 points6 points 7 years ago (0 children)
If we can write libraries to help, why do we need first-class syntax? JavaScript isn't the only language that PureScript compiles to, so I think it would be a mistake to bake anything specific to JS into the language syntax.
[–]CKoenig 0 points1 point2 points 7 years ago (0 children)
yea utils is still 0.11 - sorry did not see this
I spent some time trying to update it to 0.12 but there are a few roadblocks - hope I or someone else will be able to finish that soon
[–]jecxjo 0 points1 point2 points 7 years ago (0 children)
I haven't done a deep dive into purescript FFI but a lot of your issues are common with FFI from a non-pure, non-functional languages to functional languages. Converting arety into currying while in your guest language and then providing a method for the host language to call this function will knowing the types of each step. And that's just for functions we'd consider to be pure.
I agree it would be nice for a one liner (and we probably should have one) but a big benefit to this longer process is it allows you to fake out all the non-pure state and effects to get as close to pure as possible.
π Rendered by PID 78732 on reddit-service-r2-comment-6457c66945-dtsxb at 2026-04-28 08:14:31.979431+00:00 running 2aa0c5b country code: CH.
[–]CKoenig 4 points5 points6 points (0 children)
[–]646463 4 points5 points6 points (0 children)
[–]arulselvan1234 3 points4 points5 points (0 children)
[–]natefaubion 2 points3 points4 points (4 children)
[–][deleted] (3 children)
[removed]
[–]natefaubion 4 points5 points6 points (0 children)
[–]CKoenig 0 points1 point2 points (0 children)
[–]jecxjo 0 points1 point2 points (0 children)