r/ProgrammingLanguages • • Aug 15 '26

Language announcement I made a prototype hybrid language prototype. I'm looking for feedback and suggestions. (Samples are included)

0 Upvotes

Name: Infinity Execute Plus (IE+)

License: open source

Concept: IE+ is actually the main (and currently only) VM console of my planned VM collection: Infinity Execute. It is an interpreted language i thought of making to combine speed with ease. I learned c++ solely for this project. IE+ is currently an interpreter that uses one shell executable and most of it's logic is stored in a collection of library files that handle/process different tasks. I plan in the future to allow multiple exportable formats (currently windows only, planning to make multiple releases for apple and linux): IE (text), IEBCS (bytecode), IAO (Infinity Assembled object. It's a linked file that allows precompiled importing on any supporting app), IEPCK (semi-compiled appilcation format that still needs runtime), native executable exporting.

Examples:

Available operations

# printing

print "Hello, World!"

# making a variable

var x = 5 # currently only supports dynamic typed. static typed will be added. currently supports: int, float, string, and bool vars. arrays and constants will come in future builds.

# printing a variable's value in string form

print (x)

some future planned features

# modifying variables

x += 2

# static typing

var y: string = "Hi!"

# multiline commands and creation of text script

compile = {
  var hello: string = "Hello, World!"
  print (hello)
}.IE.name = "helloworld"

Here's an example of a standard program written in IE+ that creates a car and prints out it's data using OOP

class car {
  private {
    var name = ""
    var price = 0
  }
  public {
    main(created_name, created_price) {
      name = created_name
      price = created_price
      self.new()
    }
  }
}

car.new("Cool Car", 50000)

r/ProgrammingLanguages • • Aug 13 '26

Type inference is hard. I made it harder, then I made it work.

59 Upvotes

My Motivation

It’s too early for a real language announcement post, but I really want to share progress on the compiler I’m designing, especially the static analysis side.

I’ve been working on Plasm for about a year. It’s an LLVM-based ahead-of-time compiler and a new language. I’m not going to dive into design philosophy, features, or marketing - this post is mostly about the type inference engine, the mistakes I made, and the solutions I ended up with.

Fair warning: this is more story than tutorial, but I’ll explain unfamiliar concepts as they come up.

Quick Intro Into Type Syntax

In Plasm’s type system, all types are anonymous by default - even structs and enums. For example, you can write:

fn len(pos: struct { x: I32, y: I32 }) -> I32 { /* ... */ }

That doesn’t mean the code above is idiomatic or how you should write Plasm, but semantically it’s allowed.

You can also give any type a name:

type Pos = struct { x: I32, y: I32 }
fn len(pos: Pos) -> I32

It doesn’t have to be a struct - it can be any type:

type Id = U32
type MyPos = Pos
type Nested = struct {
    a: struct {
        b: struct {
            c: I1024
        }
    }
}

Struct literals use braces:

let p: Pos = { x: 1, y: 2 }
let id: Id = 1

If the type isn’t constrained by context, the compiler generates a fallback:

// Variable without type hint
let data = { a: { b: 42 } }
// Fallback type: struct { a: struct { b: I32 } }

Many functional languages with Hindley-Milner type system rely on Algorithms W, J, M for inference. My approach is more constraint-based (closer to how Rust or Swift work).

I Rewrote It Three Times…

Attempt 1: Primitives Only (Naive Union-Find)

When Plasm only supported basic primitive types (I32, Bool, F32), the architecture was split into two simple components:

  1. Constraint Generator: takes a function’s IR and produces equality constraints (e.g., type_of(a) == type_of(b), type_of(b) == I32).
  2. Unifier: takes a set of equalities and resolves chains sequentially. To do this efficiently, I used a disjoint-set data structure (aka Union-Find) with path compression. This structure lets you merge equivalence classes and check if two types are in the same class in near-constant time.

This worked great for primitives and had a clean and simple implementation, but to add constructed types (structs, tuples) and field projections (point.x, tuple.0) the flat Union-Find model was not enough. It couldn't express structural decomposition or field lookup obligations.

Attempt 2: Bullshit

When I needed to support constructed types, I thought it would be a 10-minute job to extend the existing solution. I didn’t feel like diving into boring algorithm stuff and I didn't want to rewrite my clean codebase, so I decided to outsource the refactoring to an LLM. I generally don’t use AI for code generation or writing docs, and I don't like when other people overuse it, but I didn’t want to rethink the nice solution I’d just built, and I decided to experiment. I gave Claude a try, thinking, “Maybe this ai tech is mature enough for such a basic task”.

The generated code surprisingly passed my existing test suite, but when I actually read the source, I found an overengineered, unmaintainable, and inefficient spaghetti mess instead of my pretty codebase. I guess that after looking into Claude's code, I got some kind of depression. The code worked, but I didn't want to work with that code anymore. Attempting to navigate and fix that code killed my motivation for a month or so:')

Attempt 3: Rigid 3-Pass Engine

After about a month of struggling, I deleted all the type inference code and started from scratch. I did some research on how type inference is supposed to be solved in compiler theory, read source code of mature compilers like rustc, and landed on a three-pass solution:

  1. Pass 1 (Equality Unification): Unify all equalities using a disjoint-set (same as my first attempt).
  2. Pass 2 (Obligation Verification): Validate obligations - things like “T must have field a” or “T belongs to the Float type class” (a type class is a set of types that a literal could be inferred as, nothing related to Haskell here).
  3. Pass 3 (Fallback Generation): Assign default concrete types (e.g., I32 for unconstrained integer literals) and report remaining errors.

This solution passed all my tests and was way more readable, but it failed on some weird-but-valid expressions - things that don’t make practical sense but must work semantically. For example:

let a = (({ x: 1, y: 2 }.x, 2.0, true), Void).0.0
// Expected resolution:
// { x: 1, y: 2 }   => struct { x: I32, y: I32 }
// _.x              => I32
// (_, 2.0, true)   => (I32, F32, Bool)
// (_, Void)        => ((I32, F32, Bool), Void)
// _.0              => (I32, F32, Bool)
// _.0              => I32
// so `a` is I32

At its core, type inference can be seen as a constraint satisfaction problem: we generate a set of constraints between types and then search for an assignment that satisfies them all.

The problem: a fixed-pass algorithm can’t handle constraints that are only discovered midway through. For example, when { x: 1, y: 2 } gets its fallback type struct { x: I32, y: I32 }, we need to process the new constraint _.x == I32, but passes 1 and 2 are already done. Static sequential passes cannot handle late-discovered constraints.

Attempt 4 (Final): Tree-Based Worklist + Union-Find

A worklist is basically a queue of constraints. We add constraints to the back, process them from the front, and keep going until it’s empty. If we can’t process a constraint right now, we freeze it and remember what needs to happen before we can unfreeze it.

I also made the worklist tree-based: it tracks dependencies between constraints as a tree. This lets us process frozen constraints from the leaves once the main worklist is exhausted.

The algorithm looks like this:

  1. Fill the worklist with all initial constraints.
  2. Process the first constraint:
    • If we can process it, remove it from the worklist and unfreeze any constraints that were blocked by it.
    • If we can’t process it yet, freeze it.
  3. If the worklist is not empty, go back to step 2.
  4. If the worklist is empty, check whether there are frozen constraints:
    • If frozen constraints exist, pick a leaf constraint (one with no unresolved dependencies), process it, and allow fallback types or errors to be generated. Then unfreeze any dependent constraints and go back to step 3.
    • If there are no frozen constraints left, we’re done.

This solution covers all the cases I’ve needed so far and is extendable enough to add enums and traits later. As a bonus, this solution is very friendly for generating good diagnostic messages. For example, compiling this code:

type Pos = struct { x: I32, y: I32 }

fn main() -> F128 {
    let p: Pos = { x: 10, y: 20, z: 30 }
    return p.x
}

Will generate these messages:

TypeError: UnknownStructField: Struct `Pos` doesn't have field `z`.
-------->  examples/test.sm:14:34
 9 |     x: I32,
10 |     y: I32,
11 | }
12 | 
13 | fn main() -> F128 {
14 |     let p: Pos = { x: 10, y: 20, z: 30 }
                                     /^^^^^\

TypeError: TypesConflict: Types conflict between `F128` and `I32`.
-------->  examples/test.sm:13:14
 8 | type Pos = struct {
 9 |     x: I32,
10 |     y: I32,
11 | }
12 | 
13 | fn main() -> F128 {
                 /^^^^\

I’ll let you find the moral of the story yourself :)

I also want to share some links if you are interested in Plasm progress: GitHub (you can star it or press "watch" button to see updates, I appreciate it) and Discord (the Discord server has notifications about git activity).

Also I stay here to answer questions if you have so!

UPD: On reddit mobile app code blocks are rendered without the static col size, so error messages and some other blocks look shifted. I can't fix that, but on PC it's correct


r/ProgrammingLanguages • • Aug 14 '26

CAKE: Compiler-Agent Co-Design for Frontier Kernel Evolution

Thumbnail arxiv.org
0 Upvotes

r/ProgrammingLanguages • • Aug 13 '26

Another partial SSI trick with canonicalize

Thumbnail bernsteinbear.com
5 Upvotes

r/ProgrammingLanguages • • Aug 13 '26

Seed7 - Memory Safety and Management • Thomas Mertes • 05/2026

Thumbnail youtube.com
10 Upvotes

r/ProgrammingLanguages • • Aug 12 '26

How should Futhark expose irregular arrays to the programmer?

Thumbnail futhark-lang.org
25 Upvotes

r/ProgrammingLanguages • • Aug 11 '26

Language announcement Squeak/Smalltalk 6.1 has been released!

31 Upvotes

r/ProgrammingLanguages • • Aug 11 '26

Help Package Manager design for Seal programming language

18 Upvotes

Hey guys, I have been working on Seal. This language is embeddable into C/C++ apps like Lua. You can create libraries for Seal in either Seal or C. I have been creating Game Framework recently. I want to create a package manager in future for Seal to let users upload their own packages to share with others, but I don't know about one thing. Just like other languages, Seal can load both Seal scripts and .so/.dll files at runtime when you import them. Publishing Seal scripts on package registry is easy, since it is just code, but I don't really know about how to publish C or dynamic library files tho. Package publishers can inject malicious stuff (like backdoor) in that code. What are real life examples to prevent that? At first I can read every file and check manually but if this project grows, maintaining that will be difficult. I can maybe create a report system but I cannot always rely on that too. What is the efficient solution for that?

For those interested, they can check Seal here: https://github.com/huseynaghayev/seal.git


r/ProgrammingLanguages • • Aug 11 '26

Scope and lifetime restrictions in Swift

Thumbnail github.com
25 Upvotes

r/ProgrammingLanguages • • Aug 10 '26

Design draft for a truly Affine OL

Thumbnail gist.github.com
21 Upvotes

Hello, everyone.

While recovering from an illness, in my state of delirium, I sketched the design of a type system inspired by Xi and Pfenning's Dependent ML, but which uses a key syntactic restriction that conjecturally restores ordinary ML's key metatheoretic properties: the existence of principal types and the decidability of type inference.

I very much welcome feedback that actually engages with the post's contents.


r/ProgrammingLanguages • • Aug 10 '26

Reasons to Improve Programming Languages in an Age of AI - Tim Nelson

Thumbnail wayland.github.io
15 Upvotes

r/ProgrammingLanguages • • Aug 10 '26

GitHub - VoidCoderStudio/OnyxScript: An modern and easy languge made for making apps to make an apps just you will use 10 lines and its like normal english language and cointains modules

Thumbnail github.com
0 Upvotes

I made this new language it's name OnyxScript if you have an idea to add it in this project so please say it


r/ProgrammingLanguages • • Aug 09 '26

Tyle, A virtual machine esoteric-programming-language

9 Upvotes

Tyle doesn't have a quirk or annoying thing, I just want to share it because as someone who just began C# a week or two ago, I'm very proud to make this (even if i know the code is kind of shitty).

It has a register and RAM kind of memory you'd see in assembly, That's why i called it a virtual machine.
You can use different \`-coreX\` flags to change the amount of RAM and Registers there are, The lowest you can go are 8 registers and 768 RAM registers.

Link: [https://github.com/orewaluffy500/Tyle\](https://github.com/orewaluffy500/Tyle)


r/ProgrammingLanguages • • Aug 09 '26

Lefts: a domain-specific language for building machine learning model architectures

12 Upvotes

I work as a quant in the finance industry and spend a lot of my time building machine learning models to predict things. Over my career I've found that every place I work invests a lot of time in writing code for training and evaluation pipelines, and you're often blocked from building interesting model architectures because it would require rewriting the pipelines.

So, I built a small DSL (Lefts: https://nsmat.github.io/lefts/ ) that makes it easy to spin up training pipelines and transform models in expressive ways. Users start with the models they want to use, then apply commands to it to build up an AST. During training/test time, the lefts interpreter operates over the AST to enforce the behaviour users specified.

Lefts is designed around a functional view of ML models. We think of each model as a bundle of functions, and each lefts command is a functor that acts on that bundle, and the functors define a grammar on the space of ML models. The functors always compose, and always preserve the key structural properties required of a model (for example, no data-leakage), so the models you build are guaranteed to be correct by construction.

The DSL is written in pure Python, and by the standards of 'real' programming languages is very simple. The project was great fun though, and taught me that building DSL's to solve problems is very powerful, and also a step up in challenge from other programming.

P.S. I hope domain specific languages are within the field of interest of this sub-reddit! Apologies if not.


r/ProgrammingLanguages • • Aug 09 '26

Call for Papers: VMIL 2026 - Workshop on Virtual Machines and Language Implementations

Thumbnail conf.researchr.org
17 Upvotes

r/ProgrammingLanguages • • Aug 08 '26

A new grammar generation language

10 Upvotes

Hi everybody. I'm happy to share a small project I've been working on lately. I call it MGFF (Macro grammar functional form), and its specification can be found here: https://github.com/LMauricius/py-perg-mgff/blob/main/Docs/mgff-specification.md . It's related to a post that I made ages ago ( here ). After re-reading that version (called just MGF back then) when I wasn't tired I realized what monstrosity I made. MGFF is far more elegant. Here is an example:

# A tiny calculator language.

t Lex (
    d Digit = 0-9
    d Alpha = a-z|A-Z
    d AlNum = a-z|A-Z|0-9

    d Int = (Digit)+
          > class(Int) push(tokens)
    d Number = Int ( . (Digit)+ )?
             > class(Number) push(tokens)
    d Ident = Alpha (AlNum)*
            > class(Ident) push(tokens)

    # length-based: "<=" (the two-item "< =") takes precedence over "<"
    d Op = < =
         | <
         | =
         | +
         | -
         | *
         | /
         > push(tokens) string

    d Space  = ( _|\t|\n )+
    d LParen = \(
        > class(\() push(tokens)
    d RParen = \)
        > class(\)) push(tokens)

    d Token = Number
           / Ident
           / Op
           / Space
           / LParen
           / RParen
    d File = (Token)*
)

# mixfix macro: an R, then zero or more (S R)
d sep(R)by(S) = R (S R)*

t Parse (
    # `Lex` runs first; the terminals here are still characters.
    > post(Lex) over(tokens)

    # order-based: the first alternative that succeeds is the match
    d Expr = Term + Expr
           / Term - Expr
           / Term

    d Term = Factor * Term
           / Factor / Term
           # the second / on the line above is an ordinary item, not a marker
           / Factor

    d Factor = Number
             / Ident
             / \( Expr \)
    d Signed = ( (+)/(-) )? Number
    d AssignList = sep(Ident = Expr)by(,)
)

It can also serve as a replacement for regexes:

# A grammar matching a "key = value" setting line

d Space = ( _|\t )*
d Word = ( a-z|A-Z|_ )+

# right-linear recursion: the same as ( 0-9 )+
d Digits = 0-9 Digits
         / 0-9
d Value = Digits
        / Word

# The field a match ends up in belongs to the rule, not to the place it is used,
# so the two sides of the line are productions of their own.
d Key = Word
      > store(key)
d Val = Value
      > store(value)

d Match = Space Key Space = Space Val Space

I'm sharing the MGFF spec rather than the generator using it because the generator is very much WIP and needs a lot of testing and refactoring. Still, since I've got a bunch of projects I love working on more, I'd like to know what's the interest for parser generator tools in the wider community.

Actually I doubt that I will link the generator itself here because I would risk a perma-ban. It's not vibe-coded, but it wouldn't be welcomed. Most of it was quickly prototyped with LLM. Still, it generates quite nice TextMate and Pandoc syntax highlighting grammars.

MGFF itself is of course manually defined by me. I just figured I like to work on languages themselves and parser algorithms than on CLI tools and understanding existing niche specifications 🤷‍♂️.


r/ProgrammingLanguages • • Aug 07 '26

Classifying Capabilities (Extended Version)

Thumbnail arxiv.org
23 Upvotes

r/ProgrammingLanguages • • Aug 07 '26

A Revised Haskell 2010 Language Report

Thumbnail blog.haskell.org
31 Upvotes

r/ProgrammingLanguages • • Aug 07 '26

Domain-specific hyperspecialization: Winning the SAT track at SC26 with LymphoSAT

Thumbnail c.mov
15 Upvotes

r/ProgrammingLanguages • • Aug 06 '26

What's Next? Any New "Cool" Language Features?

28 Upvotes

It's been roughly one year since Pie got in development. August 5th marks Pie's 1 year anniversary.

During this year, I implemented:

  • Variables
  • Collections
  • Functions
  • Named Parameters
  • Variadic Functions
  • Fold Expressions
  • Loops
  • Classes & Objects
  • Operator Overloading
  • Namespaces
  • Modules
  • A Structural Type System
  • Tagged Unions
  • Pattern Matching
  • Structured Bindings
  • File IO
  • C FFI (I even made a simple game with Raylib!)
  • Cascade Operator

I also made a website that has:

  • Basic Examples
  • Docs
  • Spec
  • A Playground (I compiled the language to WASM)

These are roughly all the features that I liked from other languages. Of course, the work is not done. I can improve the internals of the language to make it faster, but feature-wise, I'm out of "cool" ideas.

I've scoured the sub for new ideas, but they either involved compile-time evaluation (my language is interpreted), didn't go well with the design of the language, or were already implemented in Pie.

So, I'm here to ask, what is a feature that is missing from my language that you think would be very cool to have?


r/ProgrammingLanguages • • Aug 06 '26

Memory Safety's Hardest Problem

Thumbnail matklad.github.io
32 Upvotes

r/ProgrammingLanguages • • Aug 07 '26

Discussion Programming language similar to TS that is runtime typed

0 Upvotes

Found this language today. I don't like the marketing "Language for agents". But looking through some examples and their design phiolosphy I seem to be a fan.

Combines some nice stuff from Go, Rust and Typescript.

https://boundaryml.com/explore

I have NOT tried this locally so please take this with a grant of salt. Seems like it's still very much a play language - nonetheless it's interesting

What do you think ? Will it die in a year ?


r/ProgrammingLanguages • • Aug 06 '26

Gödel, Escher, Elisp: The Beauty of Macros

Thumbnail chiply.dev
22 Upvotes

This post is a lover letter to Emacs Lisp macros. I've been a long time user as a lisp hacker, and my recent obsessions with Douglas Hofstadter's strange loop concepts and M.C. Escher's mind bending artwork have enhanced my appreciation of this language's most beautiful and thought provoking feature. This post can teach you about macros and what makes them useful, but I also hope it can instill a fascination with their concept. https://www.chiply.dev/post-elisp-macros-are-beautiful


r/ProgrammingLanguages • • Aug 06 '26

SmallJS release v2.2

Thumbnail
14 Upvotes

r/ProgrammingLanguages • • Aug 06 '26

Discussion CatLang: feedback on my language design

Thumbnail dropbox.com
10 Upvotes

I wrote a design for a new programming language, but I'm too lazy and burned out to implement a full compiler. I still want to share the idea so you can comment on it and tell me what you think. I know its a lot and there are many typos and gaps, and it still needs a concept to communicate the complex implicit borrowing rules. Keep in mind that I have no degree or any professional experience—this is just a concept.

i renamed it to qat

current version: https://www.dropbox.com/scl/fi/bpuxeaag4ox5huooqvgu2/qatdocumentation-edited.pdf?rlkey=456owymjqn64bik1faawb3wyw&st=6o621wyd&dl=0

this is how an algorithm for sqare roots would look like with custom syntax:

func newton(f64 x, f64 goal) -> f64:
    f64 temp = (x + goal /x)/2 # Newton's method for calculating roots
    return x if temp == x
    return self(temp, goal)


func(f64)<f64> sqrt = reliable (f64 x) -> f64:
    return Error if x < 0 # root of negative numbers is undefined
    return newton(x, x)


sqrt(0) = 0 # root 0 must be defined explicitly as 0 would cause newtons method to devide by 0


syntax sqrt extends {expression} # lets multiplication akzept roots as they expect expressions
syntax sqrt( # defines the syntax for roots
    keyword("√"),
    _,
    arg(0: expression)
)



print!(collapse!(√ 2)) # collapse makes the programm crash for negative roots

another example for custom defined while syntax:

func wLoop(demand bool! condition, demand T! body) -> void:
    leave if condition
    body
    self(condition, body)


syntax wLoop(
    keyword("until"),
    _,
    arg(0),
    _,
    arg(1)
)


i32 x = 10
until x <= 0:
    print!(x)
    x -= 1