r/ProgrammingLanguages • • 24d ago

Language announcement Major Updates to Cole Compile-Time Execution and Type Reflection

0 Upvotes

Hello everybody, it's me again. I've had some free time in my hands so I worked on Cole a bit. It is in such a state now that you can implement a fully compile-time checked, type-safe, formatted printer using nothing but Cole.

I will not go hard on your screens post the implementation here, but I will leave a link to my blogpost at the bottom of this post.

Long story short, I added:

- Proper inlined for loops,
- Proper compile-time switches, and conditionals, for conditional compilation,
- Compile-time statement execution (almost complete, only field assignments and dereferenced assignments are left),
- A couple bugfixes with the typechecker and undefined value construction at compile-time.

Here is a small snippet of how the format printer is used, from the debug module:

import std::debug as debug;

let main = fn (args: [][]u8) -> i32 {
    debug::print("Hello! My name is % and I'm % years old!", ([]u8, u32))(("Yusuf", 20));
    return 0;
};

// Prints:
//    Hello! My name is Yusuf and I'm 20 years old!

But everything is not perfect as expected. Turns out, the compile time execution I do is incredibly slow, so the compile times go significantly high when doing any kind of compile-time execution. This is quite important considering the fact that Cole's mindset is "if it can be comptime, it is comptime". But I will start doing optimizations as soon as the base structure is complete.

If you've read this far, please drop a feedback, I'd really appreciate it.

And here is the blog entry I promised: https://blog.yusufenderosmanoglu.tech/blog/format-printer/
You can find the codeberg repo in the Cole website.


r/ProgrammingLanguages • • 25d ago

What does “verified memory safe” mean?

Thumbnail focs-lab.comp.nus.edu.sg
37 Upvotes

r/ProgrammingLanguages • • 26d ago

Blog post An LC-3 Disassembler in Haskell

Thumbnail abhinavsarkar.net
6 Upvotes

r/ProgrammingLanguages • • 27d ago

Speeding up GPU copies by permuting iteration spaces, or, optimising the identity function

Thumbnail futhark-lang.org
18 Upvotes

r/ProgrammingLanguages • • 27d ago

Programming Language for Laser Cutting and CNC

18 Upvotes

Hey all!

I run a site with design generators for laser and CNC cutting, and along the way we ended up building our own programming language, KerfScript, to describe those designs.

It has OpenSCAD-like syntax, but it's strictly 2D, with laser-specific features built in: cut/score/engrave layers, kerf compensation, assembly instructions (actual physical assembly, not programming!), and finger joints that adapt to material thickness.

You write a part once, change a few parameters, and export SVG or DXF. What I find fun is that the end result is a 3D object, even though the language itself has no concept of 3D. All the dimensionality comes from math, slots, joints, and how flat pieces fit together. So you're essentially programming a 3D object without ever describing anything in 3D.

Just a fun little project I thought was worth sharing!


r/ProgrammingLanguages • • 27d ago

Bootstrapping Ada competitors: Red, Yellow, Blue

Thumbnail tym83.github.io
6 Upvotes

r/ProgrammingLanguages • • 27d ago

Updates on Cole, and Version 0.1.4 Announcement

9 Upvotes

Hi everyone, my original post in r/Compilers had Github and Codeberg repo links inside it, so they were not suitable to post here. So I'm dropping the modified version as a separate post here.

From the original:
Hello everyone, since my last two posts here, I got into a small flow-state with the codebase and improved Cole quite a bit. I took the advices of the wonderful people in the comments as well, and it helped me a lot to be honest.

Since the last posts, I added:

- 212 tests in total, testing various aspects of the compiler through simple programs,
- Proper generic type generation with full generic definition support through comptime called functions,
- Proper generic function generation through comptime called functions,
- Type deduplication, and codegen improvements,
- And many more bugfixes on different aspects of the compiler.

In the current state, the backend is embedded TCC, so codegen emits almost-human-readable C code. But I will replace the backend in the future with LLVM, QBE or handwritten x86_86 generator. However for now, since the rest of the compiler is not solid enough, the C backend eases the development quite a bit.

Beside all of this, I made a small website (which doesn't work quite well because I self-host it on an old laptop, it is for giggles of it so don't take it seriously) that has versioned language reference, a small welcome page with a hello world snippet, and installation instructions.

Overall, Cole has become something far beyond what I imagined it would become in a good way. I am self taught, so I am pretty content with what I have accomplished. But criticism is always welcome.

The link to the Cole website is here.

Also, occasionally, I write blogposts about what I'm currently working on, so I'll leave it here as well.

Many thanks to everyone that commented to any of my previous posts, have a good day/night!


r/ProgrammingLanguages • • 28d ago

Heavenly delights of hashing numbers under EQUALP

Thumbnail turtleware.eu
10 Upvotes

r/ProgrammingLanguages • • 27d ago

Language announcement I'm making a programming language, searching for contributors

0 Upvotes

Hi! Me and another person are working on a programming language called KrabbaScript! It's garbage-collected (optional), statically typed and trying to be as simple and intuitive as golang but more human-friendly. This is KrabbaScript's syntax:

Variables are defined as:

var krabba = "Krabba!";

Variables may also have a type or be uninitialized, like:

var with_type: F32 = 5.0;
var uninitialized: Str;

KrabbaScript also has values, which are immutable, example:

val constant = 5;
val with_type: I32 = 5;

KrabbaScript also has control-flow (duh), example of a repeat statement:

repeat {
  Std.print("KrabbaScript is the best language OAT!");
} until popular;

KrabbaScript also has a when statement, which is more of a switch one:

when language {
  == "Elixir" do celebrate();
  == "Haskell" do complain();
  == "KrabbaScript" do {
    contribute();
    applaude();
  }
  else do Std.print("I don't know anything about " + language);
}

KrabbaScript also provides an ASI (Automatic Semicolon Inserter) if you're tired and sick of semicolons, you can use it with the format command.

If you want a little bit more examples, check out the repo! We are also working on tools for KrabbaScript like package manager, style checker, etc.

We are searching for contributors and maybe you, the person reading this post, can help us create KrabbaScript or improve it!


r/ProgrammingLanguages • • 28d ago

Discussion Does the Name I Give My Programming Language Matter That Much?

34 Upvotes

Does the name we give a programming language matter? I work on my own programming language and study compilers as a hobby. During that time, I’ve faced various mental health challenges that made it much harder to keep up with my hobby. Sometimes, depression kept me from making any progress at all.

Because of this, I’ve been considering a name for my language that reflects this period of my life and has personal meaning to me. Does a programming language’s name need to have anything to do with programming itself?

I’d love to hear about your languages and the names you chose for them. Do those names have any personal significance to you?


r/ProgrammingLanguages • • 28d ago

Naming a language

8 Upvotes

I'm working on a language focused on systems programming; it needs a name and I can't come up with anything. I want to publish it but first it needs a name. Help!

Edit: It's a modern language that aims to be usable anywhere C is available and beyond.

I'm aiming for an entirely self-hosted verified compiler with an easy bootstrapping path from C99 (the verified part is obviously dependent on the language fully implementing the capabilities to verify code).

Small binaries, competitive optimization, first-class support for DSOs, no garbage collection, rich type system (dependent types, contracts, capabilities), modular design (language extensions can be packaged outside the compiler), interoperable with any mainstream compiled language (if you can spell the ABI, it doesn't need to be part of the compiler distribution).


r/ProgrammingLanguages • • 28d ago

Language announcement text-based visual programming language

8 Upvotes

I'm working on a visual programming language that's stored as text called Wiret. Here's an example:

func Main() {
  node entry = Entry -> say_hello
  node say_arrows = Call host.Log(message: "The white arrows decide the order.")
  node say_hello = Call host.Log(message: "Hello!") -> say_steps
  node say_steps = Call host.Log(message: "Programs run one step at a time.") -> say_arrows
  notes {
    note intro "Lesson 1: Hello. Press ▶ Run (F5). Each Log node prints one line in the console below, in the order the white arrows connect them."
    note start on entry "Every function starts at its Entry node."
    note try_it "Try it: (1) Press ⤵ Step (F11) to run one node at a time. (2) Add a fourth line: press Tab, type 'print', pick host.Log, then drag a white arrow from say_arrows to it. (3) Double-click its message pin to type your own text."
  }
  layout {
    entry at (0, 0)
    say_arrows at (820, 0)
    say_hello at (220, 0)
    say_steps at (520, 0)
  }
}

The main idea is that it's like a fusion between a programming language and a markup language. The node ... statements are the programming part, and the notes {} and layout {} blocks declare how the graph appears in the editor. It'll get compiled into bytecode which strips away the markup code and leave just the code for running the program.

; module lessons.hello  compiler wiretc-proto 0.1
; semantic hash 78fafcb4bbf40f47  layout hash 9981662aa454a0e1
import 0 host.Log (string) -> ()

func lessons.hello.Main () -> ()
  max_stack: 1
.entry:
  nop
.say_hello:
  string.const 0          ; 'Hello!'
  nop
  call host.Log
.say_steps:
  string.const 1          ; 'Programs run one step at a time.'
  nop
  call host.Log
.say_arrows:
  string.const 2          ; 'The white arrows decide the order.'
  nop
  call host.Log
  cont.pop
  return

I think this could be useful for education. The hardest part about learning to code is learning your first programming language. This could help bridge the gap between visual representation of code and the code itself.


r/ProgrammingLanguages • • 29d ago

InferType, and toolkits for building compilers

Thumbnail drops.dagstuhl.de
14 Upvotes

(not the author, just sharing because I found it)

Recently I came across the paper by Senxi Li et al, InferType: A Compiler Toolkit for Implementing Efficient Constraint-Based Type Inference. Check it out!

I've always found interesting the concept of making modular, extensible compilers. And by "modular", I don't just mean separate compilation à la OCaml, Haskell (they're cool btw), or parser generators à la lex, yacc (also cool btw).. I mean embedded domain specific languages and libraries à la parser combinators, MetaOCaml for concrete code generation.. components that can generalize a part in the compilation pipeline and can be imported as a reusable library. We have seen libraries to handle the lexing and parsing part. But for further semantics-related analysis parts.. not so many? So far I've found InferType, are there others like this?

Also related are language workbenches, like JetBrains MPS, and the Truffle framework and their dialects of Python and JavaScript. But so far they have only been used for making interpreters for DSLs, what about full-fledge compilers for general-purpose programming languages?


r/ProgrammingLanguages • • 29d ago

How programming languages approach graphics

29 Upvotes

Many general-purpose languages delegate graphics to third-party libraries (like SDL, Raylib, or OpenGL). Seed7 integrates portable 2-D graphics right into its standard library. This IMHO improves portability. I also thought about introducing operators / statements to do graphics, but until now I don't use operators or statements to do graphics.


r/ProgrammingLanguages • • Oct 28 '26

English vs Interlingua grammar inspiration

3 Upvotes
struct point { x:int, y:int }                             struct puncto { x:int, y:int }
                                                  
def area ( p:point -- int ) { p.x * p.y }                 def area ( p:puncto -- int ) { p.x * p.y }
                                                  
def main () {                                             def principal () {
    p := point(3, 4);                                         p := puncto(3, 4);
    show(area(p));                                            monstrar(area(p));
}                                                         }

--------------------------------------------------------------------------------------------------------------------
                                                  
cap fs from capabilities                                  cap fs ex capacitates
                                                  
def fs.open ( c:cap from fs str -- str ) { ... }          def fs.aperir ( c:cap ex fs str -- str ) { ... }
                                                  
--------------------------------------------------------------------------------------------------------------------

mint fs;                                                  monetar fs;

def main () {                                             def principal () {
    c := narrow cfg ( "settings.ini", read ) from fs;         c := atenua cfg ( "settings.ini", leger ) ex fs;
    show(read_config(c));                                     monstrar(leger_config(c));
}                                                         }

r/ProgrammingLanguages • • Oct 27 '26

a small Python language compiler that transpiles to bash and batch (learning project, written in C)

13 Upvotes

I'm building with a friend a language with Python syntax that transpiles to plain bash and batch.

The idea: if you already know Python, there's nothing new to learn. You write the script once, and the generated .sh /.bat runs on a machine with nothing installed, no Python and no PowerShell. Only the machine where you write the script needs.

Why not the existing options?

- Python isn't installed by default on Windows or some Unix-like systems. - Batsh and Amber target similar problems, but they come with their own syntax to learn (and Batsh looks unmaintained).

- PowerShell is another language to learn, and it's an extra install on Linux/macOS.

- Keeping separate .sh and .bat versions of the same script is tedious and error-prone.

Status: it's early. The lexer is done and the parser is in progress (it only handles name = value so far). The bash and batch backends haven't been started. It's a subset of Python, not a full implementation, since some features have no natural equivalent in batch.

Questions for you:

  1. For automation scripts, which features should come first: conditionals, loops, running commands, file operations?

]2. Is batch still worth targeting, or should the Windows backend be PowerShell?

on the design is very welcome, especially from anyone who has written a transpiler before.


r/ProgrammingLanguages • • Oct 27 '26

Resolving relationships between elements

6 Upvotes

For my programming programming language Bits Runner Code I am thinking of implementing automatic resolving in what order structs, interfaces, etc should be defined and declared so they can interact with each other. It should be possible to embed structs within each other, but at the same time there cannot be a circular reference. How something like this could be implemented or maybe it is not the best idea?

BRC doesn't have header files, so right now source files and definitions within them have to be listed in a specific order. I would like it to be quite explicit but also hassle free.


r/ProgrammingLanguages • • Oct 26 '26

Discussion Microsoft announces Type Server Protocol, an extension of the Language Server Protocol

Thumbnail devblogs.microsoft.com
118 Upvotes

TSP is an open standard that extends LSP – the Language Server Protocol that underpins editor integrations across the industry – designed to allow any editor or tool to integrate type checkers as first-class backends.

The initial use case is to enable changing the type checker powering Pylance (Microsoft's VS Code extension for Python) from their own Pyright to Meta's Pyrefly.

I think it's somewhat niche, but could be useful in a few situations:

  • Enable switching between different compiler versions during full rewrites
  • When a language has multiple competing implementations and no single official type checker/compiler (as is the case with Python)

r/ProgrammingLanguages • • Oct 26 '26

Discussion what are your “wish I had” features in a modern language?

57 Upvotes

After developing software for over 40 yrs, I’m implementing a new language specification, compiler, and standard library. Let’s assume it will have memory safety and some other features that modern languages have. This post is not a language announcement; it’s too early to release, but is coming soon.

My question is - for all of you that are designing or implementing your own, or for those who wish they could - what are the two or three features that you wish your daily-use language(s) had that they don’t today?

- better documentation?
- a better package manager?
- better threading support?
- better debugging tools?
- better memory management?
- better leak detection?
- better integration with dev tools?

I’m genuinely curious and would love to hear your top wish list items.


r/ProgrammingLanguages • • Oct 24 '26

Blog post Static memory planner: MLIR pass for optimizing allocation patterns by reusing memory between allocations whose lifetimes don't overlap

23 Upvotes

https://blog.llvm.org/posts/2026-08-24-gsoc-2026-static-memory-planner/

What do you guys think about this MLIR feature?

TD;LR: It can optimize heap allocations by analyzing the lifetimes and certain requirements (with certain limitations) and if it can find co-existing allocations that don't need to co-exist (non-overlapping lifetimes) then it can assign them to the same memory region, which can be combined into an arena allocation that is freed at once

Is this too implicit for low-level tasks? or is it a good idea to be heading into these sorts of transformations that improve performance?


r/ProgrammingLanguages • • Oct 23 '26

How close can pure FP get to C?

Thumbnail rtfeldman.com
18 Upvotes

I found the discussion really interesting and thought you all would too. Richard talks about a pure Roc implementation of libdeflate and how to do performance optimizations unique to Roc. From a programming languages perspective this is really interesting because its quite unique results I think. There arent many FP languages that can achieve C like performance with ergonomics like Roc. To do this the compiler is able to make various optimizations like mutate in place or elide checks when it can prove it is safe to do so.


r/ProgrammingLanguages • • Oct 23 '26

Help How do you make a programming language memory safe without paying a lot in overhead?

30 Upvotes

I am designing a language. I want memory safety without using a tracing garbage collector or having heavy runtime costs. I have been looking at the options and I would like to know how others have dealt with these tradeoffs.

The options I have looked at:

- Ownership and borrow checking (Rust-style): Zero runtime cost but the compiler must prove things and the learning curve and syntax friction are real. I am not a fan of Rusts syntax so I wonder if the same guarantees can be provided with a surface.

- Reference counting (Swift/Nim-style): Predictable and simple but you pay for increments and decrements on every copy and cycles need either weak references or a cycle collector.

- Tracing GC: Easy for the user. Pause times and memory overhead are the usual complaints. It is a fit if the language is meant for games or system work.

- Regions/arenas with escape analysis: Allocate in scopes and let the compiler prove that nothing escapes. Very cheap,. I am not sure how far escape analysis can go before it becomes too restrictive.

- Bounds checks and tagged or hardware‑assisted checks (like ARM MTE): Catch many errors at low cost but they are mitigations, not guarantees.

My current thinking is a mix arenas by default an ownership model for long‑lived values and bounds checks that can be elided when the compiler can prove them safe. I would like to know whether that is a direction or whether I am missing a well‑known approach.

Specific questions:

has anyone implemented escape analysis that stays useful without forcing annotations?

Is there a middle ground between full borrow checking and reference counting that does not reintroduce cycle problems?

for those who have shipped a memory‑safe language with overhead what would you do differently?

Links, to papers, languages or post‑mortems are very welcome :)


r/ProgrammingLanguages • • Oct 23 '26

r3forth REPL

Thumbnail youtu.be
16 Upvotes

early REPL version for r3forth, sure I change some things


r/ProgrammingLanguages • • Oct 22 '26

How would you guys define an Anonymous Function or a function pointer?

12 Upvotes

Me and a few of my friends have been working on a programming language that we initially started for a compiler design class for some time and recently started working on support for anonymous functions, lambdas and function pointers to make callbacks easier to write.
Currently Captures on variables outside the function scope are detected and captures without complete context moving.

I'm a bit skeptical or the syntax that we're currently deciding on (its not that clear on first view) , so i'm looking for reviews and maybe some ideas.
I'll just include some examples we have right now.

let double = |i32 value| value * 2;
i32(i32) triple = |value| value * 3; // i dont like this rn, not that clear on 
                                     // first look that this is a lambda

let absolute = |i32 value| {
if (value < 0) { return -value; }
    return value;
};

let classify = |i32 value| match value {
   0: "zero",
   _: "nonzero",
};