mlton VS The-Spiral-Language

Compare mlton vs The-Spiral-Language and see what are their differences.

The-Spiral-Language

Functional language with intensional polymorphism and first-class staging. (by mrakgr)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
mlton The-Spiral-Language
9 33
907 890
0.7% -
8.5 9.6
11 days ago 3 days ago
Standard ML Python
GNU General Public License v3.0 or later Mozilla Public License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

mlton

Posts with mentions or reviews of mlton. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-25.
  • Flunct: Well-typed, fluent APIs in SML
    4 projects | news.ycombinator.com | 25 Jun 2023
    https://github.com/MLton/mlton/issues/473

    Is there sufficient use of MLTon "native" backend out there to consider it mature? or Do people prefer the LLVM or C backend instead in general?

  • Simple JSON parser in c++, rust, ocaml, standard ml
    3 projects | dev.to | 11 Feb 2023
    Once I got the parser ready in OCaml, I thought I port it to Standard ML, since it belong to the same ML language family. I was also curious on how well mlton could optimise it. The language lacks custom let bindings, so I resorted to use Result.bind manually. This makes code much less readable and more verbose. The standard library also lacks result type, so I had to come up with my own simple implementation. There's also a lack of any hash map in the standard library, so I just used a list of key-value pairs. This isn't correct, but it's the closest I could get without inventing my own hash map. MLton's compile times are slow. It also lacks interactive REPL. Because of that I used alternative Standard ML implementation for interactive usage: PolyML. Debugging MLton binaries is also pretty hard. gdb doesn't work and there's no bundled debugger. I had to resort to debugging facilities built into PolyML. Valgrind doesn't work with mlton binaries, as it doesn't report any memory allocations. Looks like mlton uses mmap for allocation memory. Surprisingly, performance is not the best. This might be due to heavy usage of my custom Result type and bind calls. Exceptions seem to be a more natural choice for error reporting in Standard ML. I tried to make such a change, but this didn't improve the performance much.
  • old languages compilers
    12 projects | /r/ProgrammingLanguages | 26 Dec 2022
    MLton
  • Ante: A low-level functional language
    4 projects | news.ycombinator.com | 17 Jun 2022
    If you’re fine with tracing GC (which depends on the situation, of course), Standard ML is a perfectly boring language (that IIUC predated and inspired Caml) and MLton[1] is a very nice optimizing compiler for it. The language is awkward at times (in particular, the separate sublanguage of modules can be downright unwieldy), and the library has some of the usual blind spots such as nonexistent Unicode support (well, not every language WG is allocated a John Cowan).

    Speaking of, Scheme can also be a delightful unexciting static language; consider for example the C-producing implementation Chicken[2]. The pattern-matching / algebraic-datatype story was still rather unsatisfying last I checked, but there are other situations where it shines—it’s complementary to SML in a way.

    You’re not going to be writing a kernel or a real-time renderer in either (though I’m certain people have taken that as a challenge), they son’t afford the flashy EDSLs of Tcl, Ruby, or Racket, and I can’t say I can prototype in them like I do in Python or sh+tools, but there is a comfortable middle ground where they fit well. (I hear others use Go in what seem like the same places, but to me it feels so thin and devoid of joy that I can’t really compare.)

    The FFI tools in both of the mentioned implementations are excellent, though not quite at the “type in C declarations” level of LuaJIT and D.

    [1] http://mlton.org/

    [2] https://call-cc.org/

  • Write your own programming language in an hour with Chumsky
    4 projects | news.ycombinator.com | 12 Apr 2022
    Unfortunately, I haven't found a ton of "easily-digestible" and, at the same time, comprehensive guides on compiling functional languages. Generally you'll find a mix of blog posts/class notes/papers covering a single step.

    Some resources I like:

    - Andrew Kennedy's 2007 paper Compiling with Continuations, Continued [1]. This one is the most clear IMO

    - Andrew Appel's Compiling with Continuations book (a bit outdated though... assembly code is for VAX)

    - Matt Might's series [2]

    - MLton's source and documentation [3]

    [1] https://www.microsoft.com/en-us/research/wp-content/uploads/...

    [2] https://matt.might.net/articles/closure-conversion/

    [3] http://mlton.org/

  • Why are imperative programs considered faster than their functional counterparts?
    6 projects | /r/ProgrammingLanguages | 30 Dec 2021
    More broadly, they can be fast even without such extensions if they aggressively pursue optimization opportunities afforded by static typing, like MLton for example, but that also impacts compilation performance negatively.
  • Coalton: How to Have Our (Typed) Cake and (Safely) Eat It Too, in Common Lisp
    2 projects | news.ycombinator.com | 10 Sep 2021
  • Are there any efficient key-value map/dictionary implementations in SML?
    3 projects | /r/sml | 27 Dec 2020
    https://github.com/MLton/mlton/blob/master/lib/mlton/basic/hash-set.sig https://github.com/MLton/mlton/blob/master/lib/mlton/basic/hash-table.sig

The-Spiral-Language

Posts with mentions or reviews of The-Spiral-Language. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-22.
  • Does This Language Exist?
    4 projects | /r/ProgrammingLanguages | 22 May 2023
    Try Spiral for a functional response to the system level programming demands. It has an F#, C, and a Python backend.
  • How do I get around the lack of MailboxProcessor in Fable?
    2 projects | /r/fsharp | 12 May 2023
    I did the language server for Spiral using Hopac. It involved turning the entirety of what would have been the sequential compilation pipeline into a promise stream.
  • Are there any good resources on reflection in Fable?
    2 projects | /r/fsharp | 24 Apr 2023
    Sigh, despite using F# for so long, I've always avoided tackling .NET reflection, but I know from experience (of programming in Spiral) that this is a perfect place to introduce these techniques. Type systems like F#'s really hit their limits when it comes to serializing data across platform and language boundaries, so this is The place to demonstrate the use such methods.
  • Ask HN: How do I get the most benefit out of my programming language?
    3 projects | news.ycombinator.com | 14 Jan 2023
    I originally started work on [Spiral](https://github.com/mrakgr/The-Spiral-Language) back in late 2016 because I wanted a functional language in which I could program novel AI hardware that hadn't existed at the time, and still doesn't, but it won't be long before it arrives. It took 3 years of full time work to get it to its current standard of quality, and I'd really feel comfortable programming new hardware devices in my favored functional style. I've designed Spiral so it is both extremely powerful, easy to use while being efficient enough to program devices like GPUs that can't even use heap allocation for their objects.

    I am not really concerned about what I'll do when I get access to Tenstorrent chips in six months; my personal needs for the language are met. But I would like it if I could spread the language more broadly, make it useful for people other than myself and get people to sponsor my work on it.

    Here is the value proposition of Spiral.

    It is a high-level functional PL that has some features that other languages don't, but that isn't really the point. On mainstream devices like the x86 ones there are a lot of programming languages that are good, and it would be tedious to use Spiral to compile to such platforms compared to using such languages directly. It is a bit how ReasonML compiles to JS. Back when I tried it I found using Typescript easier to deal with. So that is not where I'd like to go into, though using Spiral would have benefits in certain areas.

    Rather, while reading the [CNX blog](https://www.cnx-software.com/) I realized that while consumer facing AI chips are not here yet, there is a lot of hardware development in the embedded space. They are heterogenous architecture. They have GPU and TPUs in addition to CPUs. And these cross platform interactions within the same system is something that existing languages are really poor at tackling.

    If you look at Python or C#, for example, you can't really program the GPU on them directly. They are CPU focused, and don't have the right semantics and would be too inefficient to program devices like GPUs directly. The way I've designed Spiral is that you can program the CPU and the GPU and whatever else from within the same language.

    It is not suitable for just GPUs, check this [demo out](https://github.com/mrakgr/PIM-Programming-In-Spiral-UPMEM-Demo). I recently did a backend for UPMEM devices, which are the first commercialized Process-In-Memory chips. I've posted the link to this on HN yesterday and on the Reddit embedded sub, but I got zero interest. And this is really a pity because that map kernel I've demoed is actually a big deal. Back when I first started working on Spiral, it took me 1.5 years of full time work to get to the point where I could write a program like that in the language. And without backend nesting of the kind that Spiral offers, it is impossible to write those kinds of programs no matter how skilled one is as a programmer.

    The kind of backend nesting I've demonstrated is not something you can do in F#, Python or any of the languages that I know of. I could easily create such backends for many kinds of hardware. And people would benefit from that because unlike the mainstream computing devices, the hardware coming down the pipeline will have poor language support, nothing on the level of what Spiral offers. For the kinds of heterogeneous architectures I am envisioning, the language designs that are good in the CPU-dominant era, will simply not be suited in the heterogeneous era.

    I need chances to demonstrate how good Spiral is, but I am not sure how to get them. If I do not get them, the future of computing will be a lot worse off. I wasn't there when Cuda was incumbent so I missed the boat on that, but I'd like it if Spiral became dominant on future computing devices. Not because I was the one who made the language, but simply because no other design is as suited for them.

  • September 2022 monthly "What are you working on?" thread
    10 projects | /r/ProgrammingLanguages | 1 Sep 2022
    Two months ago I did a ref counted C backend for Spiral so I might as well plug it now. Since then I've gotten tired of 3d art, and decided to just start writing Heaven's Key.
  • Multistage Programming / First Class runtime compiler support
    6 projects | /r/ProgrammingLanguages | 19 Aug 2022
    Spiral
  • Are there examples of programming language compilers that evaluate the side-effect free parts of the program at compile-time?
    2 projects | /r/ProgrammingLanguages | 14 Aug 2022
    Another term to search for is partial evaluation. An interesting language that by default evaluates everything at compile time is Spiral, developed by someone frequenting this subreddit.
  • June 2022 monthly "What are you working on?" thread
    9 projects | /r/ProgrammingLanguages | 1 Jun 2022
    I wrote this as a part of a Twitter chain before realizing just how limiting 140 chars per post are. It will serve as a PL monthly review instead. So far there has been no bites to my posts on the Tenstorrent and Groq Reddit pages, so it does not seem I am likely to get a sponsor for Spiral. At this time, rather than AI chips I'd rather get GPUs to speed up my rendering times.
  • May 2022 monthly "What are you working on?" thread
    15 projects | /r/ProgrammingLanguages | 1 May 2022
    If you are a company making or using novel AI hardware, and want to add functional programming to your toolset, consider checking out Spiral and sponsoring a backend for it. Though please, no more GPUs. They were interesting last decade, but they are old now.
  • Why are imperative programs considered faster than their functional counterparts?
    6 projects | /r/ProgrammingLanguages | 30 Dec 2021
    If you wanted a fast FP lang you'd need to extend it with partial evaluation features such as in my own Spiral. This does increase the complexity of the language, and runtime benefits have to be paid by doing more work at compile time which increases compilation times.

What are some alternatives?

When comparing mlton and The-Spiral-Language you can also consider the following projects:

lust - A fast, auto-optimizing image server designed for high throughput and caching; Now that is hot.

kuroko - Dialect of Python with explicit variable declaration and block scoping, with a lightweight and easy-to-embed bytecode compiler and interpreter.

exp-flow - experimental rule-based programming formalism under construction [Moved to: https://github.com/contrast-zone/canon]

gaiman - Gaiman: Text based game engine and programming language

cish - Go + Generics + Sum Types

Vale - Compiler for the Vale programming language - http://vale.dev/

4l - lisp like looking language

RustScript2 - RustScript is a functional scripting language with as much relation to Rust as Javascript has to Java.

LunarML - The Standard ML compiler that produces Lua/JavaScript

yasl - Bytecode Interpreter for Yet Another Scripting Language (YASL).

Cwerg - The best C-like language that can be implemented in 10kLOC.

xvm - Ecstasy and XVM