Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

How About This:

Name: Anonymous 2010-08-25 2:17

A development environment that lets you edit your language as you edit your program in that language.

The language is defined with a grammar that you can edit.  That grammar is simultaneously used to parse your program.  You can also define bells and whistles like syntax highlighting in the grammar.

Has it already been done?  Wait, I already know the answer, so I'll change the question:  Where can I download it?

fuck off with your lex/yacc/flex/bison comments because that's clearly not what I'm suggesting

Name: Anonymous 2010-08-25 2:23

I think it actually is!

Name: Anonymous 2010-08-25 2:24

>>1 here, I have just spotted the flaw in my idea.  Just parsing the language is not enough; you would also need a way to tell the tool how to actually compile it.

Name: Anonymous 2010-08-25 3:28

>>1
I think I saw mention of something like this on LtU.

Name: Anonymous 2010-08-25 3:59

emacs?

Name: Anonymous 2010-08-25 4:18

A development environment that lets you edit your language as you edit your program in that language.

Hrm. How about:

A programming language which grammar you can edit while programming in this language.

More info here: http://perl6advent.wordpress.com/2009/12/24/day-24-the-perl-6-standard-grammar/

Name: Anonymous 2010-08-25 5:29

>>5
I'm fairly sure that all the necessary elements to get emacs to do this are there, somewhere.  But getting it to do it conveniently is unlikely.

Name: Anonymous 2010-08-25 5:38

>>1
C preprocessor

Name: Anonymous 2010-08-25 6:20

Any preprocessor.

Name: Anonymous 2010-08-25 8:05

>>7
anything above the C-level primitives should be easy enough

Name: Anonymous 2010-08-25 8:09

>>1
Andrei Alexandrescu had an idea for a language before he joined Walter Bright for D 2.0. It was quite a lot like what you were talking about here. Basically it was sort of a meta-language; at the top of a source code file you define a grammar for parsing your language, and then in the rest of the file you use it.

Lemme see if I can find it... Ah here we go: http://erdani.com/enki/

Name: Anonymous 2010-08-25 9:17

>>11
Interesting.

Name: Anonymous 2010-08-25 10:02

>>11
O wow. That is interesting.

Name: Anonymous 2010-08-25 10:30

what youre suggesting is called a DSL (Domain Specifac Language)

Name: Anonymous 2010-08-25 10:31

>>14
No, it isn't.

Name: Anonymous 2010-08-25 10:31

What, like... functions? That you can define for yourself?

That's revolutionary.

Name: Anonymous 2010-08-25 10:39

It is no exaggeration to regard this as the most fundamental idea in programming:
   The evaluator, which determines the meaning of expressions in a programming language, is just another program.
To appreciate this point is to change our images of ourselves as programmers. We come to see ourselves as designers of languages, rather than only users of languages designed by others.

IF IT'S NOT DONE YOU HAVE TO

Name: Anonymous 2010-08-25 11:45

http://www.chrisseaton.com/katahdin/
But there's a performance hit associated with changing the syntax at runtime, since you can't actually do anything with the source code before you run it.
What this all really means, though, is that you, >>1, should just stick DSLs.

Name: Anonymous 2010-08-25 12:29

>>16
No, language grammar you can define yourself.

Name: Anonymous 2010-08-25 14:06

>>19
Why would you add grammar to a language?

Name: Anonymous 2010-08-25 14:29

use Acme;

Name: Anonymous 2010-08-25 14:40

Name: Anonymous 2010-08-25 15:21

>>1 here, I'm probably just being trolled, but the comments about preprocessors and functions make me think that the original post was misleading.

I'm just imagining working in an editor, writing some code, and thinking "it would be nice if I had a keyword called foo that did so and so."  Then I'd just go up to the menu and click something like "switch to grammar edit view" and I could define foo and then click "switch to code edit view" and I'd be right back to editing my code, but I'd have this new keyword foo available and the code editor would highlight it as a keyword, the compiler would know what to do with it, etc...

Just adding a new keyword is a pretty trivial example.  If you had full control over the grammar, you could change everything about the way your language works.

Name: Anonymous 2010-08-25 15:25

>>23
Just use Lisp. You can define macros to do crazy shit; just look at the keywords you can use in a loop construct. You can even define new reader macros, so you add your own syntax by programming parsing rules for special characters. This is how people add things like { dictionary: "syntax" to: 'Lisp } using a couple dozen lines of code.

What you're asking for already exists, and it's in Lisp.

Name: Anonymous 2010-08-25 15:28

>>24
So you could make Lisp look and behave exactly like, say, C++?  I would enjoy seeing that.  (Not joking, I really would.)

Name: Anonymous 2010-08-25 15:37

>>25
I don't see why you would enjoy seeing anything behaving like sepples.

Name: Anonymous 2010-08-25 15:38

>>23
First you should demonstrate that this is a desirable feature. I can imagine that readability would go entirely out of the window.

Name: Anonymous 2010-08-25 15:53

>>27
That would depend entirely on the competence of the guy creating the grammar.

Name: Anonymous 2010-08-25 15:56

>>25
There ws some Sepples compiler in Lisp, but I think it's kind of incomplete. Sepples is a large language with too many corners.

Name: Anonymous 2010-08-25 16:09

>>28
Most programmers aren't clever enough to debug their own programs. Why would they be able to debug their own grammars?

Or de-louse their own grandmothers for that matter?

Name: Anonymous 2010-08-25 16:18

>>30
One interesting thing about an environment like this, for beginners, would be that they'd have access to a preexisting library of languages.  Other than that, yeah, it wouldn't be great for new/bad programmers.  Maybe it would at least broaden their horizons slightly.

Name: Anonymous 2010-08-25 16:55

>>30
If we always catered to the average programmer, we wouldn't have Lisp or Haskell or even Python. Just COBOL and Java as far as the eye can see.

Name: Anonymous 2010-08-25 17:00

>>32
Except Lisp predates both COBOL and Java

Name: Anonymous 2010-08-25 17:07

>>33
Except
NO EXCEPTIONS

Name: Anonymous 2010-08-25 17:10

>>33,34
*Accept

Name: Anonymous 2010-08-25 17:18

>>35
*Except

Name: Anonymous 2010-08-25 17:20

>>36
Axhebpt

Name: Anonymous 2010-08-25 20:42

>>23
Maybe it's time you learned how to define functions.

Name: Anonymous 2010-08-25 21:13

DEFINE MY ANUS

Name: Anonymous 2010-08-25 21:16

>>25
IIRC Racket has/had a Java-like language and an algol language

Name: Anonymous 2010-08-26 1:04

>>38
Maybe it's time you learned the difference between writing functions and parsing grammar.  When you can "define a function," in C, that causes the following to be accepted by your standard C compiler, then your comment will cease to be retarded:


  printf } `you have poor reading comprehension' {;

Name: Anonymous 2010-11-13 19:55

Name: Anonymous 2011-01-31 20:29

<-- check em dubz

Name: Anonymous 2013-03-13 12:47

A pack of wild JEWS. Greedy, slavering JEWS nearing your goy property. Trampling your gentile lawn. Raping your goy daughter. And you can't do shit since they're greedy. The JEW leader *grabs your [/m]dick*[m] and cuts it with his menorah. The primal JEWS finally dominate the stock market. They make you watch barbaric shows on TV and you're forced to be their slave.

Such is the downfall of theALASALAMIRAJIHADATAKRATLAMAHARAALLAILALALALALABOOOOOOOOOOOM

Don't change these.
Name: Email:
Entire Thread Thread List