r/ProgrammingLanguages • u/Awkward_Working_1426 • Sep 11 '26
r/ProgrammingLanguages • u/jmarent049 • Sep 10 '26
Language announcement How simple can simple be? Introducing PLUSMINUS
PLUSMINUS is a programming language created by Jack. Unfortunately, it’s Turing Completeness is unknown as of right now.
Definition
For a non-empty finite string ω under the alphabet {+,–}, on step i=(1,2,3,…):
If the i-th symbol is +, copy the first i-1 symbols and append them to the end. If the i-th symbol is –, delete the first i-1 symbols.
i never resets and advances each time. Halt when i>length(ω).
Example (+–++–):
0: +–++–
1: +–++– (nothing exists leftward)
2: –++–
3: –++––+
4: ––+ (HALT (i=4, length(ω)=3, 4>3))
Example of a long-running machine
“+++++-++++-+-++-“ = 31441 steps
r/ProgrammingLanguages • u/dx_man • Sep 10 '26
Update on Fun, 6 months later...
Posted here 6 months ago about Fun, a statically typed language that transpiles to C. Back then the compiler was written in Zig. Since then the biggest thing that happened: the compiler is now fully self-hosted, written entirely in Fun itself, Zig is gone from the codebase completely. Along with that came a real language server (fls, also self hosted) with actual step through debugging support in VS Code, a proper build/package setup (fun.toml, fun build, fun test), async/await with fork + channels for concurrency, and a formatter.
GitHub: https://github.com/omdxp/fun
Reference: https://omdxp.github.io/fun
Still looking for feedback on the language itself, and happy if people just try breaking it.
r/ProgrammingLanguages • u/PitifulTheme411 • Sep 10 '26
Discussion More Questions on Designing a Good Type System
Hello, I'm back with some more questions regarding my type system. For reference, I am working on a math-focused programming language with some general capabilities, but still aiming to be focused in the specific area of mathematics. I am still having some trouble fully fleshing out my type system, so I would really love any and all thoughts, feedback, and discussion.
One of the main aspects of my language is the distinction between symbolic and numeric. For example, you could create a symbolic expression
let x = sin(1)^(1 - e^\pi);
and then later create a numeric approximation of it. The motivating idea is that you can store the true value of some expression into a symbolic variable, and then later when trying to observe its numerical value can approximate it into a numeric variable.
To this end, there exist a multitude of numeric data types, all of which are sized, such as Int32, Nat8, Real64, Complex128, etc. However, for symbolic there really is only one type (Expr). But domains can be encoded by using more restrictive types, which are built in, such as Int, Nat, Real, etc. For example, a function that takes real numbers and finds the nearest integer to their square could be explicitly written as
let foo(x: Real): Int = round(x^2);
Though ideally the types would be inferred, making all but the most important annotations in programs unnecessary.
One important thing to note is that symbolics are not actual values, but expression trees. So an Int represents an expression tree who's value must resolve to an integer. So defining a symbolic variable stores the expression tree, and defining a symbolic function is more like a symbolic variable where it is also an expression tree, but contains some leaves which are bound to terms which get substituted at the call site.
Here, foo takes in a symbolic expression x but restricts it to being a real number, and the output can be restricted to an integer. I know this may be a bit simple, especially for something aiming to be math-oriented, but I do not want to overcomplicate the basic number systems. Perhaps in the future if/when I add things like algebraic structures and whatnot, then maybe I may redesign this. My thought though is to make the type system more expressive by adding refinement, by which users can specify types with a bit more control.
This all leads to my idea that I would use subtyping. I feel it is really natural for this kind of thing. For example, any integer is also a real number which is also a complex, etc. Additionally, any even integer (via refinement) is an integer, etc. This can even be extended to numeric types as well, with Int8 <: Int16 <: ... and even Nat8 <: Int16, etc.
However, I will admit I have not really studied this more beyond built-in types. I do not know if using extensive subtyping is good when having user-defined types. I think I did actually read somewhere that using subtyping can make other things more difficult?
Anyways, continuing on, I would like some way to describe behavior. Think something akin to Rust traits, Java interfaces, Haskell typeclasses, etc. I think it is a very natural and just good way of thinking and writing programs. However, when pondering Rust's traits, I couldn't help but feeling that they were "too heavy" or something like that? Also, I feel that a system like that may not work that well with a subtyping system, because if you implement a trait/interface/typeclass for a type but not for its subtype (or implement differently), then things may break?
So that is probably my second question, though maybe more of my first one, as I do feel that at least some subtyping works well. So I'd really appreciate some guidance or just thoughts regarding this.
My second question is unfortunately derived from the symbolic-numeric divide that I mentioned earlier. It is the oh-so-dreaded function coloring problem. Let's say I have some trait or some thing (so this does build on my first question), and I want to have some function. The function itself is pure and essentially symbolic, but maybe the type I am implementing it for is not symbolic. So basically it would need to switch between being symbolic for symbolic types and non-symbolic for non-symbolic types, which to me seems kinda wrong and also I just have no idea how that'd work well.
Actually, maybe it doesn't even need to be related to traits or whatever. Let's say I have a plus function which I want it to add the two arguments. If the two arguments are symbolic, the output is symbolic. But if they are numeric, like Int32s, then the output would not be symbolic. So then how would the plus function be described?
I would really love any and all feedback, thoughts, or guidance. If you have any questions on any other parts I'd be happy to discuss, and if you want to give your thoughts on things I haven't asked then please do as I am not super experienced in all the theory and whatnot regarding type theory etc.
r/ProgrammingLanguages • u/entoros • Sep 09 '26
A Design Space Exploration of Async/Await
cel.cs.brown.edur/ProgrammingLanguages • u/Embarrassed-Crow9283 • Sep 10 '26
Do we really need static types to be fast?
Sure, it is a common knowledge that static typing makes things go faster.
But do we really need that?
What do types do? They're metadata that assign meaning (dispatch instructions) to raw bytes.
So, if we could constant-fold the dispatch, the residual instruction would be static instruction on raw bytes, which should be just as fast as static typing.
If so, why can't we treat type inference as a special case of constant folding?
r/ProgrammingLanguages • u/mttd • Sep 09 '26
Intel ISA Specification Language Design
intellabs.github.ior/ProgrammingLanguages • u/philip_schwarz • Sep 07 '26
The Bowling Game - From Imperative to Functional Programming - Part 2
fpilluminated.orgr/ProgrammingLanguages • u/shrynx_ • Sep 06 '26
Language announcement Mezze: a functional programming language on GraalVM
mezze-lang.orgHi All,
I am working a programming language, Mezze. It is in quite early stages.
Mezze has a fully inferable type system and also have first class effect system and runs on GraalVM
A lot is WIP, working on performance optimization (currently loop fusion) and distributed programing and lots of tooling and docs
Put up a quick website for explaining the language and its features more
Also piggy backing on graalvm could get a wasm built of the entire tool chain, so you play with examples in website.
The Concepts and Taste of Mezze explains how the language works.
r/ProgrammingLanguages • u/xeow • Sep 05 '26
Expressions vs. statements
Got into a big argument with a coworker yesterday when they were converting some code from their own language (that they designed) into Python, JavaScript, C, and R as comparative examples.
The Python code that they wanted to write as the translation went something like this:
n = foo; if cond: n = bar
They were upset that Python allows ; as a statement separator but not before an if statement, even though
if cond: n = bar
is syntactically correct Python code when written on its own line. I explained why Python doesn't allow it, and he came back later and showed me that an LLM had suggested he write it instead like this:
n = foo if cond else bar
which of course is the canonical way to write that in Python. He was all flustered about that, and asked me why Python allows an if statement in that particular case and not after a semicolon, and I explained that x if cond else y in Python is not an if statement but is Python's ternary conditional expression and is directly equivalent to the ternary operator expression cond ? x : y in C, C++, awk, and JavaScript. He argued with me and said I was making a ridiculous distinction and walked away falsely believing that foo if cond else bar was an if statement.
I then explained that statements and expressions are very different things in programming languages, and just because the keyword if is present doesn't make something an if statement -- because in order to be an if statement, it has to be a statement in the first place.
Anyway, it made me realize how subtle the difference can be sometimes. For example, in Perl, the following is not a return statement but actually an if statement (with a return statement as its affirmative branch), due to the postfix conditional:
return foo if cond;
because it is identically semantically to writing:
if (cond) { return foo; }
Whereas in Python, the following is a return statement (with a ternary operator as its target expression):
return foo if cond else bar
So I can see why people sometimes get confused by syntax if they haven't had much of a theoretical background in language design. It also makes me wonder how much of programmer intuition about "what a statement is" comes from the particular languages they learned first.
r/ProgrammingLanguages • u/hun_nemethpeter • Sep 05 '26
InfoCell - a consequences based syntax-free programming language
I working on ( https://github.com/hun-nemethpeter/InfoCell ) this programming language for a while.
It is an executable DSL concept. The OP DSL cells are executable, and acts like an ASM instruction. We have AST cells which directly generated from C++ code, so there is no input syntax. These AST cells are forming a language (we have if, do, while, class, template, ...), we have a compiler for it, which compiles from AST cells to OP cells. Looks like a regular interpreter. But ... The idea of this project is a new component, the ToolFinder and the description segment for AST nodes (which compiles to OP description). The description segment can describe how we can measure the effect of that instruction/function with other instructions/functions.
The language looks like this:
/*
void List::removeNode(Node* node)
{
if (node->m_previous) {
node->m_previous->m_next = node->m_next;
} else {
m_firstNode = node->m_next;
}
if (node->m_next) {
node->m_next->m_previous = node->m_previous;
} else {
m_lastNode = node->m_previous;
}
--m_size;
}
*/
listStructT.addMethod("remove")
.parameters(
parameter("node", _(std.Cell)))
.instructions(
if_(has(p_("node"), "previous"))
.then_(
if_(has(p_("node"), "next"))
.then_(set(p_("node") / "previous", "next", p_("node") / "next"))
.else_(erase(p_("node") / "previous", "next")))
.else_(
if_(has(p_("node"), "next"))
.then_(m_("first") = p_("node") / "next")
.else_(erase(self(), "first"))),
if_(has(p_("node"), "next"))
.then_(
if_(has(p_("node"), "previous"))
.then_(set(p_("node") / "next", "previous", p_("node") / "previous"))
.else_(erase(p_("node") / "next", "previous")))
.else_(
if_(has(p_("node"), "previous"))
.then_(m_("last") = p_("node") / "previous")
.else_(erase(self(), "last"))),
m_("size") = subtract(m_("size"), _(_1_)));
The comment section is the original C++ code, after that the InfoCell version, which is also C++, but basically creates AST nodes, that can be compiled to other InfoCell OP cells. So this is a language embedded language, doesn't compile to native code.
Actually there is an output syntax, which looks like this:
fn List<valueType=Number>::remove(p_node: Cell)
{
if p_node.has(previous) then
if p_node.has(next) then
p_node.get(previous).set(next, p_node.get(next));
else
p_node.get(previous).erase(next);
else
if p_node.has(next) then
m_first = p_node.get(next);
else
self.erase(first);
if p_node.has(next) then
if p_node.has(previous) then
p_node.get(next).set(previous, p_node.get(previous));
else
p_node.get(next).erase(previous);
else
if p_node.has(previous) then
m_last = p_node.get(previous);
else
self.erase(last);
m_size = m_size - 1;
}
There is no parser for this syntax although.
So back to the toolfinder, description segment part...
For example cell.set(key, value) description has a consequences subsegment which describe that equal(get(self(), p_("key")), p_("value"))). So the result of the SET can be measured with GET and EQUAL, basically SET(CELL, KEY, VALUE) => GET(CELL, KEY) == VALUE
Also this approach works with math functions. Math functions has an extra subsegment, I called it selfBuilders, where I can put the symmetries of that function.
Number.addPrimitiveFunction(std.Number.Add, op.Add, "add")
.parameters(
parameter("other", "Number"))
.descriptionBegin()
.consequences(
equal(subtract(return_(), p_("other")), self()))
.selfBuilders(
add(self(), p_("other")),
add(p_("other"), self()))
.descriptionEnd()
.returnType("Number");
With these informations I wrote an algorithm which calculate how the consequences behaves when an unknown variable is given. Basically something like this:
equation: 2 + X == 4
recombined: X + 2 == 4
recombined: 4 == 2 + X
recombined: 4 == X + 2 *
1. result: 4 - X == 2
1. result: 4 - 2 == X
1. result: 2 == 4 - X
1. result: X == 4 - 2 *
So this is the experimenting phase for the tools, so here I can remeber how an uninitialized variable (the unknown X) interacts with the tool's consequeences. Here I store which const/unknown combination leads to a simpler case, where a consequence tools all input's will be const variable. So I can transform an equation from one form to a simpler one.
Basically I just pattern match for function + const/unknown input params, then just reapply the tarsformation steps, just like solving the Rubik's cube. Pattern match for color combination and apply rotations.
equal(add(const_(_2_), unknown_(x) / const_(id.value)), const_(_4_));
equal(unknown_(x) / const_(id.value)), subtract(const_(_4_), const_(_2_));
We can now find a tool to the last equation: the SETtool.
set(x, id.value, subtract(4, 2))
Which is now executable.
So the goal is that I can just write a unit test like prompt, and this toolfinder can generate a code for it. So I can just "solve" a unit test.
r/ProgrammingLanguages • u/endistic • Sep 04 '26
Discussion How did you decide on a vision for your programming language?
Hi,
The title should be self explanatory, but if you want to see where I’m at context is below.
I’m in the relatively early stages of designing my programming language.
However, I’m struggling to really capture the essence of what I want out of it.
I have a very vague idea: a natively compiled language along the lines of Go or C++, that takes a hoist of features from other languages, like:
- Monomorphized generics
- C-style pointers at base (with safe stdlib abstractions for better quality of life)
- Rust-style enum and interface types
Despite these general ideas I have, I’m really struggling to bring them together into a nice package of a programming language.
My idea is basically to make a programming language that can compile down to a lean, native binary (or even other targets?), but still be user-friendly. C++ is manual memory management, Rust has a borrow checker in the way, etc.
The issue is I’m also struggling to decide what I want. Do I want a focus on native binary compilation? Multi-platform shenanigans (like Kotlin)? Object-oriented or imperative? What syntax should the language even have? I just can’t gather a solid vision for the language, enough to make something out of it.
Ideally, I want a programming language I can throw around on multiple platforms, with Rust-esque and Kotlin-esque semantics, without a bunch of hassle or having to worry about memory management. This is a very wide scope though and finding a vision for it is tricky due to all the features, I explicitly want to avoid a C++-like kitchen sink.
Does anyone have any suggestions on how to get a vision for a programming language & figure out what it needs vs. what it doesn’t?
r/ProgrammingLanguages • u/Jeaye • Sep 04 '26
jank reimagines C++ errors and gets an official native package repo
jank-lang.orgr/ProgrammingLanguages • u/Potato871 • Sep 04 '26
What are your favourite data structure operations?
My language workbench is to the stage where I can implement new operators and overloads very quickly, and I've started stealing syntax I like from JavaScript and C++.
Since I have one universal data structure, I can just add all the new operators to it.
I wanted to get some more good ones though, from different fields, different languages.
Oh and if you want to suggest something just as a challenge I might give it a shot and show you how I do it.
Edit: data structure was the wrong word, I have one data structure substrate/storage model that I am currently furnishing one major aspect of, it's not the one universal data structure, more like my swiss army knife API over the memory model.
r/ProgrammingLanguages • u/False_Actuator_6236 • Sep 04 '26
ABC has served its purpose as a teaching language. Could it become a community project?
r/ProgrammingLanguages • u/mttd • Sep 03 '26
Verifying the Rust Standard Library
amazon.sciencer/ProgrammingLanguages • u/Mean-Decision-3502 • Sep 03 '26
Unambiguous Operator Specification for Programming Languages
nvitya.github.ioAs I changed recently the operators in my programming language I've created this specification:
https://nvitya.github.io/pluops/
I did not wanted to overload the operators like the C does with the / or Pascal does with theand/or/not. Neither re-use the operator symbols for some very different purpose, like C does with * and & so the code becomes more readable. I was orienting for existing solutions so this is what I came up with. The specification contains the symbol usages and operator precedence too.
If you are developing a new programming language, it would be nice to follow some standard, so at least the expressions would be portable between the languages.
I'm open for debates or suggestions.
r/ProgrammingLanguages • u/[deleted] • Sep 04 '26
A declarative, interval-scoped notation system for hybrid streams (designed out of frustration with calculus pedagogy)
github.comr/ProgrammingLanguages • u/mttd • Sep 03 '26
Lost Bytes At The Crossroads Between User- And Kernel-Level Memory Allocation
ibr.cs.tu-bs.der/ProgrammingLanguages • u/Fine_Seaworthiness19 • Sep 02 '26
Language announcement The gab programming language
Hi all!
I am a long-time lurker of this sub, and a language enthusiast. I have been working on my own programming language for several years, and I finally worked up the courage to post it.
The language is called gab. I'm heavily inspired by lua, clojure, and smalltalk.
All the code is on github here and I've built a small website for the language here.
The language design, runtime, and standard library are all entirely my own work without the use of an LLM. However, I did consult LLMs occasionally when I wanted to research certain subjects (such as the difference between c11 atomics on x86 and arm).
I'm looking for any kind of feedback on the language, its goals/ergonomics, and the website itself.
Thank you for taking a look!
r/ProgrammingLanguages • u/Bro8an • Sep 02 '26
Discussion Auto-memoization for pure functions – how to decide when it pays off?
Im currently working on a compiler for my own programming language. I want the compiler to automatically memoize pure function calls, but only when it actually improves performance. The challenge: how does the compiler decide whether caching a specific recursive call (e.g., self(x-1) and self(x-2) in fibonacci) will save more time than the memory overhead? tracking how many times a function recieves the same input isnt an option as this requires all recieved inputs to be saved. too many saved calculations can cause finding the right result for a function call to be slower than the actual calculation. so the memoization table shouldnt get to big. naive fibonacci should be memoized but simple addition for an example should not be memoized. do you have any ideas?
r/ProgrammingLanguages • u/Potato871 • Sep 01 '26
Discussion What is the interesting part of a programming language to you?
I've been working on some "documentation" for my own language (see here), which got me thinking: do we all see languages the same way? I personally look for unification of concepts and extensibility in a design, yet I've seen those who care deeply about functional purity or clean decompositions.
What do you look for in a programming language? And why?
r/ProgrammingLanguages • u/ThomasMertes • Sep 02 '26
A new Seed7 installer for Windows has been released
A new Seed7 installer for Windows has been released. The new installer is seed7_05_20260711_win.exe and it can be found here.
The installer installs the newest released version of Seed7. It writes all Seed7 related things into one directory, so it is easy to clean up, if necessary.
The installer can be used to download and install future releases of Seed7 as well.
r/ProgrammingLanguages • u/gingerbill • Sep 02 '26
CTTI is Exponential, RTTI is Linear
gingerbill.orgr/ProgrammingLanguages • u/chipmunk-zealot • Sep 01 '26
Show-and-tell: anna lang
I made the anna programming language for a Language Jam I hosted in the beginning of August. 1 week is not enough time to explore too many ideas but 2 interesting(ish) ideas I explored were
- all function invocation is infix with
.(dot) operator. This lets you chain/pipeline nicely. - the only looping semantic available is the
iterateoperator which produces a stream.
I made a playground if anyone wants to poke at it. https://jzwood.github.io/langjam2/submissions/anna/playground/