Ask coding questions

← Back to all posts
What language should I code my own language in?
acuaro (0)

Hey, replit!

I've been looking to start my own language in just to gain experience and I think it would be really fun, but I have came across one problem, I'm not sure what language I should use to make it! I know the system of how to make one (lexer, parser, ASL, etc), and I think I'm leaning on interp or bytecode interp.

C++ and C are the most answered things for questions like this, although, I only know the basics of both.

I'm very comfortable and know a lot about JS + Python, but I've heard writing languages in those are terrible ideas as their compile/interp times are really slow.

I'm kind of in a dilemma where if I choose one of the C's, I won't understand a thing and I'll get extremely confused, but if I choose the latter, I'll end up having something slow.

Any help would be appreciated!

And if your interested in making a language, we could possibly work together :)

Answered by MocaCDeveloper (651) [earned 5 cycles]
View Answer
Comments
hotnewtop
MocaCDeveloper (651)

C. C! C!!

Please, USE C. DO NOT use interpreted languages or any OOP type of language like C++, Java etc(idk why you'd use Java but still lol).

C just offers the fundamentals needed to create a programming language. If nothing else, I would be more than happy to help you create a interpreted(or compiled) programming language using C :D

acuaro (0)

@MocaCDeveloper Cool ok! I know more C than C++ or Java combined!
I think I'll go with interp, as it'll be nicer to get into.
If you can help with some fundamentals/getting started for a lexer and some small interp parts that'd help a lot :D

acuaro (0)

@MocaCDeveloper Ok cool, I got my grammar done, now I'm looking to start the lexing process, whats the best way to approach it?

MocaCDeveloper (651)

@acuaro

Sorry for the late reply!

If you want, you can invite me to the repl so I can walk you through. Else if you'd rather just have me explain I gladly will!

acuaro (0)

@MocaCDeveloper Yep ok!

I will invite right now :)

Coder100 (18253)

The languages you are most comfortable with is the language you should start with First.
Once you finish, you usually rewrite the language in a faster language. Maybe rust?

Also the fastest language is C nothing else.

https://craftinginterpreters.com

No language is too slow, choose what you want, and revise!

SixBeeps (5235)

@Coder100

Also the fastest language is C nothing else.

Asm: Am I a joke to you?

[deleted]

Depends...

IMayBeMe (484)

Personally, I'm writing my own language in python which I'm most comfortable in but am planning to re-write it once it's done in a faster language. If you know a compiled language, it would be preferred, but it's totally fine to write something incredibly slow in python and convert to something faster later on.