r/learnpython • • 8d ago

Making my own golfing language in python

Im not that active on reddit, but the moment I came into the osdev subreddit (I tried making my own OS with a python shell) and I INSTANTLY got my inbox filled with hate comments.

I heard from one reddit post that this subreddit is much friendlier and more helpful, thats why I switched to this subreddit.

So I started making my own golfing language, array-oriented ofcourse, where data and code are seperated.

As of now I haven't really done anything except plan on what instructions to make, I have a total of 20 letters and symbols on board.

So, I'd like to hear some tips about making interpreters/compilers that I should keep in mind.

0 Upvotes

28 comments sorted by

View all comments

1

u/Kevdog824_ 8d ago

I don’t know what a golfing language is, but a few points I can think of

- Avoid ambiguity in your syntax/grammar
- Version your language and compiler/interpreter separately
- Avoid backwards breaking changes to syntax once released. Observe semantic versioning
- Maintain comprehensive test cases to regression test new updates to the language (important that new features don’t break existing functionality)

3

u/Outside_Complaint755 8d ago

I believe OP means a very concise language to be used for "code golfing"

3

u/Kevdog824_ 8d ago

Makes sense. I think my advice applies pretty generally to any language specification