[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I'm looking into functional languages that can transpile

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 1

File: PureScript_Logo.png (5KB, 300x300px) Image search: [Google]
PureScript_Logo.png
5KB, 300x300px
I'm looking into functional languages that can transpile to JS. Should I learn Elm or Purescript?

I have a bit of prior Haskell experience, just enough to know what a monad transformer is.
>>
For what purpose? With its first-class closures, partial application, and natively-implemented {map, filter, reduce} JS is already functional as heck. Just
import * as _ from 'underscore'
if you want stuff like zip and repeat.
>>
Read this:
http://mutanatum.com/posts/2017-01-12-Browser-FP-Head-to-Head.html

Perhaps vanilla JS with Ramda and Mocha might be enough for you.

For a more general FP experience ScalaJS might be a good choice.
>>
Since you already have haskell experience, this means purescript is going to be accessible to you. I believe it is more difficult to get started with purescript than elm, but elm is going to be more limiting in the long run.

Elm is going to be easier to get things done like rails but you are constrained to the elm framework. Elm is more popular and you may find jobs for it.
>>
>>61716982
The purpose would be for the haskell style type system. I didn't really appreciate it until I did some significant work in purescript and saw what a difference it made for refactoring.

It moves a lot of bugs/user errors from runtime issues into compiler errors/warnings.
>>
Use Haskell, Stack can make a HS->JS compiler for you.("stack new ghcjs")
>>
>>61716982
>>61717424
You don't transcompile to Javascript for language features, you do it so you don't have to use Javascript.
>>
>>61717392
>but elm is going to be more limiting in the long run.
I've read this elsewhere, but isn't only a frontend replacement for js? What are the limits then?
>>
>>61720804
Elm includes the "elm architecture" which is the builtin, conventional API for doing webapps. It includes things like Models, Messages, and HTTP requests. I haven't used it very much but it is something like the framework Redux.

This framework is basically what Elm is all about, so it is not really used as a language outside of that. I also heard that the language creator doesn't want it to be used for server side code (node.js).

Purescript does not have this problem as it is firstly intended as a general purpose language. Frontend frameworks are separate libraries like Pux or Halogen. The trade-off is that it slower to get started as there is no "official" way to do things. The community, documentation, and error messages of Elm make it much easier to get up and running.
>>
>>61717424

>It moves a lot of bugs/user errors from runtime issues into compiler errors/warnings.

Wow, if only other languages and frameworks that could do that. The first one to do it for the web was killed off starting 06 or so because jobs didn't like it. The second in 08 was Google's attempt and laughed away by your average web idiot because web just doesn't adhere itself to compiled languages. Then we had a period of rebuilding things that had been around since 03, leading us to today with incredibly innovative, cutting edge things like typing systems (typescript), web workers (threads), angular/react (flash), and web assembly (compiled binaries).

Nope, a functional lisp clone within an already bloated world of toolchains and reengineering is the clear solution to this problem.
Thread posts: 10
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.