A Functional Language with Effect Types and Handlers

/ A generator effect with one operation
effect yield<a> {
  fun yield( x : a ) : ()

// Traverse a list and yield the elements fun traverse( xs : list<int> ) : yield<int> () { match(xs) { Cons(x,xx) -> { yield(x); traverse(xx) } Nil -> () } }

fun main() : console () { with fun yield(i : int) { println(“yielded ” ++ i.show)
} [std/core/Cons: forall<a> (head : a, tail : list<a>) -> list<a>1,2,3].traverse }

Read More

Foolang is a Smalltalk-inspired language that, like all new languages, has somewhat optimistic aspirations:

  • Elegance and power of Smalltalk and Self: Smalltalk-like syntax, deep object orientation, and late binding as default.

  • Performance of C++: Support for early binding when you need it, so that the compiler can go to town. Low-level operations which allow eliding overflow checking in tight loops, etc.

  • Fault tolerance of Erlang: Agent-model, isolated heaps, and supervisors. No undefined behavior.

Read More
May 31

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language:

Do you have a new systems programming project on your todo list? If you’re feeling adventurous, I would like you to give it a crack in our new systems programming language, and to use it to drive improvements in the less-developed areas of our standard library.

Are you making a new coreutils implementation? A little OS kernel? A new shell? A GUI toolkit? Database system? Web server? Whatever your systems programming use-case, we think that our language is likely to be a good fit for you, and your help in proving that, and spurring development to rise to meet your needs, would be quite welcome.

Here’s our pitch:

XXXX is a systems programming language designed to be simple and robust. XXXX uses a static type system, manual memory management, and a minimal runtime. It is well-suited to writing operating systems, system tools, compilers, networking software, and other low-level, high performance tasks.

You can get a peek at how it feels by reading about the finger server I wrote with it.

Sounds interesting? Please tell me about your project idea!

Read More

With the recent release of version 1.2.2, it seems like a good moment to talk about the future. We are making plans for a version 1.3 and, eventually a “Rosie 2.0”. In this post, we’ll first look at the use cases for Rosie/RPL and then what’s coming in Rosie v1.3. We’ll save the topic of “Rosie 2.0” for a future post.

In 1994, LaTeX2e was released as a transitional step towards LaTeX 3. 26 years later, there still isn’t a 1.0 release of LaTeX 3. In the interim, we’ve seen the rise of HTML and the web, the dominance of PDF as a format for representation of printed material (and now there is a plan to have PDF extended with “liquid mode” that allows reflowing of PDF text for smaller screens).

In the meantime, the TeX engine has been extended multiple times, the little-used TeX-XeT, some early efforts to support large Asian character sets, and we have in widish use pdfTeX, XeTeX, LuaTeX along with an assortment of abandoned engines. Worst of all, it seems that none of pdfTeX, XeTeX or LuaTeX can serve as the one TeX to rule them all, each with some limitations that can require users to switch engines depending on their needs.

Read More

Natalie is a work-in-progress Ruby implementation, compiled to C++, by Tim Morgan.

Squeak is an open, highly-portable Smalltalk implementation whose virtual machine is written entirely inSmalltalk, making it easy to debug, analyze, and change. To achieve practical performance, a translator produces anequivalent C program whose performance is comparable to commercial Smalltalks.

Other noteworthy aspects of Squeak include: a compact object format that typically requires only a single word of overhead per object; a simple yet efficient incremental garbage collector for 32-bit direct pointers; efficient bulk-mutation of objects; extensions of BitBlt to handle color of any depth and anti-aliased image rotation and scaling;and real-time sound and music synthesis written entirely in Smalltalk.

Read More

I’m developing a programming language called Kernel.  Kernel is a conservative, Scheme-like dialect of Lisp in which everything is a first-class object.

“But,” you may ask, “aren’t all objects first-class in Scheme?”  (I’m glad you asked.)  No, they aren’t.  Special-form combiners are second-class objects.  To borrow a phrase from the original description of first- and second-class objects by Christopher Strachey, they have to appear in person under their own names.  (There are also several other kinds of second-class objects in Scheme, but special-form combiners are the most commonplace.)

The idea of first-class operative combiners, i.e., first-class combiners whose operands are never evaluated, has been around a long time.  Such creatures were supported by mainstream Lisps through the 1970s, under the traditional name fexprs, but they made a mess out of the language semantics because they were non-orthogonal to the ordinary variety of procedures constructed via lambda — and, more insidiously, because at that time the mainstream Lisps were dynamically scoped (a language feature that causes more problems for fexprs than it does for the less powerful macros).

Read More

As I already explained, I’ve invented and implemented a simple functional language (PYFL) with a few interesting twists. Including a promising but simple approach to input.

The basic language itself is pretty standard, except that it uses infix operators and conventional mathematical notation for function calling; e.g. f(h,a+2*y). It also has a wide range of variable binding operators; as in the following program

This short blog post is about the origin of languages for describing tasks in automation, in particular for industrial robot arms. Three people who have passed away, but were key players were Doug Ross, Victor Scheinman, and Richard (Lou) Paul, not as well known as some other tech stars, but very influential in their fields. Here, I must rely not on questions to them that I should have asked in the past, but from personal recollections and online sources.

Jolie is a contract-first programming language, which puts API design at the forefront. It supports both synchronous and asynchronous communication. Data models are defined by types that support refinement (in red on the right), and DTO (Data Transfer Objects) transformations are transparently managed by the interpreter.

hyperscript is an experimental scripting language designed for the web, inspired by HyperTalk

hyperscript features include:

Read More

One of the main technical goals I set for Galactology was to fully support user mods. The core of the game is written in C++, and asking for mods to be delivered as native DLLs is a mess and also non-portable, so it was clear to me early on that the best would be to enhance the existing Scheme scripting support, to the point I wanted to use it instead of C++, and then rewrite most of the game in Scheme, as if it was collection of mods.

Galactology, as the sequel slash rewrite of The Spatials, inherited its support for s7 Scheme. But what was there had a very limited scope. It was only able to be run for scripting planet missions, and it had limited support for interacting with the rest of the C++ side.

Read More

Cowgol is an experimental, Ada-inspired language for very small systems (6502, Z80, etc). It’s different because it’s intended to be self-hosted on these devices: the end goal is to be able to rebuild the entire compiler on an 8-bit micro, although we’re not there yet.

Here’s the bullet point list of features:

  • a properly type safe, modern language inspired by Ada

  • the compiler is written in itself and is fully bootstrapped

  • a table-driven, easy to port backend (the 80386 backend is 1.2kloc with no other compiler changes needed)

  • tiny: the 80386 Linux compiler binary is 70kB (including ELF overhead) The 8080 CP/M compiler 58kB (split across two executables)

  • fast: on my PC it’ll compile itself in 360ms 130ms 80ms.

  • global analysis: dead code removal and static variable allocation, leading to small and efficient binaries

Read More

Lobster is a programming language that tries to combine the advantages of static typing and compile-time memory management with a very lightweight, friendly and terse syntax, by doing most of the heavy lifting for you.

While it is a general purpose language, its current implementation is biased towards games and other graphical things, with plenty of “batteries included” functionality.

Oscar Spencer recently presented Grain, a new strongly-typed, high-level language that compiles to WebAssembly. Grain includes functional programming features (e.g., type inference, pattern matching, closures) while allowing mutable variables. Grain also has a standard library with composite data structures (Option, Stack, Result) and system calls (e.g., I/O, process handling).

In a talk at the WebAssembly Summit 2021, Spencer went through the main characteristics of Grain, a programming language that he said is made exclusively for WebAssembly, its only compile target.

Read More

“Strand” is an open-source implementation of the identically named
parallel Prolog dialect as described in the book “Strand: New
Concepts for Parallel Programming” by Ian Foster and Stephen Taylor.
Strand represents a very elegant and concise notation for expressing
concurrent and distributed algorithms using only a small number of
fundamental language constructs and a very simple execution model.

This implementation of Strand is written in Forth and runs on Linux x86-64/ARM, Mac OS X x86-64 and OpenBSD amd64 systems, has no dependencies and is entirely self-contained. Operating system facilities are invoked directly via system calls, no C runtime library is required. The Forth system is provided with source code and is able to recompile itself into an ELF or Mach-O binary.

“Strand” is a trademark of Artificial Intelligence Ltd., which once offered a commercial implementation.

Read More

Two textbooks defined a generation of PL instruction: Types and Programming Languages and Advanced Topics in Types and Programming Languages. Since then, we’ve seen a new generation of resources that set new standards for presentation—Programming Languages: Application and Interpretation, the Homotopy Type Theory book, Software Foundations, Certified Programming with Dependent Types—but these “books” also have another interesting characteristic: they’re freely available, or even open source. Some of them don’t even have physical versions!

These books are a tremendous resource. I believe we can do more. The PL community can develop an open-source, open-access, and interactive journal for excellent explanations of important ideas. There’s precedent in the ML community: Distill. Distill offers beautiful and well explained examples of machine learning research, with more than a million unique readers in its first year! Many Distill articles link to computational notebooks, which allows readers to quickly work with state-of-the-art implementations and demonstrations. What’s more, managing accessibility to, e.g., screen readers, is much more tractable in HTML than in LaTeX-generated PDF.

Such a journal—let’s call it exPLain just to give it a name—would increase the reach and impact of PL research, help train new students, and foster a culture of reproducible public artifacts. Clear explanations of new or big ideas will help develop the field by expanding the use and understanding of those ideas, just as TAPL and ATTAPL did for the use of syntactic methods in type systems and semantics.

Changes in publishing are afoot in SIGPLAN and beyond. Some of these changes are happening whether we want them or not! Moshe Vardi seems optimistic about how “ACM is launching a Presidential Task force on Future Formats for ACM Conferences”. I’m not so optimistic. If we don’t have our own approaches to future formats, we’ll end up with something like TAPS, with its approved list of packages and restrictions on custom macros

Read More

Kitten is a statically typed, stack-based functional programming language designed to be simple and fast. It is a concatenative language, combining aspects of imperative and pure functional programming. There is an introduction available and a tutorial in progress.

Hare is a statically typed programming language which compiles to machine code. It has manual memory management, no runtime, and uses the C ABI. Hare is designed for systems programming, and is well-suited to writing operating systems, system tools, compilers, and other low-level, high-performance tasks.

Programming Languages

Discuss interesting/experimental programming languages.

Created on Nov 12, 2020
By @root