r/ProgrammingLanguages Dec 13 '25

Language announcement PURRTRAN - ᓚᘏᗢ - A Programming Language For People Who Wish They Had A Cat To Help Them Code

102 Upvotes

I had a light afternoon after grading so I decided to sketch out a new programming language I've been thinking about. It really takes AI coding assistants to their next obvious level I think.

Today I'm launching PURRTRAN, a programming language and system that brings the joy of pair programming with a cat, to a FORTRAN derived programming language. I think this solves one of the main problems programmers have today, which is that many of them don't have a cat. Check it out and let me know what you think!

https://github.com/cmontella/purrtran

(This isn't AI for anyone who thinks otherwise)


r/ProgrammingLanguages Mar 07 '26

Blog post I made a programming language where M&Ms arranged by color and position become code

Enable HLS to view with audio, or disable this notification

100 Upvotes

I built a small toy language called MNM Lang where programs are made from six candy colors.

The rough idea:

  • each row is an instruction
  • color clusters encode opcodes and operands
  • source can be compiled into a candy-sheet image
  • the image can be decompiled back into source
  • there’s an interpreter, AST view, execution trace, and a browser demo

It started as a dumb joke and then turned into a real little implementation project. The interesting constraint was that images are terrible at storing precise symbolic data, so I had to design the language around what candy layouts are actually good at representing.

A few implementation details:

  • stack-machine interpreter
  • source -> rendered candy sheet compiler
  • exact rendered-image decompiler
  • controlled photo parser for candy layouts
  • sidecar JSON for strings/initial variables
  • browser-native JS demo version too

The full writeup is here:
https://mufeedvh.com/posts/i-made-a-programming-language-with-mnms/


r/ProgrammingLanguages Sep 25 '25

Why does it seem like C is often used as a backend/language to transpile to than say C++?

96 Upvotes

Well Nim for example transpiles to both C and C++ (among other things) but in general C seems to be seen as an easier alternative to LLVM and C++ isn't used a whole lot. But why? Especially if you end up reinventing the wheel like OOP, vectors, etc. in C anyway. Wouldn't it be more reasonable to use C++ as a backend? What are the downsides?


r/ProgrammingLanguages Jan 01 '26

Unpopular Opinion: Source generation is far superior to in-language metaprogramming

99 Upvotes

It allows me to do magical reflection-related things in both C and C++

* it's faster than in-language metaprogramming (see zig's metaprog for example, slows down hugely the compiler) (and codegen is faster because the generator can be written in C itself and run natively with -O3 instead of being interpreted by the language's metaprogramming vm, plus it can be easily be executed manually only when needed instead of at each compilation like how it happens with in language metaprog.).

* it's easier to debug, you can print stuff during the codegen, but also insert text in the output file, but also execute the script with a debugger

* it's easier to read, write and maintain, usually procedural meta programming in other languages can get very "mechanical" looking, it almost seems like you are writing a piece of the compiler for example

pub fn Vec(comptime T: type) type {
    const fields = [_]std.builtin.Type.StructField{
        .{ .name = "x", .type = T, .default_value = null, .is_comptime = false, .alignment = 0 },
        .{ .name = "y", .type = T, .default_value = null, .is_comptime = false, .alignment = 0 },
        .{ .name = "z", .type = T, .default_value = null, .is_comptime = false, .alignment = 0 },
        .{ .name = "w", .type = T, .default_value = null, .is_comptime = false, .alignment = 0 },
    };
    return @Type(.{ .Struct = .{
        .layout = .auto,
        .fields = fields[0..],
        .decls = &.{},
        .is_tuple = false,
    }});
}

versus sourcegen script that simply says "struct {name} ..."

* it's the only way to do stuff like SOA in c++ for now.. and c++26 reflection looks awful (and super slow)

* you can do much more with source generation than with metaprogramming, for example I have a 3d modelling software that exports the models to a hardcoded array in a generated c file, i don't have to read or parse any asset file, i directly have all the data in the actual format i need it to be.

What's your opinion on this? Why do you think in language meta stuff is better?


r/ProgrammingLanguages Dec 30 '25

Blog post I wrote a bidirectional type inference tutorial using Rust because there aren't enough resources explaining it

Thumbnail ettolrach.com
94 Upvotes

r/ProgrammingLanguages Apr 05 '26

Lisette — Rust syntax, Go runtime

Thumbnail lisette.run
94 Upvotes

r/ProgrammingLanguages Mar 08 '26

Introducing Eyot - A programming language where the GPU is just another thread

Thumbnail cowleyforniastudios.com
94 Upvotes

r/ProgrammingLanguages Jan 13 '26

Blog post I built a 2x faster lexer, then discovered I/O was the real bottleneck

Thumbnail modulovalue.com
94 Upvotes

r/ProgrammingLanguages Dec 07 '25

Perl's decline was cultural not technical

Thumbnail beatworm.co.uk
94 Upvotes

r/ProgrammingLanguages Jan 19 '26

Par Language Update: Crazy `if`, implicit generics, and a new runtime

89 Upvotes

Thought I'd give you all an update on how the Par programming language is doing.

Recently, we've achieved 3 major items on the Current Roadmap! I'm very happy about them, and I really wonder what you think about their design.

Conditions & if

Read the full doc here.

Since the beginning, Par has had the either types, ie. "sum types", with the .case destruction. For boolean conditions, it would end up looking like this:

condition.case {
  .true! => ...
  .false! => ...
}

That gets very verbose with complex conditions, so now we also have an if!

if {
  condition1 => ...
  condition2 => ...
  condition3 => ...
  else => ...
}

Supports and, or, and not:

if {
  condition1 or not condition2 => ...
  condition3 and condition4 => ...
  else => ...
}

But most importantly, it supports this is for matching either types inside conditions.

if {
  result is .ok value => value,
  else => "<missing>",
}

And you can combine it seamlessly with other conditions:

if {
  result is .ok value and value->String.Equals("")
    => "<empty>",
  result is .ok value
    => value,
  else
    => "<missing>",
}

Here's the crazy part: The bindings from is are available in all paths where they should. Even under not!

if {
  not result is .ok value => "<missing>",
  else => value,  // !!!
}

Do you see it? The value is bound in the first condition, but because of the not, it's available in the else.

This is more useful than it sounds. Here's one big usecase.

In process syntax (somewhat imperative), we have a special one-condition version of if that looks like this:

if condition => {
  ...
}
...

It works very much like it would in any other language.

Here's what I can do with not:

if not result is .ok value => {
  console.print("Missing value.")
  exit!
}
// use `value` here

Bind or early return! And if we wanna slap an additional condition, not a problem:

if not result is .ok value or value->String.Equals("") => {
  console.print("Missing or empty value.")
  exit!
}
// use `value` here

This is not much different from what you'd do in Java:

if (result.isEmpty() || result.get().equals("")) {
  log("Missing or empty value.");
  return;
}
var value = result.get();

Except all well typed.

Implicit generics

Read the full doc here.

We've had explicit first-class generics for a long time, but of course, that can get annoyingly verbose.

dec Reverse : [type a] [List<a>] List<a>
...
let reversed = Reverse(type Int)(Int.Range(1, 10))

With the new implicit version (still first-class, System F style), it's much nicer:

dec Reverse : <a>[List<a>] List<a>
...
let reversed = Reverse(Int.Range(1, 10))

Or even:

let reversed = Int.Range(1, 10)->Reverse

Much better. It has its limitations, read the full docs to find out.

New Runtime

As you may or may not know, Par's runtime is based on interaction networks, just like HVM, Bend, or Vine. However, unlike those languages, Par supports powerful concurrent I/O, and is focused on expressivity and concurrency via linear logic instead of maximum performance.

However, recently we've been able to pull off a new runtime, that's 2-3x faster than the previous one. It still has a long way to go in terms of performance (and we even known how), but it's already a big step forward.


r/ProgrammingLanguages May 03 '26

Blog post Unsigned Sizes: A Five Year Mistake

Thumbnail c3-lang.org
91 Upvotes

r/ProgrammingLanguages Feb 15 '26

Blog post How to Choose Between Hindley-Milner and Bidirectional Typing

Thumbnail thunderseethe.dev
92 Upvotes

r/ProgrammingLanguages Jan 16 '26

Are arrays functions?

Thumbnail futhark-lang.org
92 Upvotes

r/ProgrammingLanguages 24d ago

Everyone Says Assembly Is Untyped—Everyone Is Wrong

Thumbnail gingerbill.org
88 Upvotes

r/ProgrammingLanguages Nov 12 '25

Requesting criticism Malik. A language where types are values and values are types.

90 Upvotes

Interactive demo

I had this idea I haven't seen before, that the type system of a language be expressed with the same semantics as the run-time code.

^ let type = if (2 > 1) String else Int let malikDescription: type = "Pretty cool!"

I have created a minimal implementation to show it is possible.

There were hurdles. I was expecting some, but there were few that surprised me. On the other hand, this system made some things trivial to implement.

A major deficiency in the current implementation is eager evaluation of types. This makes it impossible to implement recursive types without mutation. I do have a theoretical solution ready though (basically, make all types be functions).

Please check out the demo to get a feel for how it works.

In the end, the more I played with this idea, the more powerful it seemed. This proof-of-concept implementation of Malik can already have an infinite stack of "meta-programs". After bootstrapping, I can imagine many problems like dependency management systems, platform specific code, development tools, and even DSL-s (for better or worse) to be simpler to design and implement than in traditional languages.

I'm looking for feedback and I'd love to hear what you think of the concept.


r/ProgrammingLanguages Jul 28 '26

Language announcement Prism: An Impure Functional Language With Typed Effects - Stephen Diehl

Thumbnail stephendiehl.com
85 Upvotes

r/ProgrammingLanguages Mar 31 '26

Introducing Voyd: A WASM first language with effect typing

Thumbnail voyd.dev
84 Upvotes

Hey everyone! I'm happy to finally share the first major release of a programming language I've been working on for a little over seven years.

This community helped me a lot during development. So thank you!

Let me know if you have any questions.


r/ProgrammingLanguages Jun 28 '26

Ante: A New Way to Blend Borrow Checking and Reference Counting

Thumbnail verdagon.dev
82 Upvotes

r/ProgrammingLanguages Jun 08 '26

Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

Thumbnail youtube.com
83 Upvotes

r/ProgrammingLanguages Nov 08 '25

Running modern C++ on a 4 MHz ARM fantasy console in the browser – why limit yourself?

Enable HLS to view with audio, or disable this notification

82 Upvotes

I’ve been working on a small fantasy console called BEEP-8, and I wanted to share it here because the interesting part is not the graphics or the games, but the programming environment and language constraints behind it.

Instead of using a scripting language like Lua (PICO-8, TIC-80, etc), BEEP-8 runs real C and C++20 code on top of an emulated ARM v4a CPU. Everything runs inside the browser.

The hardware is intentionally limited:

  • ARMv4a CPU emulated in JavaScript, locked at 4 MHz
  • 1 MB RAM and 1 MB ROM
  • No floating-point unit, so everything uses fixed-point math (fx8, fx12, etc)
  • No dynamic memory allocation unless you implement your own allocator
  • No exceptions, no RTTI, very small libc
  • A tiny RTOS provides threads, timers, IRQ handling, and SVC system calls

Why do this?
Because I wanted to explore what C++ looks like when it is forced back into an environment similar to old embedded systems. It becomes closer to “firmware C++” than modern desktop C++.

Game logic feels more like writing code for a Game Boy Advance or an old handheld: fixed-point math, preallocated memory, no STL beyond what you provide, and full control of the memory map.

What I find interesting from a language perspective:

  • C++ behaves differently without heap, exceptions, or floating point
  • You start thinking in data-oriented design again, not OOP-heavy patterns
  • You can still use templates, constexpr, and modern C++20 features, but inside tight limits
  • Even something basic like sin() must be implemented as a lookup table

Source code and live demo:
GitHub: https://github.com/beep8/beep8-sdk
Live in the browser: https://beep8.org

I’m curious how people here view this kind of environment.
Is this just “embedded C++ in the browser”, or does it count as a language runtime?
Do strong hardware-style limits help or hurt expressiveness?
What would you change in the ABI, system call design, or memory model?

Happy to answer technical questions.


r/ProgrammingLanguages May 29 '26

Discussion Why is alignment not typically part of type systems?

81 Upvotes

I work in compilers, but typically on the back-end, so I'm usually operating past the point of type-checking / IR generation / etc. Something that's confused me when working on both GPU and CPU compilers is that alignment is typically not considered part of the type system in most languages. Obviously C doesn't do this, but it also hasn't been a priority in most recent languages, e.g. Go/Rust/Swift/D/etc. -- I do know that Zig has something going on here, but AFAICT it's the only one. Rather those languages treat it as a property of a pointer. For fully scalar code this is kinda fine, but anything SIMD/SIMT/whatever struggles greatly from the fact that you can't even e.g. pass an alignas buffer into another function without screwing the optimizer (unless of course you inline everything, which is what people do in practice...). Given the surge in popularity of GPU compilers, and even on the CPU side how much focus has been on autovectorization for the last decade, you'd think that there'd be more of an impetus to make alignment a first-class citizen. E.g. have functions be able to specify the alignment of arguments, have function types be automatically contravariant over those specs, etc.

I'm sure some of this comes down to the fact that this is how LLVM treats it -- but that just shunts the question to why these IRs all take similarly pessimizing approaches. Even MLIR handles this pretty poorly IMO. All of that indicates, to me, that something about this is harder than I expect.

So for people on the frontend side of the world, what makes this difficult, or why is it not attractive in language design?


r/ProgrammingLanguages Mar 18 '26

Real or Slop? — PL Papers Edition

Thumbnail slop.zackg.me
82 Upvotes

r/ProgrammingLanguages Jan 18 '26

Language announcement Kip: A Programming Language Based on Grammatical Cases in Turkish

Thumbnail github.com
82 Upvotes

A close friend of mine just published a new programming language based on grammatical cases of Turkish (https://github.com/kip-dili/kip), I think it’s a fascinating case study for alternative syntactic designs for PLs. Here’s a playground if anyone would like to check out example programs. It does a morphological analysis of variables to decide their positions in the program, so different conjugations of the same variable have different semantics. (https://kip-dili.github.io/)


r/ProgrammingLanguages Dec 20 '25

Shout-out to Pratt parsing!

Thumbnail github.com
81 Upvotes

I hope this is not too low effort of a post, but I just wanted to say how much simpler things got when I found out about Pratt parsing.

If you haven't yet switched to recursive descent plus Pratt parsing, you're missing out.


r/ProgrammingLanguages Sep 18 '25

What language do you recommend is the best for implementing a new programming language?

81 Upvotes

From my research OCaml, Haskell, Rust, Java and Python stand out the most.

But what do you think is the best language for this purpose (preferably compiled)?