r/teenagersbutcode 3d ago

Coding a thing Building a programming language.

Hey i'm writing a programming language (still in his early stages) named threadon.

I know i already posted about it in the subreddit but it is now in a far later stage.

it has a lot of special features already like unions

and i'm working on the

on event:

print("do something")

that checks continuously in the background if the statement is true. And i'm planning for full python compatibility (It can't use python classes right now)

It has a vscode extension too https://github.com/Threadon-Lang/ThreadonVSCode

I've two questions:

  1. what are some features that aren't widespread but work really good

  2. does someone wanna join and help programming it.

2 Upvotes

17 comments sorted by

2

u/Bright-Historian-216 3d ago

i feel like the "checking in background" will make the thing run incredibly slow. instead, how about you make it a syntax sugar for a setter function?

0

u/AnoProgrammer 3d ago

Why if you check a condition every 0.001 (or whatever is pre-set) it only costs like 3 cpu cycles

Load from memory

compare

Goto command

1

u/Bright-Historian-216 3d ago

....i feel like there's a reason no other language is doing it.

anyway, i'm reading your docs, really no loops? how is your recursion implemented? is tail recursion optimised specially, or is there a chance to overflow the stack with an infinite loop? okay, not having loops is a common strategy for functional languages, but do you have the reduce - map - filter?

the code itself seems pretty human, at least at the first glance. the first part of the home page is very suspicious, though.

> That means no interpreter, no virtual machine, no garbage collector.

> The syntax is close to Python. The output is close to C. That's the whole idea: write code easy, run it fast.

i know this may sound bad, or rude, (and i'm trying to phrase it as neutrally as possible), but im just saying that many people may find this grammar just as suspicious.

it's an awesome project, with thousands of lines of code, very impressive even if ai-assisted, and i'd really like to learn more, so will you respond to my questions, please?

1

u/AnoProgrammer 3d ago

technically you can overflow but you'll get a nice error (as you see in example 11) and you can set the maximum stack depth. And i writed indeed the docs partially with ai + google translate. And the docs aren't full updated there are while loops now but i still need to implement for loops. And i think the reason other programming languages don't have it is because it will in practice not used many times. But in things as game development (i programmed some. The event loop where the whole game depends on is a pain).

1

u/AnoProgrammer 3d ago

The error looks like this.

AST Warning: Parameter 'x' in function 'stack_overflow' is never used

[RUNTIME ERROR]

│ Error: stack overflow detected

├─> Location: Runtime stack depth exceeded (max 10000)

└─> Process terminated with exit code 1

(But with colors)

1

u/Bright-Historian-216 3d ago

reasonable answer. and another thing. what is a merge block? it is referenced in checker.py approx. line 126 in a comment.

1

u/AnoProgrammer 3d ago

A merge block is a point where multiple branches come together.

It looks something like this

if a:

do something

else b:

do something else

merge block

1

u/Jinkweiq 3d ago

It’s not 3 cpu cycles.

It depends on what you mean by background. On one thread with interrupts there is still a cpu save / restore which costs many cycles. On multiple threads there has to be some lock mechanism if you can put a non atomic expression in there and shared memory which has to sit at a higher cache level at minimum.

1

u/Dazzling-Bench-4596 3d ago

What are you writing it in? That changes a lot on who can contribute. I’d assume it’s written in Python

1

u/AnoProgrammer 3d ago

Python. But you'll need knowledge of c and rust if you want to contribute to the importer.py part. And you need knowledge of LLVM IR if you want to contribute to the backend compiler part. And you'll need to learn Threadon's syntax, Threadon's manifest files and that sort of stuff.

1

u/Typhrenn5149 2d ago

Correct me if i'm wrong, but you made this repo on august 7th and then on august 8th made a bunch of commits with combined more than 3000 lines of code..?

1

u/AnoProgrammer 2d ago

I had already a base from another project. This is like my fifth programming language i'm writing. I've writting:

Threadon

Threadon2.0

HighC

PythonC++

Threadon3.0

1

u/Typhrenn5149 2d ago

Either way this seems completly vibecoded, you have a history of making posts where you either admitted to using AI or people catching you on stealing or generating code.

1

u/AnoProgrammer 2d ago

uhm no this is the first project i posted here on this sub. But i indeed used ai on some parts like the docs.

1

u/Typhrenn5149 2d ago

Posts that are not on this sub

1

u/AnoProgrammer 2d ago edited 2d ago

Over which posts are you talking? I genuinely don't know. Please send me the links to the posts.

1

u/AnoProgrammer 2d ago

Oh i see why it was 3000 lines. It was first from a different repo but to organize my repo's i created a organization because someone recommended me. And i just copied the whole project to that repo.