home.social

#standardml — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #standardml, aggregated by home.social.

  1. New blog post: Rules, Types, and Glue: A Multi-Paradigm Architecture for Game Simulation 🎮🧱

    A deep dive into combining classical AI and strict type systems for high-performance simulation engines. I evaluate:
    🧠 Prolog for symbolic reasoning (Rules)
    🧱 Coalton for static type-safety (Types)
    🔄 Common Lisp as the high-speed runtime (Glue)

    Includes SBCL vs. ECL performance benchmarks.

    Read it here: dwightaspencer.com/posts/03-ru

    #CommonLisp #Prolog #StandardML #FunctionalProgramming #GameDev #Simulation

  2. New blog post: Rules, Types, and Glue: A Multi-Paradigm Architecture for Game Simulation 🎮🧱

    A deep dive into combining classical AI and strict type systems for high-performance simulation engines. I evaluate:
    🧠 Prolog for symbolic reasoning (Rules)
    🧱 Coalton for static type-safety (Types)
    🔄 Common Lisp as the high-speed runtime (Glue)

    Includes SBCL vs. ECL performance benchmarks.

    Read it here: dwightaspencer.com/posts/03-ru

    #CommonLisp #Prolog #StandardML #FunctionalProgramming #GameDev #Simulation

  3. Some late nights, when I lie down in bed (you know, to work), my outmoded brain keeps screaming in my mind's ear that #CS undies should be taught "functional system #programming"—<𝜆|σ>, as it were—in OG FP languages, like #StandardML or #OCaml, on a proper academic+industrial #OS, like FreeBSD, NetBSD, OpenBSD, or a similar BSD #UNIX. (Sorry, AT&T, you lost me, after your 6th Edition, or maybe your 7th Edition; but then, who cares, at this point.)

    • "UNIX System Programming with Standard ML", Shipman (2001)
    mlton.org/References.attachmen
    • "UNIX System Programming in OCaml", Leroy (2014)
    ocaml.github.io/ocamlunix/ocam

  4. A little gem of an opening salvo from the "Learning #StandardML", #Tufts U Comp 105 course handout:

    ————
    For someone with a background in COMP 11 and COMP 15, the fastest and easiest way to learn Standard ML is to buy Ullman’s book and work through chapters 2, 3, 5, and 6. But many students choose not to buy Ullman—a move that saves money but costs time. You can recover some of the time by reading this guide; it enumerates the most important concepts, and it tells you where to find key information, not just in Ullman, but also in three other sources:

    • Jeff Ullman’s "Elements of ML Programming" (ML’97 edition)
    • Norman Ramsey’s "Programming Languages: Build, Prove, and Compare"
    • Mads Tofte’s “Tips for Computer Scientists on Standard ML" (Revised)
    • Bob Harper’s draft "Programming in Standard ML"

    Know your sources! Mads Tofte and Bob Harper both worked with Robin Milner on the design of Standard ML, and they helped write the Definition of Standard ML. They know what they’re talking about, and they have good taste—though Tofte’s use of the ML modules is considered idiosyncratic. Norman Ramsey at least knows some functional programming. Jeff Ullman, by contrast, got his start in the theory of formal languages and parsing, then switched to databases. He may like ML, but he doesn’t understand it the way the others do.
    ————

    I don't know any professors who teach at Tufts, but the word on the Web is that Ramsey is the author of this handout. Cheeky blighter!🤣

    cs.tufts.edu/comp/105-2017f/re

  5. Looking for a crash course in Standard ML/NJ for someone who has never done functional programming. Got about a week. 😬 #functionalprogramming #standardml

  6. The #DEC #VAX-11/780 was the top-of-the-line 32-bit minicomputer, when I entered #CS. It occupied a large, climate-controlled room. The one I used had 256 KB of RAM. It was in continuous service from the late 1970s to the early 2000s, so it belongs in the pantheon of "great computers".

    #StandardML is universally accepted as the mother of all modern #functional #programming languages, including #OCaml and #Haskell. The earliest ML implementation I used was Cardelli's VAX ML.

    Today, we have $0.99 32-bit microcontrollers, which are the size of a thumbnail, but can run rings round the VAX-11 in all aspects of performance and capability. There ought to be bare metal implementations of ML, OCaml, Haskell, etc., for the MCUs.

    aliexpress.us/item/32568073098

  7. I'd say this "introduction" to #StandardML is the most trenchant I've ever read. And I can't find fault in its concise and incisive, if cutting at times, description of both the language and its luminaries. It was written for the COMP105 course at #Tufts, and it suits its purpose. But I don't recommend it for self-study novices unfamiliar with SML.

    • Tofte’s use of the ML modules is considered idiosyncratic. p.1
    • Jeff Ullman got his start in the theory of formal languages and parsing, then switched to databases. He may like ML, but he doesn’t understand it. p.1
    • For reasons best known to Robin Milner, Standard ML does not use the unary minus sign used in every other known language. Instead, Standard ML uses the ~ as a minus. p.2
    • Jeff Ullman doesn’t understand how to program with tuples. His section 2.4.2 should be torn out of your book and shredded. p.3

    And so on....🤣

    cs.tufts.edu/comp/105-2020f/re

  8. "It also emphasizes that functions are a kind of “value” in mathematics (namely, a certain set of ordered pairs), and that the variable f is bound to that value (i.e., that set) by the declaration." -- Robert Harper, Programming in Standard ML (2011)

    Source: cs.cmu.edu/~rwh/isml/book.pdf

    #programming #mathematics #standardml

  9. "One might say that old bindings never die, they just fade away." -- Robert Harper, Programming in Standard ML (2011)

    Source: cs.cmu.edu/~rwh/isml/book.pdf

    #programming #standardml

  10. My favourite simply-typed #functional #programming language was, is, and will always be, #ML#StandardML '97, nowadays.

    To my knowledge, SML is the only modern #FP language that has a defined standard with a mathematically sound semantics, due to Milner et al.

    In the 1980s and the 1990s, when the #CS and the #IT world were dizzy with #OO, the stewards of SML exercised their judgement with considerable vigour and valour to shun all pretences of OO. This makes the language simpler and lighter, compared to FP-OO hybrid languages like OCaml, F#, and the like.

    While SML is by no means a simple language compared to say, C or Python or JavaScript, it is arguably the simplest among the descendants of ML, especially compared to modern Haskell. By "simple" I mean not only to use the language but also to teach it to the undergrad #CS students. ML's immense collection of textbooks and academic papers dating back to the early 1970s unburdens the teacher.

    Yet, I usually recommend #OCaml to my clients who want to transition to FP, especially those clients whose "business" is creating large, robust, adaptable, maintainable software in science and engineering. My reasons are manifold, but the main one is that SML'97 is "dated", whereas OCaml is "modern" in all the venerable senses of that word.

    Programming language #standardisation is a double-edge blade with a stiletto point. Without standardisation, the semantics of the language is squishy. After standardisation, the language is dead, unless the standard is kept up-to-date, like C, C++, JavaScript, etc. With or without standardisation, language longevity is hazardous, like the piercing point of a stiletto.

    In any case, I feel like a traitor to my bloodline.🤦‍♂️

  11. I was thinking of writing an OS kernel in Standard ML for fun, but the C code generation via MLton with garbage collection and dynamic linking drained all my willpower... sigh why fun languages are always so painful?

  12. Anyone else getting tired of #Rust getting the credit for (G)ADTs?

    No? Just me?

    #ocaml, #haskell, #StandardML, and #scala among others had this long before Rust and without the complexity of the borrow checker or lifetimes. Rust moves this concept of type system as bug prevention system forward for systems programming, but there is a long history of good compilers (targeting application development, not systems) that did this already (and in a few cases - better!). I am tiring of the narrative that Rust is the ”*only* memory safe language"...

  13. I just published "PFD: purely functional data structures in #Elm" on GitHub.

    These are Elm reimplementations of the data structures presented in the book "#Purely #Functional #DataStructures" (1999) by Prof. Okasaki. It is the only one of its kid that I am aware. It is a tour de force of functional thinking. The book includes #StandardML and #Haskell implementations.

    Okasaki is a descendant of the ML tradition. His PhD advisor at CMU during the mid 1990s was Prof. Harper who wrote "Programming in Standard ML" (2011), contributed to the definition of the language, and was a member of the ML posse, alongside Milner, Tofte, Reppy, MacQueen, et al.

    I chose #Elm for the following reasons:

    • Elm is a pure functional language untainted by OO
    • Elm does not yet have a comprehensive data structure library
    • Elm evolves at a deliberate pace, without succumbing to the modern CI/CD pipeline pressure
    • Elm is one of the simplest #FP languages
    • Elm is sane
    • These properties make Elm a good candidate for use in #CS education, for teaching FP, for teaching data structures, and for teaching disciplined web programming, and a comprehensive collection of data structures could be of use in undergraduate education

    An unstated, but no less important, reason for my choosing Elm is Python fatigue. I currently use Python at work, and I am also expanding my "CLRS algorithms in Jupyter notebooks" project. I like Python, but many hours of Python a day is deleterious to my #MentalHealth. Elm is both the prophylactic and the cure.

    Please note that both PFD and CLRS are my solo projects, and they are works in progress that grow incrementally. Both projects aim to help #CS undergraduate students.

    github.com/amenzwa/pfd

  14. \(\textit{Purely Functional Data Structures}\) (1999) by Chris #Okasaki is a 💎.

    All popular algorithms and data structures textbooks, including my favourite, the venerable #CLRS, are decidedly #imperative. The more a book leans toward the practical, the more blatantly imperative it gets.

    But #Okasaki's book, the only one of its kind that I'm aware, is markedly different. It's functional—purely #functional. It's written in #StandardML, my favourite #programming language. It also includes #Haskell implementations in the appendix. The writing style is typical #CS—clear, concise, cogent.

    I never got to teach from it, since it came out well after I escaped academia. But I heartily recommend serious CS students to study it, especially those with an unhealthy FP obsession. Experienced #FP programmers should read it, too. And FP novices must read it.

    amazon.com/Purely-Functional-D

  15. \(\textit{Purely Functional Data Structures}\) (1999) by Chris #Okasaki is a 💎.

    All popular algorithms and data structures textbooks, including my favourite, the venerable #CLRS, are decidedly #imperative. The more a book leans toward the practical, the more blatantly imperative it gets.

    But #Okasaki's book, the only one of its kind that I'm aware, is markedly different. It's functional—purely #functional. It's written in #StandardML, my favourite #programming language. It also includes #Haskell implementations in the appendix. The writing style is typical #CS—clear, concise, cogent.

    I never got to teach from it, since it came out well after I escaped academia. But I heartily recommend serious CS students to study it, especially those with an unhealthy FP obsession. Experienced #FP programmers should read it, too. And FP novices must read it.

    amazon.com/Purely-Functional-D

  16. \(\textit{Purely Functional Data Structures}\) (1999) by Chris #Okasaki is a 💎.

    All popular algorithms and data structures textbooks, including my favourite, the venerable #CLRS, are decidedly #imperative. The more a book leans toward the practical, the more blatantly imperative it gets.

    But #Okasaki's book, the only one of its kind that I'm aware, is markedly different. It's functional—purely #functional. It's written in #StandardML, my favourite #programming language. It also includes #Haskell implementations in the appendix. The writing style is typical #CS—clear, concise, cogent.

    I never got to teach from it, since it came out well after I escaped academia. But I heartily recommend serious CS students to study it, especially those with an unhealthy FP obsession. Experienced #FP programmers should read it, too. And FP novices must read it.

    amazon.com/Purely-Functional-D

  17. \(\textit{Purely Functional Data Structures}\) (1999) by Chris #Okasaki is a 💎.

    All popular algorithms and data structures textbooks, including my favourite, the venerable #CLRS, are decidedly #imperative. The more a book leans toward the practical, the more blatantly imperative it gets.

    But #Okasaki's book, the only one of its kind that I'm aware, is markedly different. It's functional—purely #functional. It's written in #StandardML, my favourite #programming language. It also includes #Haskell implementations in the appendix. The writing style is typical #CS—clear, concise, cogent.

    I never got to teach from it, since it came out well after I escaped academia. But I heartily recommend serious CS students to study it, especially those with an unhealthy FP obsession. Experienced #FP programmers should read it, too. And FP novices must read it.

    amazon.com/Purely-Functional-D

  18. \(\textit{Purely Functional Data Structures}\) (1999) by Chris #Okasaki is a 💎.

    All popular algorithms and data structures textbooks, including my favourite, the venerable #CLRS, are decidedly #imperative. The more a book leans toward the practical, the more blatantly imperative it gets.

    But #Okasaki's book, the only one of its kind that I'm aware, is markedly different. It's functional—purely #functional. It's written in #StandardML, my favourite #programming language. It also includes #Haskell implementations in the appendix. The writing style is typical #CS—clear, concise, cogent.

    I never got to teach from it, since it came out well after I escaped academia. But I heartily recommend serious CS students to study it, especially those with an unhealthy FP obsession. Experienced #FP programmers should read it, too. And FP novices must read it.

    amazon.com/Purely-Functional-D

  19. Most #IT practitioners today cannot comprehend #LISP macros, #StandardML functors, and #assembly, I suppose it is the sign of the times, but it is unfortunate because those were knowledge lost—like knowing how to use an RPN calculator or a slide rule.

  20. I am a connoisseur of #programming languages. And like a #wine connoisseur who does not own and operate a vineyard but appreciates the drink, I do not make languages, but I enjoy them all the same.

    Even the most jaded wine critic has his favourite wine. I, too, have my favourite language. It is #StandardML, a language that has never been an IT industry "standard" nor does it have anything to do with the IT industry's darling of the day, machine learning "ML".

    en.wikipedia.org/wiki/Standard

  21. CW: Rosetta Code

    An implementation of the #RosettaCode #ContinuedFractions arithmetic draft task, in #Mercury, based very loosely on the #StandardML (that is based on the #Scheme and the #Python:

    Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code rosettacode.org/wiki/Continued

    The implementation uses #LazyLists to represent continued fractions.

  22. CW: Rosetta Code

    I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:

    Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code rosettacode.org/wiki/Continued

    I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...

    #atslang #sml

  23. CW: Rosetta Code

    I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:

    Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code rosettacode.org/wiki/Continued

    I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...

    #atslang #sml

  24. CW: Rosetta Code

    I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:

    Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code rosettacode.org/wiki/Continued

    I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...

    #atslang #sml

  25. CW: Rosetta Code

    I have added a second #ATS implementation--this one based closely on the #StandardML, to aid people in comparing the two languages:

    Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) - Rosetta Code rosettacode.org/wiki/Continued

    I also demonstrate having the program broken into multiple files. Some things, which you might not expect to, have to be done "manually" in #ATS2 ...

    #atslang #sml