Hacker News new | ask | show | jobs
by seanstrom 1522 days ago
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?

7 comments

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.

SML could be a nice “typed Lua” for scripting.
Especially if there was an implementation that could build from C source code in a simple way without requiring an existing SML compiler…
SML has an insanely good optimizing compiler, MLton.

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

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.

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.

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.
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.

It is said ML languages are good for compilers. I would say more broadly that they are perfect for anything symbolic.