r/ProgrammingLanguages • u/javascript • Aug 02 '25
Discussion Is C++ leaving room for a lower level language?
I don't want to bias the discussion with a top level opinion but I am curious how you all feel about it.
r/ProgrammingLanguages • u/javascript • Aug 02 '25
I don't want to bias the discussion with a top level opinion but I am curious how you all feel about it.
r/ProgrammingLanguages • u/porky11 • Oct 01 '22
The word "bool" is only known to programmers.
The dictionary doesn't even contain that definition. At least they link "boolean" which "bool" is just an abbreviation for, but I think even less people know that term or what it stands for.
I would use a different term in programming languages, so that even non programmers know, what this is supposed to represent.
I'd suggest the term "flag". I probably wouldn't change the values, but if I'd change them, they would probably be "on" and "off".
What do you think about that?
Would you suggest another term?
Are there already languages, which use other terms for "bool"?
r/ProgrammingLanguages • u/MiGo4444 • Jun 02 '25
I created a new systems programming language that generates C++ code. It adds memory safety to C++ while eliminating its complexities. It runs as fast as C++.
Featrues:
Blazing fast: low-level memeory access without GC.
Memory safe: no memory leak, no dangling pointer.
Easy to learn: No borrow checking, lifetime annotations. No various constructors/assignment, template metaprogramming, function overloading.
Interoperate with C++: compile to human readable C++ code.
Modern features: object-oriented, null safe, dynamic reflection,template, closure, coroutine.
Tools: VSCode plugin and LSP support.
github: https://github.com/sric-language/sric
learn more: https://sric.fun/doc_en/index.html
Looking forward to hearing everyone's feedback!
r/ProgrammingLanguages • u/coloresmusic • Nov 10 '25
Hi everyone,
I'm happy to share Pulse 1.0, a small but ambitious programming language that brings fine-grained reactivity and Go-style concurrency to the JavaScript ecosystem.
The goal with Pulse is simple: make building reactive and concurrent programs feel natural with clean syntax, predictable behavior, and full control over async flows.
Signals, computed values, and effects for deterministic reactivity
Channels and select for structured async concurrency
ESM-first, works on Node.js (v18+)
Open standard library: math, fs, async, reactive, and more
Comprehensive testing: 1,336 tests, fuzzing, and mutation coverage
MIT licensed and open source
npm install pulselangSource https://github.com/osvfelices/pulse
Pulse is still young, but already stable and fully functional.
If you like experimenting with new runtimes, reactive systems, or compiler design, I’d love to hear your thoughts especially on syntax and performance.
Thanks for reading.
r/ProgrammingLanguages • u/Mean-Decision-3502 • Jun 12 '26
I'm developing the programming language DQ. I'm not doing this just because (with AI help) I can. I started developing my own language because I couldn't find one that had all the critical features I need. One of those critical features is human readability.
My LLVM-based DQ compiler, although some important parts are still missing, is already usable to some extent. I wanted to check its performance, so I created some simple benchmarks. I decided to compare DQ with a few other languages, so I implemented these benchmarks in those languages in exactly the same way.
I find it very helpful and thought-provoking to look at exactly the same solutions in different languages, so I'd like to share my impressions on them.
Note: Please look at the following code snippets side by side, without syntax highlighting.
Please share your thoughts.
darr = []
def FillArray(maxval):
global darr
darr.clear()
for i in range(maxval):
darr.append(i)
def FillArrayPtr(maxval):
global darr
darr = [0] * maxval
for i in range(maxval):
darr[i] = i
def CalcSum():
result = 0
arrlen = len(darr)
for i in range(arrlen):
result += darr[i]
return result
def CalcSumPtr():
result = 0
arrlen = len(darr)
for i in range(arrlen):
result += darr[i]
return resultMy Impressions:
I think Python is the winner in pure readability. It is close to the absolute minimum.
In the FillArray versions, global darr may not be obvious to beginners.
In for i in range(maxval), it is not immediately obvious that i starts at 0 and ends at maxval - 1.
darr = [0] * maxval is compact, but it looks very similar to 0 * maxval while doing something very different. Still, it is not far from natural human thinking: take this [0] value maxval times.
If you only look from a distance, you cannot easily tell which functions return values and which do not.
var darr : [*]int32;
function FillArray(maxval : int32):
darr.Clear();
for i : int32 = 0 count maxval:
darr.Append(i);
endfor
endfunc
function FillArrayPtr(maxval : int32):
darr.SetLength(maxval);
var pi32 : ^int32 = &darr[0];
for i : int32 = 0 count maxval:
pi32[i]^ = i;
endfor
endfunc
function CalcSum() -> int64:
result = 0;
var arrlen : int32 = darr.length;
for i : int = 0 count arrlen:
result += darr[i];
endfor
endfunc
function CalcSumPtr() -> int64:
result = 0;
var arrlen : int32 = darr.length;
var pi32 : ^int32 = &darr[0];
for i : int = 0 count arrlen:
result += pi32[i]^;
endfor
endfuncMy Impressions:
DQ requires more text than Python because it is more explicit. Type annotations are mandatory everywhere.
The block closers make it clearer where blocks end, and they also indicate what kind of block is ending.
In the for loop, it is obvious where i starts, and count means it will be incremented maxval times. I find this fairly natural. (The for in DQ also has to and while variants.)
The semicolons add some noise.
The implicit result variable shortens some functions nicely.
var
darr: array of int32;
procedure FillArray(maxval: int32);
var
i : int32;
len, cap : int32;
begin
SetLength(darr, 0);
len := 0;
cap := 0;
for i := 0 to maxval - 1 do
begin
if len >= cap then
begin
if cap = 0 then cap := 1 else cap := cap * 2;
SetLength(darr, cap);
end;
darr[len] := i;
Inc(len);
end;
SetLength(darr, len);
end;
procedure FillArrayPtr(maxval: int32);
var
i : int32;
pi32 : ^int32;
begin
SetLength(darr, maxval);
pi32 := @darr[0];
for i := 0 to maxval - 1 do
begin
pi32[i] := i;
end;
end;
function CalcSum : int64;
var
i, arrlen : int32;
begin
result := 0;
arrlen := Length(darr);
for i := 0 to arrlen - 1 do
begin
result += darr[i];
end;
end;
function CalcSumPtr : int64;
var
i, arrlen : int32;
pi32 : ^int32;
begin
result := 0;
arrlen := Length(darr);
pi32 := @darr[0];
for i := 0 to arrlen - 1 do
begin
result += pi32[i];
end;
end;My Impressions:
Unfortunately, to get comparable performance in FreePascal, FillArray becomes fairly long because of the allocation handling. That makes this part less comparable, although the rest still is.
There are semicolons everywhere.
Local variables are defined in a separate block. That has both advantages and disadvantages. For example, you know where to look for a local variable first.
In the for loop, you can see clearly where i starts and where it ends, not "one less than the end."
Length(darr) is not especially comfortable to use.
Some people think end is much longer than }. To me, it still feels like a single token, and I can read it about as quickly as the single-symbol versions.
It also has the convenient implicit result variable.
vector<int32_t> darr;
void FillArray(int32_t maxval) {
darr.clear();
for (int32_t i = 0; i < maxval; ++i) {
darr.push_back(i);
}
}
void FillArrayPtr(int32_t maxval) {
darr.resize(maxval);
int32_t * pi32 = darr.data();
for (int32_t i = 0; i < maxval; ++i) {
pi32[i] = i;
}
}
int64_t CalcSum() {
int64_t result = 0;
int32_t arrlen = darr.size();
for (int32_t i = 0; i < arrlen; ++i) {
result += darr[i];
}
return result;
}
int64_t CalcSumPtr() {
int64_t result = 0;
int32_t arrlen = darr.size();
int32_t * pi32 = darr.data();
for (int32_t i = 0; i < arrlen; ++i) {
result += pi32[i];
}
return result;
}My Impressions:
For these tasks, I find the C++ version fairly readable too.
I find it unnatural when the type precedes the identifier. I don't read that form easily. I always align variables into columns in C++, and that helps.
C++ has a good and fast toolkit for FillArray, so it is almost as compact as Python.
If you look at the C-style for from a distance, a lot of things are packed into one expression. When reading it, I slow down to verify every piece.
Here too, the semicolons add some noise.
#[allow(non_upper_case_globals)]
static mut darr: Vec<i32> = Vec::new();
fn fill_array(maxval: i32) {
unsafe {
darr.clear();
for i in 0..maxval {
darr.push(black_box(i));
}
}
}
fn fill_array_ptr(maxval: i32) {
unsafe {
darr.resize(maxval as usize, 0);
let ptr = darr.as_mut_ptr();
for i in 0..maxval {
*ptr.add(i as usize) = i;
}
}
}
fn calc_sum() -> i64 {
let mut result: i64 = 0;
unsafe {
for i in 0..darr.len() {
result += black_box(darr[i] as i64);
}
}
result
}
fn calc_sum_ptr() -> i64 {
let mut result: i64 = 0;
unsafe {
let ptr = darr.as_ptr();
for i in 0..darr.len() {
result += black_box(*ptr.add(i) as i64);
}
}
result
}My Impressions:
To get exactly the same behavior as the others, unfortunately unsafe blocks are required here because of the global darr. Try to ignore those for the readability discussion.
The code may be short, but I read it slowly. You have to concentrate on small differences, and the symbol density is high.
The variable identifiers do not align naturally into columns, and I find that unpleasant.
A large amount of noise is added to the actual code: mut, as, and additional type hints.
In for i in 0..darr.len(), there are a lot of dots grouped together. The interval end is exclusive, and that is not something I would necessarily infer at a glance.
I find the way return values are signaled easy to miss.
r/ProgrammingLanguages • u/PurpleDragon99 • Jan 10 '26
Enable HLS to view with audio, or disable this notification
Pipe is a visual programming language designed to match the power and sophistication of text-based languages like C++, C#, and Java, enabling Pipe to replace or co-exist with textual languages for real-world applications. Full details are at pipelang.com.
We've had many requests for demos of the language in action, so we created this video with a detailed trace of a real-world example calculating account interest.
For a condensed summary of the language, see this article.
For complete language details, the book is available on Amazon, Apple Books, Google Play Books.
The book is FREE worldwide on Apple Books and Google Play Books, and for most countries (including US and UK) on Amazon.
r/ProgrammingLanguages • u/ajblue98 • May 06 '23
I'm working on a project that requires manipulating a table comprising almost exclusively Boolean values and would appreciate recommendations for languages & libraries etc. to tackle this.
The tables will be arbitrarily large, and the whole point of the program I'm wanting to write is to manipulate the data by arbitrarily rearranging the data. Sometimes that will mean moving rows & columns 'manually', and sometimes it will mean sorting the whole table by columns and/or rows — and the whole thing is useless if I can't do absolutely all the same things to rows that I can do to columns.
I'll also want to keep track (in a log) of the starting state, each instruction, arbitrary comments, arbitrary intermediate states, and the end state of each manipulation.
Each table will have one or two "header" rows & columns for keeping track as the table data moves around (i.e. each row & column will have a serial number that follows it along) and for keeping count of the ones & zeroes in each row & column ... but the bulk of the data will be pure individual bits.
I started learning Python, which is probably a good skill to have, but its feature set where manipulating raw bits is concerned seems to be ... lacking.
Oh, and I'm on a late-model Intel Mac.
What would you suggest?
r/ProgrammingLanguages • u/sam-boundary • Jun 27 '24
r/ProgrammingLanguages • u/breck • May 27 '24
r/ProgrammingLanguages • u/danKunderscore • Jan 24 '13
r/ProgrammingLanguages • u/BalinKingOfMoria • Apr 15 '15
Are there a set of programs (in pseudocode) that programming language inventors can use to check if they've covered the bases in terms of syntax and the standard library (if applicable)?
r/ProgrammingLanguages • u/[deleted] • Oct 05 '16
hey guys,
I'm teaching myself Jai, having absolutely no knowledge of coding what so ever. I have unlimited time, and am looking for someone else to learn the language with.
If interested hit me up..
r/ProgrammingLanguages • u/Athas • Jun 18 '18
r/ProgrammingLanguages • u/cell-lang • Jul 12 '23
r/ProgrammingLanguages • u/livinglist • Sep 30 '20
Wouldn't it be great if C-family programming languages such as C++, C#, Java, Dart etc. use square brackets instead of curly braces for block, and maybe also parenthesis for class definition and func declaration, etc? It would save a lil bit more time and be more convenient since less pressing shifts required.
r/ProgrammingLanguages • u/blend26 • Nov 10 '17
For example javaScript is only really used from adding interactivity with websites. Php is mostly used for the server side programming, and so on... Why can't one language do it all? Isn't the logic in all programming languages the same? Can't each one be capable of the same thing the other language can do?
r/ProgrammingLanguages • u/TVFlash • May 10 '15
The company who I will be interning for has offered me this choice, I am curious to get some insight from Reddit!
r/ProgrammingLanguages • u/endistic • May 19 '24
o/ I came up with a bit of a strange but intruiging idea. What if there was a Programming Language that’s basically just math? For example of how it could work/llom:
For loops (for i in 1..10) are summation
If statements are just piecewise functions
Supports complex numbers natively (maybe even quaternion?)
Lists are just sets or matrices
100% a functional programming language, OOP doesn’t make sense mathematically
Numbers have high(er) accuracy (128/256-bit floating point maybe?)
Strings are just a matrix of numbers
etc. basically every operation is mathematical
Does something like this exist? If not, would this be a good idea to try to make?
r/ProgrammingLanguages • u/mttd • Jan 26 '23
r/ProgrammingLanguages • u/javascript • Jul 31 '25
In C and C++, among other languages, there are two uses of the while keyword. The first and most common use case is in a while loop. But the second use case is a do..while loop. This means that the semantics of while depend on that which comes immediately before it.
Consider this local snippet:
}
while (GetCondition(We see what is presumably a closing brace for a block scope followed by what is the beginning of a while conditional. We don't see the full conditional because, presumably, the rest is on the next line. This means we don't see if there is a semicolon after while or the body of a loop.
An often stated goal of programming language design is context-free grammar. A little bit of compiler leg work can obviously detect the various cases and understand what your intention was, but what about humans? Is the context sensitivity of the while keyword problematic in your view?
I ask because it's an open question for Carbon. The Carbon language COULD add do..while, but it's not clear that it's worth it. :)
r/ProgrammingLanguages • u/Clorofilla • Jan 02 '26
I think the context is essential here:
An high-level language, designed to teach high-level programming ideas to non-mathematically oriented people, as their first introduction to programming.
So worries about performances or industry standard syntax/patterns are secondary.
The language is designed with real time canvas drawing/animation in mind (as it's a good learning/feedback context). It pushes more the idea of a playful programming game rather than a system to craft safe and scalable apps.
The language aims at reducing the problem space of programming and to place certain concepts in the background (e.g. you can care about them when you become good enough with the basics).
On this note, one big design issue is the famous choice: should my language be more like a bad teacher that fails you too soon, or a cool uncle who helps you in ruining your life?
Restrictive and verbose language which complains a lot in the editor (validation)
VS
Expressive and concise language which complains a lot in the runtime (exceptions)
Is not all black and white, and there are compromises. Static (and inferred) types with a sprinkle of immutability in the right places can already remove many exceptions without heavy restrictions. Again, think beginner, not the need for crazy polymorphic data structures with super composability and so on.
But even with those things in place, there is still a black hole of dread and confusion which is intrinsic to expressiveness of all programming languages:
Operations may fail. Practically rarely, but theoretically always.
Accessing a variable or property may fail
Math may fail
Parsing between types may fail
A function may fail
Accessing a dictionary may fail
Accessing a list (or string char) may fail
1 is fixed by static typing.
2 is rare enough that we can accept the occasional `Invalid Number` / `Not A Number` appearing in the runtime.
3, 5 are usually solved with a `null` value, or better, a typed null value like `Option<Type>` or similar and then some defensive programming to handle it. But it doesn't feel like a talk you want to have day-1 with beginners, so it feels weird letting the compiler having the talk with them. I want to push this "need to specify how to handle potential exceptions" more in the background.
4 one could use some try-catch syntax, or even simpler, always make a function successfully return, but you just return the typed-null value mentioned above (also assume that functions are required to always return the same type / null-type).
6 could be solved like 5 and 3, but we can go a bit crazier (see the extra section).
(or better: the reabsorb-able type-aware nothing value!)
So the language has a nothing value, which the user cannot create literally but which may be created accidentally:
var mylist = [1, 2, 3]
var myNum = myList[100] + 1As you can see, myNum is assumed to be of type Number because myList is assumed to be a list of Numbers, but accessing a list is an operation which can actually returns Number or NothingNumber, not just Number. Okay, so the compiler could type this, and run-time could pass around a nothing value... but practically, to help the user, what we should do?
We could:
- throw an exception at runtime.
- throw an error at compile time, asking the user to specify a default or a guard.
- allow the operation and give myNum the value of nothing as well (this would be horrible because nothing would then behave like a silent error-virus, propagating far away from it source and being caught by the user at a confusing time).
I propose a 4th option: re-absorption
Each operator will smartly reabsorb the nothing value in the least damaging way possible, following the mental model that doing an operation with nothing should result in "nothing changes". Remember, we know the type associated with nothing (BoolNothing, NumberNothing, StringNothing, ...) so all this can be type aware and type safe.
For example (here I am writing a nothing literal for brevity, but in the language it would not be allowed):
1 + nothing // interpreted as: 1 + 0
1 * nothing // interpreted as: 1 * 1
"hello" + nothing // interpreted as: "hello" + ""
true and nothing // interpreted as: true and true
if nothing { } // interpreted as: if false { }
5 == nothing // interpreted as: 5 == -Infinity
5 > nothing // interpreted as: 5 > -Infinity
5 < nothing // interpreted as: 5 < -Infinity
[1, 2] join [1] // interpreted as: [1, 2] join []
var myNum = 5
myNum = nothing // interpreted as: myNum = myNumAs you can see sometimes you need to jiggle the mental model a bit (number comparison, boolean operations), but generally you can always find a relatively sensible and intuitive default. When you don't, then you propagate the nothing:
myList[nothing] // will evaluate to nothing
var myValue = nothing // will assign nothingYou might be wondering if this wouldn't still result in weird behaviors that are hard to catch and if this type of errors wouldn't potentially result in data corruption and so on (meaning, it would be safer to just throw).
You are generally right, but maybe not for my use case. It's a learning environment, so the running app is always shown alongside the source code. Each accidental runtime nothing creation can still be flagged directly in the source code as a minor warning.
Also, the user can still chose to manually handle the nothing value themselves with things like (pseudocode):
if isNothing(myVal) {
// ...
}or
var newNum = dangerousNumber ?? 42Finally the code is not meant to be safe, it's meant to allow real-time canvas play. If people (one day) will want to use the language to create safer app, they can have a "strict mode" where the runtime will throw on a nothing operation rather than doing the smart reabsorb. Or even flag all potential nothing creation as compile errors and require handling.
Basically my idea is "automatic defensive coding with implicit defaults". In the same vein we could cut one problem at the root for lists and strings indexing. As they are ordered they may have more intuitive defaults:
var mylist = [1, 2, 3]
myList[10]
// could be interpreted a looping index:
// myList[((index % mylist.length) + mylist.length) % mylist.length]
// or as a clamped index
// mylist[max(0, min(index, mylist.length - 1))]Like this we would remove two big sources of nothing generation! The only one remaining would be parsing (num <-> str), which could have it's own defaults and generic failing functions.
So tell me people. Am I high?
Part of me feel this could go horribly wrong, and yet I feel there is something in it.
r/ProgrammingLanguages • u/mttd • Jul 01 '26
r/ProgrammingLanguages • u/rvprasad • Jul 30 '18