News for hackers. Stuff that matters.
Re:WebML: A Standard ML Compiler for the Web by melling on Sunday March 08, 2020 @03:05PM (#22519858)
There's also a well supported ML for the web from Facebook:

https://reasonml.github.io/

With React:

https://reasonml.github.io/reason-react/

Re:WebML: A Standard ML Compiler for the Web by Athas on Sunday March 08, 2020 @04:06PM (#22520229)
None of these are Standard ML! There are people who prefer SML for various reasons.

Somewhat unexpectedly, there is in fact already a very good SML-to-browser solution, namely the unfortunately named SMLtoJs: https://github.com/melsman/mlkit/blob/master/README_SMLTOJS....

It's from 2011 and so predates most other Javascript-targeting languages. It's unfortunate it never got any traction.

Re:WebML: A Standard ML Compiler for the Web by eatonphil on Sunday March 08, 2020 @05:26PM (#22520726)
SOSML [0] came out recently, written in TypeScript and sporting an online interpreter. Then there's this prominent SML-er's JavaScript backend for Moscow ML [1]. And Andreas Rossberg's HaMLet [2] also has a JavaScript backend.

[0] https://github.com/SOSML/SOSML

[1] https://github.com/kfl/mosml-js

[2] https://people.mpi-sws.org/~rossberg/hamlet/

Re:WebML: A Standard ML Compiler for the Web by lymitshn on Sunday March 08, 2020 @03:38PM (#22520047)
There is also F# Fable[0] compiler that compiles F# to JS. I would say its more ML like, syntax wise (excluding bucklescript ofc).

[0] https://fable.io/

Re:WebML: A Standard ML Compiler for the Web by kqr on Sunday March 08, 2020 @04:49PM (#22520510)
I was going to point out the same; if you can get your ML fix from F#, definitely look Fable up -- it's nothing but surprised me with how well polished it is.
Re:WebML: A Standard ML Compiler for the Web by elcapitan on Sunday March 08, 2020 @03:27PM (#22519971)
Facebook's part is actually just the syntax of ReasonML, the actual ML-Javascript-compiler is Bucklescript from Bloomberg.
Re:WebML: A Standard ML Compiler for the Web by chenglou on Sunday March 08, 2020 @06:30PM (#22521078)
BuckleScript’s author works for Facebook for years now.
Re:WebML: A Standard ML Compiler for the Web by kccqzy on Sunday March 08, 2020 @03:36PM (#22520036)
Reason is just a syntax frontend. You should be linking to BuckleScript instead.
Re:WebML: A Standard ML Compiler for the Web by eatonphil on Sunday March 08, 2020 @05:41PM (#22520803)
The usual pitch: if you're interested in seeing more Standard ML news, check out /r/sml on Reddit. There's relatively good discussion and postings for a small subreddit.
Re:WebML: A Standard ML Compiler for the Web by jez on Sunday March 08, 2020 @08:07PM (#22521669)
Re:WebML: A Standard ML Compiler for the Web by mhd on Sunday March 08, 2020 @05:33PM (#22520769)
Interesting, the second new ML compiler to arrive on the scene, after Morel[1].

[1]: https://github.com/julianhyde/morel

Re:WebML: A Standard ML Compiler for the Web by eatonphil on Sunday March 08, 2020 @05:41PM (#22520808)
Cool! I hadn't heard of this. SOSML [0] is the other most recent one I'm aware of.

[0] https://github.com/SOSML/SOSML

Re:WebML: A Standard ML Compiler for the Web by xuejie on Sunday March 08, 2020 @09:15PM (#22522048)
While I certainly agree a Standard ML compiler can be quite useful(and huge respect for the author!), I noticed the compiler is purely written from scratch, and the question remains when the quality of generated code can be as decent as BuckleScript behind ReasonML. Unless SML fits well with the model of WASM(which I believe is not the case), significant work will be required to tweak the compiler.
Re:WebML: A Standard ML Compiler for the Web by darksaints on Sunday March 08, 2020 @05:36PM (#22520786)
I don't really follow web development much...what is the status of DOM APIs in WebAssembly? Is it now possible to use a WebAssembly-compiled language end to end, without any javascript acting as an intermediary?
Re:WebML: A Standard ML Compiler for the Web by enos_feedler on Sunday March 08, 2020 @06:13PM (#22520980)
I've been wondering the same, but also trying to understand the impact of DOM access in WebAssembly. This might create a massive fragmentation problem for web platform code and I am not sure the benefit. ObjC -> Swift worked. Java -> Kotlin might work for Android, though still somewhat annoying.

I don't know what the future of communicating web code with snippets would be like if everyone chose their own language. I am not a web developer, but is this happening with TypeScript now? Is it a problem?

EDIT: I am pro-WebAssembly, but I am starting to think the benefits are actually about taking the philosophy of the web outside the browser and leave DOM-based pages to html/css/js

Re:WebML: A Standard ML Compiler for the Web by protomyth on Sunday March 08, 2020 @03:39PM (#22520054)
Is there a license? I looked at the source for a few files and found none.
Re:WebML: A Standard ML Compiler for the Web by adultSwim on Sunday March 08, 2020 @06:02PM (#22520925)
Curious if they will be using Javascript garbage collection or rolling their own
Re:WebML: A Standard ML Compiler for the Web by hajile on Sunday March 08, 2020 @07:55PM (#22521607)
If you're compiling to wasm, you don't have access to JS directly.
Re:WebML: A Standard ML Compiler for the Web by Koshkin on Sunday March 08, 2020 @11:26PM (#22522735)
Meta: I have an eye strain each time I have to figure out which of the two things ML stands for. (Well, "Standard" kinda helps in this particular case, but I do not trust myself.)
Re:WebML: A Standard ML Compiler for the Web by GolDDranks on Monday March 09, 2020 @12:31AM (#22523009)
Not two but three things: * Meta language * Markup language * Machine learning