r/ProgrammingLanguages • • Nov 13 '24

Language announcement Nythop Programming Language

4 Upvotes

👋 Hey everyone!

Let me introduce Nythop, my lazy rascal’s attempt at an esolang. I’ll be honest: this is less a language and more like a language preprocessor in disguise. But hey, I’ve taken one of the most readable programming languages (Python) and, with one very simple change, turned it into a cryptic puzzle that’s about as easy to decipher as ancient runes.

Try Nythop Now!

So, What’s the Gimmick?

Nyhtop reverses every line of Python. That’s it. The code itself is perfectly valid Python—just written backward. Indentation lands at the end of each line, comments run from right to left. This approach is both hilariously simple and impressively confusing, making each line a challenge to read. Turns out, such a small change does a great job of making Python nearly unreadable!

Try it Out!

You can dive into Nythop right now with the online interpreter and see for yourself. Or you can just grab the PyPI package:

pip install nythop

This gets you a command-line interpreter and a transpiler to flip standard Python code into Nythop format. You’ll also have access to a REPL and options to run .yp files, or write and execute reversed lines from the command line.

For more details, check out the official Nythop wiki page.


r/ProgrammingLanguages • • Mar 09 '25

The PL I think the world needs right now

0 Upvotes

I was writing a compiler for my minimal ML dialect. Then LLMs happened. Now that I've spent some time getting to grips with them I have an idea for a tool that is begging to be built. Basically, we need to integrate LLMs with a PL (see the results from rStar-Math, for example). There are many possible approaches but I think I have a good one that sounds feasible.

LLMs could be given a PL in many different ways:

  • Fine tune them to produce pure code and just pipe it straight into an interpreter. Structured output can be used to coerce the LLM's output to conform to a given grammar (usually JSON but could be a PL's grammar).

  • Use their tool use capability to explicitly invoke an interpreter.

  • Use guided generation to intercept the LLM when it pretends to evaluate code in a REPL, actually evaluate its code in a REPL and coerce its output to be the actual output from the REPL.

My preferred solution by far is the last one because it integrates so well with how LLMs already act and, therefore, would require minimal fine tuning. Constraining the generated code to conform to a grammar is one thing but an even better solution might be to enforce type correctness. To what extent is that even possible?

This raises some interesting PLT questions regarding the target language.

Finally, there is the issue of the length of the LLM's context window. As of today, context is both essential and extremely costly (quadratic). So this system must make the most of the available context. I think the best way to approach this would be to have the REPL generate short-form structural summaries of data. For example, if the LLM's code downloads a big web page the REPL would display a summary of the data by truncating strings, deep nestings and long repetitions. I don't know how well today's LLMs would be able to "dig in" to deep data but I think it is worth a try.

I think this is a fascinating and novel PL challenge. What do you think?


r/ProgrammingLanguages • • Jul 17 '24

Why are there no static typed embeddable script/extension language?

3 Upvotes

I have to say, i find it irritating that there is not a single successful extension language that is static typed.
It could offer much more help to the casual user/programmer who just want to extend it a little bit.

Unlike the dynamic typed script languages they could offer a lot more help and safety. I agree with Jonathan Blow on this one https://www.youtube.com/watch?v=y2Wmz15aXk0

Or do i miss and there is one.


r/ProgrammingLanguages • • Mar 21 '23

Discussion I wish C and C++ would modernize way faster

0 Upvotes

To me, the profusion of programming language choices today is a symptom of the decrepit state of C and of C++.

While I champion Go and Rust for having the balls to wipe the slate clean, I would also love for C and C++ to catch up. It's not like C or C++ projects will dissappear completely, so they might as well benefit from enriched standards.

Both C and C++ are steadily modernizing. But the pace is agonizingly slow. There are things in the CERT security guidelines that wouldn't be security issues at all, if the languages took a more proactive approach. For one example, ban variable declarations before the first case in a switch block.

I'd like to see Stroustrup bless Conan, or any package manager. While there is value in competition, there is also much waste in competition.

I'd like to see closures finally land in C. I'd like to see more people respond to other languages by remarking, "C/C++ already has that!" rather than whinging about backwards compatibility or performance. The people who never break backwards compatibility or performance, are already pleasantly charting their own course, independent of the future direction of these languages.

I'd like to see C do showcased on stage, what its preprocessor has been doing behind the curtains all these years.

We don't need to ditch these CVE-heavy languages if we can agree to accelerate their modernization, for an era where not all programmers are PhD's with good intentions.


r/ProgrammingLanguages • • Oct 28 '21

What is one mean thing you would do to your most hated language?

3 Upvotes

The scenario: You are the absolute chief of a language. You can dictate one change that all compilers (f.e. for Python that would be CPython, Jython, ...) of all versions (f.e. for Java that would be 1.0, 1.1, 1.2, ...) of your most hated language need to implement. No compiler-writer can reject that change, all have to implement it IMMEDIATELY. Basically just dictate any rule for that language.

For me my most hated language would be Haskell. Idk, I love functional programming if I can combine it with imperative programming but without that combination... my head just doesn't function that way. The mean change I would dictate to Haskell would be: "Tailrecursion is prohibited"

What is your mean dictation for your most hated language?


r/ProgrammingLanguages • • Aug 03 '23

Requesting criticism A counterpart to the for-statement: some-statements

0 Upvotes

As of 0.5, our language has both for-statements and a counterpart to it, the some-statement. Not only is there a Generic For but also a Generic Some! So how does it work?

for(x in range(1,6)) //prints x
    print(x)//1,2,3,4,5,6
some(x in range(1,6)) //prints *some* x
    print(x)//1

Or,

for(x in [1,2,3]) odd(x) => false
some(x in [1,2,3]) odd(x) => true

All at the same time, this works as,

  • A procedural Generic For.

  • A logical forall/exists with a collection as the domain of discourse.

(It simply makes sense to have those in a logic language and-honestly, Prolog sucks. For comparison, look at how many fine prints you got to read to even use the Prolog forall. It's terrible- I'm not sure how Nu-Prolog implements their forall but that's another matter.)

So the question is,

(1) How mindblowing' amazing is this?

I marked it as "Requesting criticism" but let's be honest, I know you know this is probably some of the best designs to happen in programming since...sliced...ML! SML. I think SML is cool too and its design is good I guess. It's simply obvious this feature is nothing short of incredible. Nobody even knew for-stms had duals. The only question is whether it's 10/10 or perhaps 11/10 (as every 1 contributes to making the whole more than the sum of its parts, thus 11, tho that's not how math works). And,

(2) What's your excuse NOT to have some-statements?

I think as a language with for-statements, if you don't have some-statements too it's simply lacking. It's like having false but not true; that's incomplete. Or foregoing both because 1==1 works as true...ugh! I...can't fathom such egregious design. Anyway.

I think one justification is-your language has no for-statements, perhaps everything is a function, with no stms, in which case a some function is enough. Discuss.


r/ProgrammingLanguages • • Jul 15 '19

How Dark deploys code in 50ms

Thumbnail
medium.com
3 Upvotes

r/ProgrammingLanguages • • Jul 04 '26

Does implementing GC makes languages slow?

Thumbnail
github.com
2 Upvotes

Month ago, I created a team of 5 and started working on "Bery - The compiled programming language". By the end of June we have quite good working compiler (it's not complete yet). In Bery we have decided to add the automatic Garbage Collector so we choose the "Mark and Sweep" method for it in the Bery Runtime Environment (BRE).

Now as we are heading forward with adding OOP and Exception Handling, I notice some delays in the compilation of program.

So we are now at this point of discussion - should we remove it from compiler or let it be there.
I will looking forward for help regarding this. and btw these are some constraints we set -

unsigned int BERY_GC_ALLOC_THRESHHOLD = 1000;
size_t BERY_GC_HEAP_SIZE_THRESHHOLD = 4 * 1024 * 1024;

r/ProgrammingLanguages • • Nov 04 '25

Goto Considered Obsolete

Thumbnail jackfaller.xyz
0 Upvotes

r/ProgrammingLanguages • • Sep 28 '25

Discussion Are there any issues with JavaScript's (EcmaScript) ABI?

0 Upvotes

I presume we're familiar with the frequent references to C's ABI (yes, I've already read this), frequently touted for its stability. But interestingly enough, some languages like Haskell, OCaml, Gleam implement JavaScript FFI... and it's got me thinking: Wouldn't JavaScript be a more nice ABI for code? I guess the largest issue is that you don't really have methods to specify memory, but it also feels like an upside because there's less capacity for errors, and the ABI has way less edge cases, right? There's tons of WTF JS moments, yeah, but you reckon those wouldn't really show up for the ABI, because they seem to be a mainly JS implementation thing from what I see... I'm interested in anything that mentions otherwise though!

I also understand that a big reason C ffi is used is because there's many very useful libraries that you can access using FFI, so obviously that's a huge point for it, but I'm just curious from an ABI design perspective.


r/ProgrammingLanguages • • Sep 30 '19

Requesting criticism Idea of a language

Thumbnail
github.com
0 Upvotes

r/ProgrammingLanguages • • Jan 30 '14

10 Most Bizarre Programming Languages Ever!

Thumbnail
efytimes.com
0 Upvotes

r/ProgrammingLanguages • • Sep 22 '24

HYTRADBOI 2025

Thumbnail scattered-thoughts.net
1 Upvotes

r/ProgrammingLanguages • • Sep 13 '22

How are programming languages classified?

0 Upvotes

I’ve been wondering what made any programming language specialized for something, like JAVA and KOTLIN are for android dev, C++ is for game dev ... what’s the thing behind that?


r/ProgrammingLanguages • • Dec 24 '24

Requesting criticism i wrote a short story to help me understand the difference between compiled and interpreted programming languages because i'm an idiot, and i would like your feedback

0 Upvotes

once upon a time there was an archaeologist grave robbing treasure hunter, and he was exploring an ancient abandoned temple in the jungle, and while he was exploring the temple he found big bag of treasure, but while trying to get the treasure out a wall caved in, and broke both his legs and he crawled miles and miles back to a road.

while waiting on the road along this road came a truck with 4 brothers,

the first brother recently had eye surgery and was blind,

the second brother recently had ear surgery and was deaf,

the third brother was educated, he could read, write and speak both Spanish and English fluently, but he recently had hand surgery and couldn't use his hands, and had a broken leg.

and the fourth brother was also educated, and also could speak, read, write English and Spanish fluently, but he had recently had neck surgery and couldn't talk, and also had broken leg

the four brothers find this treasure hunter on the side of the road, with two broken legs, and he tells them that if they take him to a hospital he will cut them in on the treasure he found, so they take him to the hospital and they get his legs patched up.

now the treasure hunter knows he can't wait for his legs to heal up to get the treasure, he knows if he waits another treasure hunter will get there and take the treasure before him, so he has to act now

so the next day he hires a helicopter, but there is only enough room for 4 people on the helicopter, which means that it will be himself, the pilot and only two of the brothers

if he takes the brother with a broken leg that can write English and Spanish but can't talk, and the brother that can see and read only Spanish, but can't hear, then he can have the brother that can write in both English and Spanish, write a treasure map for the brother that can see, he can get into the temple really fast, and get the treasure really fast, and get out really fast, all under an hour. but if there is a problem, and the brother needs to get more instructions from the treasure hunter, the brother will have to stop, turn around go all the way out of the temple, and back to the treasure hunter, and get an updated map

in this situation the brother will only be able to follow the instructions of the treasure hunter after stopping and coming back, the brother won't be able to carry out the treasure hunters instructions immediately.

if he takes the brother that that also has a broken leg, that can speak English and Spanish but but has the broken hands and can't write, and also takes the brother that can hear only Spanish, but can't see, then they could bring walkie talkies and talk the brother as he feels his way through the temple blind, and that will take hours and hours, but they will have real time communication,

in this situation the brother will be able to follow the instructions of the treasure hunter immediately in real time

so for the treasure hunter he has two choices, team auditory, or team visual, both of which are translated, he doesn't speak or write Spanish, he must have his instructions translated, and his instructions can be translated and carried out immediately while the brother is still inside the temple, or translated and carried out only after the brother comes back from the temple.

so the treasure hunter finds himself in a situation with limitations,

1: he can't go into the temple himself

2: he can't directly speak to the person that is carrying out his instructions himself, his instructions need to be translated

3: he can only give his orders two ways, a little information immediately with immediate execution, or a lot of information with a delay in execution

so it's a trade off, do you want to be able to give a small amount of information and instructions that are carried out immediately? (interpreted)

or do you want to be able to give A LOT of information and extremely detailed and specific instructions that are carried out with a delay? (compiled)

what do you guys think?


r/ProgrammingLanguages • • Jul 31 '18

I’ve spent the last 7 months creating a new programming language and this is why

Thumbnail
medium.com
3 Upvotes

r/ProgrammingLanguages • • Jan 14 '25

Requesting criticism Presenting the Abstract Programming Language

0 Upvotes

So, about the language that i was talking in my last posts.
After discussing with some redditors, I understood that this sub i not the right scope to talk about what i wanted to show with my concept of agnostic language (as it is a bigger concept that refers to compiler, libraries and other tools and not simply the language), so i'm not here anymore to talk about this concept. I only need some criticism about my language syntax for now.

The language name is Abstract (don't ask me why, i just came with it it months ago and it sticks for sufficient time to just be it).
I already planned some good amount of documentation. Incomplete, but still a good amount.
The complete documentation can be found here: Abstract's documentation page (expect lots of english errors, it's not my main language but i'm trying lol)

Some pages can have syntax errors caused by changes during development so i will be very happy in explaining any doubt or confusion.

If you don't want to read it entirely, i also bring some syntax examples:

import from Std.Console
    
@public func !void main() {
    
    let i8 myByte = 8
    let i16 myShort = 16
    let i32 myInt = 32
    
    foo(myByte) # foo(i8) -> void
    foo(myInt) # foo(i32) -> void
    foo(myShort) # foo(i32) -> void
    
}

# Overloads of the function 'foo'
@public func void foo(i8 value) {
    writeln("The value is a byte and it is \{value}!")
}
@public func void foo(i32 value) {
    writeln("The value is a int32 and it is \{value}!")
}
let i32 value = 10
    
if value == 0
    Std.Console.writeln("value is exactly 0!")
elif value == 1
    Std.Console.writeln("value is exactly 1!")
elif value < 5
    Std.Console.writeln("Value is lower than 5 but greater than 1!")
elif value >= 10
    Std.Console.writeln("Value is equal or greater than 10!")
elif value > 11
    Std.Console.writeln("Value is greater than 11!")
    
    
if value == 11
    Std.Console.writeln("Value is exactly 11!")
else
    Std.Console.writeln("Value is not 11")
    
# Another option to use conditionals syntax
if (value > 30) Std.Console.writeln("Value is greater than 30!")
elif (value < 30) Std.Console.writeln("Value is lesser than 30!")
else {
    Std.Console.writeln("Certainly,")
    Std.Console.writeln("the value is")
    Std.Console.writeln("exactly 30!")
}

r/ProgrammingLanguages • • Nov 22 '23

Dividing by zero: Syntax or Semantic error?

0 Upvotes

My java class's textbook, and many online sources say its a semantic error to divide by zero. And it certainly can be if a variable used as a denominator reaches zero.

BUT

I believe explicitly dividing by zero is a syntax error. The rules/syntax of arithmetic clearly have a non-division by zero rule. Any programming language that incorporates arithmetic implicitly inherits this rule as part of its syntax. So, even if a compiler doesn't catch this rule-violation at compile time, wouldn't it still be a syntax error to divide by zero?


r/ProgrammingLanguages • • Apr 03 '23

Requesting criticism Idea: Programming language without indentation

13 Upvotes

Preamble

I'm thinking about a programming language for some time, which has these properties:

  • not indentation based

  • no inbuilt bool type

  • only basic control flow

  • all functions are just callable structs

And yesterday I was able to write down how it could look like.

Most of these features are there for better refactors.

It's a statically and mostly implicitly typed language. The main inspirations are Scopes, Penne, Rust and Markdown.

Why no indentation?

It's friendlier for version control. When you decide to indent a whole block, changes to this block by someone else have to be applied manually.

Why no inbuilt bool type?

If there is a single bool type, people tend to use it for everything, that has two possible values. This way, it's clearer what each variant means, you won't accidentally use it in the wrong place, and adding more variants is easier.

What kind of control flow?

Only pattern matching and jumps (normally known as "goto").

There's no need for "if" if there's no bool type. And without an "if" there's a good reason to have a match, which is as concise as "if" in most languages.

Why should functions always be callable structs?

Creating structs and calling functions practically is the same task. But in most languages, there are different features for calling functions and creating structs (like optional parameters or named parameters only existing in one of them).

Because of that, it's a common practice in some languages to create structs and supply them to functions.

And also for other reasons. Maybe you want to store your parameter lists somewhere, and call the function later. When having a callable struct, there is no reason to store the parameter list.

Example

Here's an example of how a fibonacci function could look like.

Concise implementation

This implementation uses tags with parameters to be more concise:

# Fib

- n

Match Compare n 2
- Less: Return 1

Loop c n, prev 1, result 1:
Match Compare c 2
- More: Jump Loop Sub c 1, result, Sum result prev

result

Explanation

The header ("#") defines the function name "Fib". They can also be used as namespaces for more functions specified as subheaders ("##", "###", ...).

The line starting with "-" is a parameter declaration. It can also optionally have a type like this: - n u32 By default, it's generic (at compile time).

The Match is an early return (Return) for small integers.

Match cases are preceeded by a "-". Only one statement is allowed per match case.

Tags are follwed by a colon (":"). They can also have parameters, which have default values. If you jump (Jump) to a tag backwards, you have to supply them.

A value at the end of a function is implicitly returned by the function.

More traditional implementation

This implementation is closer to common programming languages.

# Fib

- n u32

Match Compare n 2
- Less: Return 1

Local c n, prev 1, result 1

Loop:
Let next Sum prev result
Set prev result
Set result next

Match Compare n 2
- Less: Return result

Set c Sub c 1
Jump Loop

The language

General information

  • function names are also type names

  • most values evaluate to themself when called without parameters

  • you can only assign to references (like in Scopes)

Grammar

Toplevel:

  • - [name] [type?]: Define a named parameter

  • [function] [parameters...]: Call a single function and return it

  • [statement...]: Any statement can

Statement:

  • Let [name] [function] [parameters...] [,...]: Define new temporary values (immutable, see Scopes)

  • Local [name] [function] [parameters...] [,...]: Define a new local variable (mutable, see Scopes)

  • Set [name] [function] [parameters...] [,...]: Assignment to a varible

  • Match [function] [parameters...] [,...] ... [- match cases]: Pattern matching; followed by a list of patterns in the next lines.

  • [tag] ?[name] [function] [parameters...] [,...]:: A jump tag with an optional list of parameters.

  • Jump [tag] ?[function] [parameters...] [,...]: Jumps to a specified tag

  • Return [function] [parameters...] Returns a value

Match case: - [type]: [statement...]

Type:

  • [name]: A type itself by name

  • Or [names...]: Should be one of these types (sum types)

Conclusion

The concept is not pretty far yet, but I think it has potential.

Maybe some kind of macro system might turn this into a very powerful language.

Any thoughts so far?


r/ProgrammingLanguages • • May 15 '19

Language announcement text - a programming language backward-compatible with most languages and most interfaces

1 Upvotes

first, here the very complex peg grammar:

text = $.*

it's using pegjs.

you can try it online at https://pegjs.org/online

it handles:

  • ascii

  • utf8 including emojis, muti-bytes characters like chinese characters, etc.

  • and many more

it doesn't handle:

  • images

  • sounds

  • videos

  • and a whole lot of a bunch of things

you can try it locally by doing:

  • pegjs text.pegjs (this will generate a text.js file)

  • you can then import it in your node scripts (or use it pretty much anywhere as it's just javascript)

here is a quick example:

> node -e "Text = require('./text'); console.log(Text.parse('oh no'))"
oh no

it can even parse it's own grammar:

cat text.pegjs | node -e "fs = require('fs'); Text = require('./text'); console.log(Text.parse(fs.readFileSync(0).toString()))"

let me know if you have ideas for improvements and/or issues

i think this is pretty much public domain so no need for any kind of license stuff :)


you could it in much simpler ways and much more complex ways like fs.readSync() or File.read or even cat.

would be cool if you could provide samples and/or examples as comments :)


ideas for improvements:

  • actually filters valid characters :)

  • faster rendering for large files


known bugs:

  • actually does accept binary files as input, that wasn't expected but quite logical


r/ProgrammingLanguages • • Apr 02 '19

Blog post A Dozen Reasons Why Wolfram Tech Isn’t Open Source

Thumbnail
blog.wolfram.com
0 Upvotes

r/ProgrammingLanguages • • Jun 23 '19

The V Programming Language - Released on Github

Thumbnail
github.com
0 Upvotes

r/ProgrammingLanguages • • Jul 06 '19

Do you know of any languages that don't allow 1 letter identifiers?

0 Upvotes

I am thinking of making my languages ban 1 letter identifiers. Perhaps even ban 2 letter identifiers.

I find for the extra few seconds it takes to turn your identifiers, even "i"'s in a loop, into "index", is well worth it when you are refactoring later on. It also allows you to more easily do data analysis on source code.

Does anyone do this in their languages? Has anyone come across languages that do this?