Has anyone here every created their own programming language? What was the syntax like, and what did you use to implement the language? Using Haskell to implement your language is cheating BTW, so don't even post here if your language is made from Haskell.
Name:
Anonymous2008-10-24 14:54
Here's a sample of my programming language. I used Bison/Flex to lex and parse it. Everything was done in C. It's very simple and similar to C.
I rewrote Tcl in QBasic once. Shit wasn't capable of more than two nested function calls, but it worked.
Name:
Anonymous2008-10-25 15:02
I rewrote LAMBDA CALCULUS in LAMBDA CALCULUS once. Shit wasn't capable of more than two nested function calls, but it worked.
Name:
Anonymous2008-10-25 15:12
Yo dawg I herd u like term substitution, so we put a lambda calculus in your lambda calculus so u can beta-reduct while u beta-reduct
Name:
Anonymous2008-10-25 15:38
>>14
I don't get this joke. It seems like it could be funny if you get it but I don't so fuck off.
Xarn, over and out.
Name:
Anonymous2008-10-25 16:10
>>14
The verb from which ``reduction'' is derived is not, oddly, ``to reduct''. That would just be something you could do after you removed the ducts from something.
Name:
Anonymous2008-10-25 16:35
Mine is the best
Public Shared Function AreYouAFag(ByVal You As Person) As Boolen
If TypeOf(You) Is Fag Then
Return True
End If
Return True
End Function
Name:
Anonymous2008-10-25 16:51
>>17
this language looks like Transformers
it's designed for kids and it's all fucking stupid and made of idiotic bits and peices that don't actually do anything
Name:
Anonymous2008-10-25 16:56
>>18
It's the "let's have lots of keywords instead of difficult mathematical-ish operators" school of language design. Too bad it makes code almost impossible eyeball.
Semicolins are the corner or a good programming laguage.
And parenthesis.
Case sensatvity. value and Value are obvoously completley different things.
And the inability to determine equality and and assigment based on context.
if(You == Fag)
{ //start of this if statement
return 1;
} //end of this if statement
else
{ //start of this if statement's else
return 1;
} //end of this if statement's else
I've pondered making my own. I explored a variety of paradigms and languages (Lisp, Java, C/C++, Objective-C, Python, Ruby, VB, C#, etc). I wanted a fairly easy to read language. I also debated over having the language also be its own macro language. For the syntax, I chose to allow nearly every character to be an identifier (parenthesis and brackets being the only exception). White space would be the only only delimiter. I also wanted commands separated by a linefeed (since nearly all lines of code use just one line) with a character for line extension. All 'operators' are simply just identifiers. Functions can be declared to allow for only prefix notation (outside of the parenthesis) or infix notation (like operators). I never quite concluded on how infix evaluation priority would be determined. I wanted inline, anonymous (lambda) functions. But again I wasn't sure how I could abstract program flow commands and declarations so everything use the same form.
Basically I wanted the consistency and flexibility of Lisp with an easier syntax like Python. However after using Netbeans, I realized the program syntax is almost irrelevant when you have an IDE that can be wielded like the raw power of a god.
Name:
292008-10-27 1:07
I see now that Seed7 does some of the things I was exploring. Interesting.
>>29 Lisp with an easier syntax like Python
Wat. It doesn't get easier than Lisp, except for maybe Forth, which is harder to follow even though there's less structure to bother with.
If you're going to release a language at least try to make it practical because you might get a job out of it 10 years later (GvR).
Name:
Anonymous2008-10-27 4:05
>>32
Easier to write on regular bases, not to understand basics
Name:
Anonymous2008-10-27 10:39
I think the perfect language wouldn't have keywords at all.
Name:
Anonymous2008-10-27 10:55
BRAIN FUCK
Name:
Anonymous2008-10-27 11:05
>>36
A helpful and relevant message on /prog/ would be the biggest brainfuck of them all.
Name:
Anonymous2008-10-27 15:16
Serious answer is serious:
If you just want a VERY easy to implement language that coders (probably just yourself) will use, then go for stack-based.
If you need anything else, jam a DSL on top of Lisp with its macro system.
Name:
Anonymous2008-10-27 18:19
>>38
Can someone please explain what the fuck is a DSL?
Name:
Anonymous2008-10-27 18:28
(Post truncated.)
Name:
Anonymous2008-10-27 18:28
Dyslexian Sex Lord.
Name:
Anonymous2008-10-27 20:32
Dick Sucking Lesbian. If you can find one, that is.
Name:
Anonymous2008-10-27 21:28
>>39
Domain Specific Language.
(Fuck off, you DON'T HELP HIM faggots.)
Also, if you just want to play around with designing a language and don't want it to look exactly like every other goddamn Lisp clone, take a look at Parrot. It's pretty easy to dump out PIR code. As for parsing, try Haskell (or Python with pyparsing, if haskell isn't your thing).
That should be more than enough to get you started; if you've any experience with lower level code (that is, if you've written a few things in assembler, or at the very least, lots and lots of stuff in C) you should be able to hammer away at some code and get a not-very-well-designed, but entirely functioning language, in less than 500 lines of code.
The best part about doing it this way is it won't be just another stupid Lisp or Forth clone.
>>35 http://seed7.sourceforge.net/
# User defined statements and operators.
# Predefined constructs like arrays or for-loops are declared in the language itself.
Name:
Anonymous2008-10-28 16:59
have an IDE that can be wielded like the raw power of a god
Making the language easy to parse will make it easier for an IDE to manipulate the code.
There are many choices for types of parsers (a.k.a. syntactical analyzer):
Bottom-up (a.k.a. "shift-reduce parsing")
Left-to-Right ("LR")
Left-to-Right(0) ("LR(0)")
Left-to-Right(1) ("LR(1)")
Left-to-Right(k) ("LR(k)")
Simple Left-to-Right ("SLR")
Look-Ahead Left-to-Right ("LALR")
Generalized Left-to-Right ("GLR")
?? (CLR)
Top-down
Left-to-Left ("LL")
Packrat
The most well known are flex/bison and Antlr, which I believe these are all LR parsers. There is also the Boost "Spirit" library, which I would use to throw together some easy parsing.
Some grammars:
Backus–Naur form (a.k.a. "BNF", "Backus–Naur formalism", "Backus normal form", "Panini–Backus Form")
Parsing expression grammar ("PEG")
Chomsky normal form ("CNF")
If that were true then C# would provide a better IDE than VB.Net in Visual Studio. It does not.
It can't even tell if I am referring to a member or a method until compile time and then give me an error if I forgot the fucking parenthesis. VB.Net doesn't require those useless fucking parethesis but it does catch other syntax errors right away.
And that is not to say that Visual Studio sucks. It still provides the best IDE for an C style syntax language.
Name:
Anonymous2008-10-28 18:56
ANTLR is actually LL(*), despite the name.
Name:
Anonymous2008-10-28 21:21
>>50 It still provides the best IDE for an C style syntax language.
Not really, Eclipse is better
Name:
Anonymous2008-10-29 16:40
This thread is threadstopped. You can't reply anymore.
Name:
Anonymous2008-10-29 16:40
This thread is threadstopped. You can't reply anymore.
Name:
Anonymous2008-10-29 17:00
This thread is threadstopped. You can't reply anymore.