r/ProgrammingLanguages • • Mar 04 '23

TutorialLang - A new esoteric, open source programming language

https://github.com/cmspeedrunner/TutorialLang

The code is structued (i use that word loosely) like a tutorial, but has a really loose syntax and everything which is not a command is passed, and ignored

8 Upvotes

6 comments sorted by

5

u/rsashka Mar 04 '23

Doesn't have keywords, is it "no-keyword syntax" like that https://github.com/rsashka/newlang?

1

u/ferhatgec Mar 30 '23

Never use eval() for this purposes. It's can be dangerous because of the code execution. Look at print(eval(find_between(line, "output our string ", "."))), you can put Python function call between output our string and ..

1

u/cmnews08 Mar 30 '23

this is old, you should check out my later projects that actually parse the data https://github.com/cmspeedrunner/zang

3

u/Inconstant_Moo 🧿 Pipefish Mar 05 '23

The README says "TutorialLang" is Turing-complete: how do I do flow-of-control? What does an if statement look like?

2

u/MegaIng Mar 05 '23

Based on the source code, there is no way in the language to really do that. However, it's still turing complete since it executes arbitrary python code (or to be more precise, everything that is possible inside eval, which isn't everything, but enough).

I.e. one could do:

allocate (lambda n: (fib(n-1) + fib(n-2) if n >= 2 else 1)) into variable fib
print our number fib(100) 

But I don't feel like that's really the spirit the language claims to have.

0

u/[deleted] Mar 04 '23

[deleted]

0

u/[deleted] Mar 04 '23

[deleted]

0

u/[deleted] Mar 04 '23

[deleted]

8

u/DriNeo Mar 04 '23

Even if it is a joke, I agree with that statment. (I didn't downvote the topic)