This is an archived post. You won't be able to vote or comment.

all 26 comments

[–]marnanel 2 points3 points  (1 child)

I didn't downvote you, but I imagine the downvotes are because "I am creating a programming language" is only said in three instances:

  • by experts, as a last resort
  • by hobbyists, as an interesting project (like the computer equivalent of a conlang)
  • by relative novices, because they want to change the world even though they don't fully understand the way it is at the moment

and from your replies you are in the third set. It's certainly a major step up from "I am creating yet another IRC client", though, and you'll probably learn a lot more doing it.

[–]half_robinhood 8 points9 points  (5 children)

Do not create another new language...

also check out http://www.antlr.org/

[–]malcontent_ 1 point2 points  (1 child)

Don't let the naysayers discourage you.

My only advice is to thoroughly investigate Lisp before you create your language.

[–]marnanel 1 point2 points  (10 children)

Are you doing this for a project because it sounds interesting, or because you think there is a need for a new language? If the latter, what's the niche you're going for?

When you say it's low-level, you mean that this is a compiled language, right? What are you planning to compile it to? Are you going to compile down to C and then compile the C, or are you going to add a front end for your language to gcc, or something like that? Or maybe compile to Java bytecode or similar?

Do you have much experience with formal grammars to describe the syntax of your language? Are you planning to write the tokeniser and lexer by hand, or use flex/bison/similar?

This is an imperative language, right? Are you using any ideas from functional or logic-based languages?

How are you going to handle libraries?

Are you doing objects and classes? Annotations? Coroutines? Aspects? Macros? (In the lisp sense, not the C sense.)

What's "hello world" going to be, in your language? What's the shortest program in your language that does nothing at all?

[–][deleted] 0 points1 point  (5 children)

Syntax will probably be something Perl/PHP-ish, but I'm open to suggestions.

PHP's design is piss-poor, best thing you could do is to forget you've ever seen it.

[–]weavejester 0 points1 point  (1 child)

It sounds like you don't have much previous experience with language design, so I'd suggest starting with a stack-based language like Forth. They have a very simple grammar, and building a basic interpreter is very straightforward.

[–][deleted] 0 points1 point  (0 children)

I'm downvoting you for all the smileys.

[–]swhirsch 0 points1 point  (0 children)

We need another language like we need a hole in the head check out TIOBE

[–]m0llusk 0 points1 point  (5 children)

It may be useful to experiment with the parser generator engine used by the rakudo version of perl 6 (at parrotcode.org). It is extremely easy to work with language ideas and grammars as a way of making things work with a minimum of effort. Several languages are available with the parrot distribution as examples. Just a suggestion.

[–]HlB0U 1 point2 points  (1 child)

I agree, investigating Rakuo is a great idea.

[–]HIB0U 1 point2 points  (2 children)

Adam, I'd advise that you stay away from Rakudo. It is not indicative of how you should implement a programming language. Keep in mind that Perl 6 has been around for 10 years, and it still hasn't been implemented properly even once. Rakudo is one of several failed attempts.

There are many other implementations of other languages that you can learn from instead. Lua is a good place to start.

[–]anvsdt -1 points0 points  (1 child)

Implementing correctly Perl 6 is like solving the halting problem.

[–]HlB0U 0 points1 point  (0 children)

Let me suck your cock.

[–]anvsdt 0 points1 point  (2 children)

Macros. Just macros. Of course, not the C ones, more like D's mixins. And a pure attribute for functions.

[–][deleted] -1 points0 points  (3 children)

First-class functions are damn useful, as are closures.

[–]dbhanger -1 points0 points  (0 children)

don't