[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/prog/ - Programming

Programming board

Catalog

8chan Bitcoin address: 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C
The next generation of Infinity is here (discussion) (contribute)
A message from @CodeMonkeyZ, 2ch lead developer: "How Hiroyuki Nishimura will sell 4chan data"
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 1 per post.


5c83c0 No.1593

How do you make your own language?

ee1b54 No.1596

>>1593
Invent it.

Implementing it is another matter.
/thread

45ba1e No.1601

Start with common lisp as it lets you redefine the language very easily.
(that means you first have to learn CL)
Each program of more than trivial complexity is actually a language on its own.

If you want to create a "real" programming language instead of a DSL, start studying books about compilers, like the so called dragon book.

ee1b54 No.1602

>>1593
Implement one with the "Make A Lisp" tutorial.

697e97 No.1708

>>1593
I suppose you are talking about computer languages, but the process is similar for creating an artificial natural language, if you want that. First define a grammar for your language. Make life easier for yourself by creating a context-free grammar, then convert it to (Extended) Backus-Naur form.

Once you have a grammar, you can start implementing your language. You should decide between interpretation and compilation.

Compilation is a well-understood problem and there are plenty of books on it. In essence you write instructions to translate one language to another. This involves reading in the source code; tokenizing it; building an abstract syntax tree; parsing the tree; generating the target language. You can research that yourself.

Parsing is probably the biggest stumbling block for you. For a simple language with a context-free grammar as I suggest, you should be able to write a parser by hand. Eventually you should consider automatically generating your parser with for example ANTLR or bison.

b5e4c0 No.2200

I'm making one. 3 years in and still not done. Not for the faint of heart, let me tell you.


a739cb No.2215

>>2200

MORE INFO MORE INFO


ddc321 No.2358

I'm also making one. It took me 1 month and is nearly complete.


b5e4c0 No.2395

>>2215

* compiled

* dynamically typed

* multiple dispatch as the sole form of polymorphism (java/c++ style oop is ew)

* pass by reference, return by value (no gc or manual memory management. seems weird at first, but it's great)

* and eventually, it's own ide


181620 No.2399


ee5414 No.2400

im assuming you are not actually frustrated with the current dogma of programming languages, but rather that you want to learn, in that case, start simple.

first do research on how to create a postfix calculator, then once you have that working, work on converting infix expressions into postfix ones then pass that through postfix calc.

and that's it really, then work on creating variables for your calculator, if statements, loops… it will never be on par with languages like C, even the poorer ones like java, but it is a great practice program.


428fa5 No.2409

>>1708

>>2400

PARSING INFIX EXPRESSIONS AND FUCKING WITH YACC ARE TOTALLY THE MOST IMPORTANT PART OF LANGUAGE DEVELOPMENT SPEND LOTS OF TIME ON THEM

ANYONE WHO SAYS "METACIRCULAR EVALUATOR" IS A DUPLICITOUS SCUMBAG FUCKING WITH YOUR MIND IGNORE THEM


e170cb No.2410

>>2409

>PARSING INFIX EXPRESSIONS AND FUCKING WITH YACC ARE TOTALLY THE MOST IMPORTANT PART OF LANGUAGE DEVELOPMENT SPEND LOTS OF TIME ON THEM

I'm pretty sure nobody said this was "the most important part" - infix notation is just a simple way to start learning the basics of a parser.

Also, that anon didn't even say "use YACC", he said to write the parser by hand, then "eventually" "consider" automatically generating a parser.

>ANYONE WHO SAYS "METACIRCULAR EVALUATOR"

Um… OP asked how to "make your own language" - you're going to have to forgive him for not being able to write the next Lisp straight away. I mean, we don't even know that this isn't just idle curiosity.

Please calm down.




[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]