News for hackers. Stuff that matters.
Re:Standard ML Family by seanstrom on Saturday April 16, 2022 @06:36PM (#31056698)
As a fan of ML family languages I have a question for SML lovers. What do you typically build with SML?

For context, I’m web programmer and I’m also learning game dev, can I use SML productively?

Or are there other tasks that I could use SML for?

Re:Standard ML Family by sshine on Saturday April 16, 2022 @08:04PM (#31057214)
SML for web and game dev? Why not!

There is the Rails-inspired web framework SML on Stilts: — https://github.com/j4cbo/stilts — presumably named after its great ergonomics.

And there is the SDL-powered MosGame, specifically for the Moscow ML compiler — https://github.com/Eckankar/MosGame — it comes with these examples: https://github.com/Eckankar/MosGame/tree/master/examples

But really, SML is primarily good for writing compilers.

Re:Standard ML Family by qznc on Sunday April 17, 2022 @05:05AM (#31059555)
SML could be a nice “typed Lua” for scripting.
Re:Standard ML Family by mbrock on Sunday April 17, 2022 @07:06AM (#31060013)
Especially if there was an implementation that could build from C source code in a simple way without requiring an existing SML compiler…
Re:Standard ML Family by nextos on Saturday April 16, 2022 @07:58PM (#31057176)
SML has an insanely good optimizing compiler, MLton.

With some backing SML could be the language of choice for safe and efficient applications.

Re:Standard ML Family by porcoda on Saturday April 16, 2022 @11:55PM (#31058336)
I use it for my work in program analysis, code generation, and other languages-research projects. I’ve also used it to a lesser degree for modeling and simulation problems.

You would probably be better served by F# or Ocaml for a web-oriented ML stack. SML has less of an ecosystem in that area.

Re:Standard ML Family by jlokier on Saturday April 16, 2022 @09:04PM (#31057511)
I used to work on a hardware compiler written in SML, which compiled a language called Handel to logic circuits for FPGAs.

Mostly I worked on fancy optimisation passes, and a fast gate-level simulator.

Similar to languages like Haskell which emphasise first-class algebraic datatypes (tagged unions) and pattern-matching in a concise but clear syntax, it's good for writing things that manipulate tree-like and symbol-heavy data structures like program syntax trees and circuit graphs, and quickly trying out new ideas with those.

Re:Standard ML Family by csb6 on Saturday April 16, 2022 @06:45PM (#31056764)
It is good at parsing/other compiler-related tasks. Basically anything where you are working with tree structures I think can be a good fit. It is also good as a way to learn about functional programming.
Re:Standard ML Family by chrischen on Saturday April 16, 2022 @08:36PM (#31057373)
React.

https://news.ycombinator.com/item?id=15209814

Also the commentor is one of the maintainers of the ReScript compiler, which is essentially being forked from Ocaml.

Re:Standard ML Family by rixed on Sunday April 17, 2022 @12:20AM (#31058468)
It is said ML languages are good for compilers. I would say more broadly that they are perfect for anything symbolic.