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.

When I first introduced Self, I mentioned that Self is a programming language which employs prototype-based inheritance; it does not depend on a class-instance distinction to facilitate object-oriented programming, but rather, it uses a prototype object from which copies are created. The methods associated with a prototype is stored in a traits object which is just another object storing methods that can be used on a prototype and all its copies through a parent slot.

The trouble begins when we actually try to implement this prototype-based inheritance system as an actual virtual machine, particularly with regards to memory consumption. Say that I have a prototype object point with a constant parent slot pointing to traits point and two assignable slots, x and y.1 When we copy this object, we would expect to copy all three fields. But if we scale that up, that’s so much unnecessary data being copied! For one, for every copy of the point prototype we make, we’re copying that traits point parent slot reference. Not to mention, because our language is dynamic, we can’t simply treat x and y as offsets into memory, because they might be constant or assignable (Self can’t intrinsically know). So our naive implementation would be pretty inefficient.

Can we make this more memory-efficient? In fact, we can; we can exploit the fact that most Self objects that are copied only ever have their assignable slots modified. Let’s take a look at how the original developers of Self have optimized the memory usage of the Self virtual machine.

A little heads-up before we begin: This one’s going to be a less hands-on post as I’m mainly going to be talking about implementation details of the VM itself rather than the Self programming environment.

Read More

Circle is a new programming language that extends C++ 17 to support data-driven imperative metaprogramming. Circle combines the immediacy and flexibility of a scripting language with the type system, performance and universality of C++. Three new features make this a more effective programming tool than Standard C++:

  1. An integrated interpreter supports the execution of normal C++ statements at compile time.

  2. Same-language reflection programmatically allows for the generation of new code without involving an elaborate DOM or API for modelling the AST.

  3. Introspection keywords inform the program about the content of types, and expose data members and enumerators as iterable entities.

Circle accepts the C++ language as a starting point, and rotates that language from the runtime to the compile-time axis, allowing you to finally metaprogram C++ using C++.

Read More

StupidStackLanguage (or SSL) is an esoteric programming language created by Lebster in which all operations take place on a Stack

SSL Uses the characters A-Z to perform actions. SSL is also case-insensitive.

Koka is a strongly typed functional-style language with effect types and handlers.

  • The core of Koka consists of a small set of well-studied language features, like first-class functions, a polymorphic type- and effect system, algebraic data types, and effect handlers. Each of these is composable and avoid the addition of “special” extensions by being as general as possible.

  • Koka tracks the (side) effects of every function in its type, where pure and effectful computations are distinguished. The precise effect typing gives Koka rock-solid semantics backed by well-studied category theory, which makes Koka particularly easy to reason about for both humans and compilers.

  • Effect handlers let you define advanced control abstractions, like exceptions, async/await, or probabilistic programs, as a user library in a typed and composable way.

  • Perceus is an advanced compilation method for reference counting. Together with evidence translation, this lets Koka compile directly to C code without needing a garbage collector or runtime system. Perceus also performs reuse analysis and optimizes functional-style programs to use in-place updates when possible.

Read More

Egison is a programming language that features extensible efficient non-linear pattern matching with backtracking for non-free data types.

Joy is a functional programming language based on the composition of functions taking one stack as argument and yielding one stack as value. Stacks can contain values of simple types such as truth values, characters and integers, and values of aggregate types such as sets, character strings and quoted programs with lists as a special case. The stack functions include the usual operations such as addition, comparison and list manipulation, but also many new kinds of functions which dequote quoted programs in various ways. These new functions behave like higher order functions, such as conditionals, various forms of recursion, and for aggregates the map, fold and filter functions. This paper gives an overview of the basic programs from which others are built by composition and quotation.

Read More

Cat is a statically typed stack-based pure functional language inspired by Joy. Cat has no variables, only instructions which manipulate a stack (e.g. dup, pop, swap), and a special expression form called a quotation (e.g. [1 add]) which pushes an expression onto the stack which can be executed at a later time (e.g. using apply or dip).

For example: 6 7 dup mul sub results in a stack with the value 43 on top.

Feb 21

Whiley is a hybrid object-oriented and functional programming language. Whiley employs extended static checking to eliminate errors at compile time, including divide-by-zero, array out-of-bounds and null dereference errors. Extended static checking is made possible through the use of an automated theorem prover. Whiley compiles to the Java Virtual Machine and is fully inter-operable with existing Java applications.

Little is a statically typed, C-like scripting language.

Features

  • Familiar C-like Syntax

  • Structs, lists, arrays, hashes

  • Perl regexp: buf =~ /.*foo/, I/O: while (buf = <>)

  • No memory management (reference counted)

  • Compiles to Tcl byte codes, Little can call Tcl, Tcl can call Little

  • Full access to Tcl runtime and libraries

  • Full access to Tk graphical toolkits

Mint has all the tools you need to write error free, easily readable and maintainable applications in record time.

ThinScript is an experimental programming language that compiles to JavaScript, WebAssembly, and C. It’s meant to be a thin layer on top of WebAssembly that makes it easier to work with: no dependencies and fast compile times. The syntax is inspired by TypeScript and the compiler is open source and bootstrapped (it can compile itself).

This is still an experiment and isn’t intended for real use yet. The biggest issue is that the generated code currently doesn’t delete anything (garbage collection is planned but not yet implemented). Also the WebAssembly specification is still being developed and the current binary format will stop working when WebAssembly is officially released.

Read More

min is a functional, concatenative programming language with a minimalist syntax, a small but practical standard library, and an advanced REPL. All packed in a single file*.

Forth is, among other things, a programming language whose ideals are freedom and simplicity. Freedom requires knowledge and responsibility, and simplicity is yet more demanding. But “simple” can also mean rudimentary. Simple Forth attempts to teach the rudiments of Forth.

Welcome to Ripen, a stack-based scripting engine with highly readable syntax, that can be implemented with little code and effort in a language like C++ or D. It’s informed by RetroForth and PostScript, but diverges from either in important ways, not least due to its string-threaded nature. Surprisingly, Ripen only seems to be about 6 times slower than the host language on a quick test — much better than for other language families.

Ripen is based on the principles explained in this interpreter construction tutorial. The point is having a tiny engine, easily copy-pasted into any application, even hidden inside a bigger module. For this reason, the default vocabulary is kept small.

Read More

Newspeak is a new programming language in the tradition of Self and Smalltalk. Newspeak is highly dynamic and reflective - but designed to support modularity and security. It supports both object-oriented and functional programming.

Like Self, Newspeak is message-based; all names are dynamically bound. However, like Smalltalk, Newspeak uses classes rather than prototypes. As in Beta, classes may nest. Because class names are late bound, all classes are virtual, every class can act as a mixin, and class hierarchy inheritance falls out automatically. Top level classes are essentially self contained parametric namespaces, and serve to define component style modules, which naturally define sandboxes in an object-capability style. Newspeak was deliberately designed as a principled dynamically typed language. We plan to evolve the language to support pluggable types.

Read More
Programming Languages

Discuss interesting/experimental programming languages.

Created on Nov 12, 2020
By @root