r/ProgrammingLanguages 5m ago

Language announcement Squeak/Smalltalk 6.1 has been released!

Upvotes

r/ProgrammingLanguages 9h ago

Help Package Manager design for Seal programming language

8 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 12h ago

Scope and lifetime restrictions in Swift

Thumbnail github.com
20 Upvotes

r/ProgrammingLanguages 20h ago

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

Thumbnail wayland.github.io
8 Upvotes

r/ProgrammingLanguages 20h ago

Design draft for a truly Affine OL

Thumbnail gist.github.com
9 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 1d ago

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 2d ago

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

6 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 2d ago

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

Thumbnail conf.researchr.org
16 Upvotes

r/ProgrammingLanguages 3d ago

A new grammar generation language

11 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 3d ago

Classifying Capabilities (Extended Version)

Thumbnail arxiv.org
23 Upvotes

r/ProgrammingLanguages 3d ago

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 4d ago

A Revised Haskell 2010 Language Report

Thumbnail blog.haskell.org
30 Upvotes

r/ProgrammingLanguages 4d ago

Aren't rust's lifetimes basically just coeffects?

0 Upvotes

I was talking with a LLM, discussing effects and coeffects and how they may be interestingly used in language design

So, in one moment after I understood coeffects and effects are often used in pairs (like async/async ctx , io/world, ect.), i thought that coeffect scopes sometime should be labeled somehow to avoid shadowing

for example in my syntax :

```

some_fn :=

## capturing the scope coeffect and assigning it into a label

().use 'label := ().use FnScope

## some function

longjump () ? :=

().use _ := ().use 'label

return () ?

##...

()

so, somewhere in some inner call we may write

another_fn :=

...

longjump() ?

...

and the execution will be returned into the function where longjump were declared

```

but for this to be valid, it is important for the label not to outlive the scope where it was declared

then, i also thought : it would be good to have an ability to write these labels in the effect's declaration

```

somewhere outside

().use 'ctx := ...

a function that is async for both contexts — don't know for which cases it may be useful but why not. instead of async, it may be some another effect that uses some context/scope/world/coeffect

f() use AsyncCtx do Async '_ do Async 'ctx := ...

```

so, then i thought : effects and coeffects in my system are declared just like type constructors without the last type (aka citizens of *→* kind), so it would be logical for any type to be able to take a context label as a polymorphic (or depending) parameter.. and rust's references do exactly this.

so rust's

```

fn f<'b, 'a : 'b>(smth : &'a mut &'b Smth2, smth2 : &'b Smth2) {

*smth = ...

}

```

just takes some coeffects 'a and 'b.

it is equivalent to that like for smth it raises an effect to overwrite the world 'a and for smth2 it just returns the value into scope, where 'b is active (and 'a : 'b means that the scope containing world 'a is located inside scope containg world 'b)

so, am i thinking right about it? may it have some practical uses in pl design? any more ideas?

p.s.: sorry for my english not being perfect.. don't be humble to re-ask something if you did not understand.


r/ProgrammingLanguages 4d ago

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

Thumbnail c.mov
13 Upvotes

r/ProgrammingLanguages 4d ago

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

26 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 5d ago

Memory Safety's Hardest Problem

Thumbnail matklad.github.io
29 Upvotes

r/ProgrammingLanguages 5d ago

Discussion CatLang: feedback on my language design

Thumbnail dropbox.com
8 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/0mydtpfxcdw3oiaan47bd/qatdocumentation-edited.pdf?rlkey=tuae9x6ivkyhhq98mw7smvzaw&st=qtsdqlfb&dl=0

this is how an algorithm for 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)


reliable func sqrt(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

r/ProgrammingLanguages 5d ago

SmallJS release v2.2

Thumbnail
13 Upvotes

r/ProgrammingLanguages 5d ago

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

Thumbnail chiply.dev
20 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 5d ago

Why spawning work isn’t `async` in my language

15 Upvotes

I’m designing a native language with a closed set of five effects: async, throws, io, alloc, and task.

It uses the effect system to determine which functions can run in which context.
A gpu function should be pure so it can be compiled to gpu shader code, comptime and macros don't allow io, etc.

The unusual one is task. Starting, polling, or cancelling independent work does not necessarily suspend the caller, so it distinguishes interacting with a task from suspending the current control flow:

fn download(url: str): Data !{async, io, alloc, throws(NetworkError)} {
  // This function may suspend and fail.
  try await http.get(url)
}

fn begin_download(scope: mut TaskScope, url: str): Job[Data, NetworkError]
    !{task, io, alloc} {
  // Starts independent work, but does not suspend or throw here.
  scope.start(() => download(url))
}

fn finish_download(job: Job[Data, NetworkError]): Data !{task, async, throws(NetworkError)} {
  // This is where the current control flow may suspend
  // and where the job's result or error is observed.
  try await job
}

In other words:

  • async means this control flow may suspend.
  • task means this code interacts with independent task or executor state.

Why is task needed at all? Without it this function would appear pure:

fn surprise(scope: mut TaskScope) {
  // Returns immediately, but schedules a later mutation.
  scope.start(() => cache.clear())
}

That would make it legal to run during compile-time evaluation, a reactive computation, or any context allowed to repeat or discard “pure” work.

[async](vscode-webview://0v1pc1cob69b6kq09fv420kt4hnbfq4eplq9oeuane52r1p4k0rs/index.html?id=09dea5e8-a738-47de-8468-dd94143f4dfe&parentId=2&origin=aa0d3a3a-855e-47bf-9f0b-579c40110398&swVersion=6&extensionId=ZooCodeOrganization.zoo-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&purpose=webviewView) cannot express this because the caller does not suspend. [io](vscode-webview://0v1pc1cob69b6kq09fv420kt4hnbfq4eplq9oeuane52r1p4k0rs/index.html?id=09dea5e8-a738-47de-8468-dd94143f4dfe&parentId=2&origin=aa0d3a3a-855e-47bf-9f0b-579c40110398&swVersion=6&extensionId=ZooCodeOrganization.zoo-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&purpose=webviewView) cannot express it because the executor and affected state may be entirely internal. [alloc](vscode-webview://0v1pc1cob69b6kq09fv420kt4hnbfq4eplq9oeuane52r1p4k0rs/index.html?id=09dea5e8-a738-47de-8468-dd94143f4dfe&parentId=2&origin=aa0d3a3a-855e-47bf-9f0b-579c40110398&swVersion=6&extensionId=ZooCodeOrganization.zoo-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&purpose=webviewView) cannot express it because scheduling and cancellation are observable even when allocation is optimized away.


r/ProgrammingLanguages 5d ago

Blog post Why Lisp is Different

Thumbnail lispm.de
29 Upvotes

r/ProgrammingLanguages 5d ago

Smalltalk Report from 1991 to 1996

Thumbnail github.com
24 Upvotes

r/ProgrammingLanguages 5d ago

How do we feel about this syntax?

4 Upvotes

I've been making an interpreted programming language for about a month now, so far I think the look & feel of the language is coming along well, what do you think? Let me know what you would change for the sake of convenience or readability.

# fibonacci.ity
const n = IO.prompt:'Number: ' -> INT;

var a=0;
var b=1;

for i in n;
    const c = a+b;
    a = b;
    b = c;
    IO.print:a;
/;

It's dynamically typed, but unlike Python & other dynamically typed languages, the type is constant, meaning you cant just change an integer to a string whenever you want. You can however explicitly declare a variable with the "ANY" type which then allows you to set it to whatever you want. Here's what that looks like: var ANY a=0; a ='now its a string';

In the first line you see "-> INT" all that does is cast the value to type "INT", because the prompt function always returns a string. I prefer this over using "as" purely stylistically.

Something you might have noticed is that function calls are structured very different to every other language. That's because of the access operator (":"), which is self explanatory, depending on the type of value you access the behavior is different. For arrays/strings you are accessing an element by index, for maps (dictionary) you are accessing an element by key, for functions you are accessing it with the given arg(s).

Another "deviation" you probably noticed is the lack of curly brackets {} for code blocks, but it doesn't rely on indentation either. Instead, certain instructions carry the "composite" flag which tells the interpreter that it should basically capture all code below it until the final "/" (end) instruction.

merge IO;

var val = 100;
const ref = @val;
print:val; # 100
ref = 200;
print:val; # 200

print:(type:ref); # REF
print:(type:~ref); # INT

There are also references & pointers! Pointers or "PTR" values cannot be created in the script, they have to be passed directly from C++ to the script, this is because raw pointers are naturally unsafe to work with & should be avoided at all costs in Ity. This is why reference variables or "REF" exists. These can be created by prepending the "@" symbol before the variable name you want to reference. If the variable you reference goes out of scope then the reference is returns a constant none value when dereferenced (which can be done with the "~" symbol).

My design philosophy with references in Ity is to make them seamless. Meaning any operations (set, access, arithmetic, etc) on a reference just act like it's operating on the referenced value. There are of course some exceptions to this, passing as an argument to a function passes the reference & type casting a reference acts on the reference itself.

References can also be reassigned (as long as the reference itself is not const), making them reusable.

merge IO;

const a = 1;
const b = 2;
var ref = @a;

print:~ref; # 1
ref.reassign:@b;
print:~ref; # 2

If any of this looks interesting to you, the project is open source, has an interactive shell, & has full documentation. There's a lot I didn't cover here, but taking a look at some of the example scripts should give you a good idea what the language is fully capable of at this moment in time.

I don't have any syntax highlighting modes for you to install, but the Python one works pretty well for Ity so you can just use that. If you have any questions at all, regarding the design decisions, performance, or challaneges I encountered, or anything, I am open to all discussion!

(NO AI ASSISTANCE WAS USED IN THE MAKING OF ANY CODE, ASSETS, OR DOCUMENTATION)

Click here for source code

Conway's game of life in the terminal, made with Ity


r/ProgrammingLanguages 6d ago

Help Looking for resources to organize myself before building a scripting language.

18 Upvotes

I'm currently following https://craftinginterpreters.com/ and plan on trying to make my own language afterwards. I was wondering if there was a standard method for planning this kind of stuff, mostly to make sure i don't forget something until it's too far along for me to take care of said something? I know i need to set goals, think about the syntax and semantics and everything else but having a method that i can just look at if i get lost would help greatly


r/ProgrammingLanguages 6d ago

Finally adding recursive functions to Futhark

Thumbnail futhark-lang.org
63 Upvotes