Is it possible to write a programming language with an existing one? I want to create a game creation program, and have it use it's own language for additional programming. Something similar to Game Maker.
Name:
Anonymous2005-06-13 7:52
>>33
This is one of the best sentence I've ever read. But it spans more than just CS.
Name:
abez!XWEgiX8ArQ2005-06-20 21:50
All the game programmers use lua because they are painfully ignorant of functional languages. Since this will be for game programmers I'd suggest make a game engine which is extendible via Lua. You could also use a language such as SML to build a meta language which they code in.
Name:
Anonymous2005-06-21 3:17
>>42
First off: holy fuck, you posted in every thread.
Second: of course they're aware of functional languages. Who isn't? I'm interested to hear your reasons why they should use one for embedding though.
Name:
Anonymous2005-06-21 3:23
My knowledge of functional languages is very limited, but for what I've seen, they aren't that good as they sound - ok, they are attractive and interesting, but in real application environments, you're more worried at things like execution speed, code cleanliness and maintainability, syntax, learning curve, etc., and these languages (at least for what I could see) seem to be really lacking at some of these things, especially syntax, maintainability, and performance.
Well lisp is embedded into emacs, it doesn't seem that bad. The GIMP works very well with Guile. Guile is meant to be embedded and it is quite powerful. It doesn't seem to be the abortion that is Lua. Lua is inherently imperative but it really seems like a clean version of php. In other words Lua was designed for non-programmers whereas Guile was designed after Scheme, a real programming language. Guile has enough power like closures etc to handle much of the stuff you would expect. Functional languages also promote the parameterizing of functions via more functions. They make it convienant to pass around code or compose new functions to pass around. Lua on the other hand has it's datastructures and it's kludgy imperative style.
SML is a whole different story, SML is as the name implies a META LANGUAGE, you can define lots of additions to the language via the type system, you can effectively make new languages out of users just composing types. Even better you can match against these types and produce real code and then compile that.
Why reinvent the wheel when the wheel is here, it just needs a bit of tune up.
Name:
Anonymous2005-06-21 3:52
Yes, but I wonder if worrying about such features is justified, considering few people know them and they hurt maintainability. And the few stuff made with functional languages I used seems horribly slow.
What's so bad about traditional imperative structured programming, BTW?
Name:
abez!XWEgiX8ArQ2005-06-21 4:13
How does functional programming hurt maintainability? Supposedly abstraction and parameterizing improve maintainability, at least that is what people who emphasize agile methods and refactoring suggest.
I don't know what you used, I know that SML derivatives are quite fast because a strict type system allows the compilers to make all sorts of lovely optimizations beyond tail calls. I use OCaml for realtime audio synthesis and it holds up quite well against C.
Well I did recommend Lua didn't I, so imperative can't be that bad. Imperative is rather straight forward but it is pretty limited, usually functional languages allow for more code reuse through parametric polymorphism etc. I would argue that you write more code in an imperative style. For a game wouldn't it make more sense to have reusable chunks of logic you can pass about (I know you can pass functions in Lua). This is especially relevant for AI.
I explicitly recommended SML as it provides you with meta-language capabilities, you can extend SML without changing SML very much, you can also extend it in such a way that it can be compiled, you could generate C code and compile that if you wanted to.
Name:
Christy McJesus!DcbLlAZi7U2005-06-21 4:38
Uh if it's an extension language why would you care about speed? The engine is where the speed matters and you've already coded that to be fast (I hope you profiled before optimising).
Name:
Anonymous2005-06-21 5:52
>>47
Defining sub-languages and using these features increases software complexity. You're adding to what a coder needs to know to implement new features or change something, which reduces productivity. Besides, I don't know how nice SML is otherwise (I'll look into it later since you recommend it), but I've seen LISP, and man, that's a sucky syntax (or lack of). Unholy amount of parenthesis and prefix notation makes programs harder and slower to write, and much harder to read and understand. I'm not talking about writing my own sysadmin hacks, but an application I'm getting paid for and I have to document.
>>48
Depends on what do you want to use it for. Macros in a word processor? Anything will be fine. IA in a game? I would care.
Name:
Christy McJesus!DcbLlAZi7U2005-06-21 9:00
>>49
For an alternative view on everything you just mentioned, have a look at www.paulgraham.com
Paul Graham's company Viaweb developed the first decent software for creating web stores, which he then sold to Yahoo for many millions. He attributes Viaweb's ability to stay ahead of the competiton to the power of abstraction offered by Lisp, as compared to the low level languages other companies were using.
Worth a read; he's an excellent essayist.
Name:
Anonymous2005-06-21 10:12
Graham is a homo who wrote the software for amazon.com in clisp (they switched to C later because clisp sucks) and has done nothing since except write essays and a five hundred word document on "Arc", a lisp like language that he's supposed to finish some-time by 2070. Although, he might actually have a point about the superiority of lisp, the way he presents this conjecture is rather retarded.
Is not. I didn't say that he is wrong, just that he has an obnoxious off-putting way of stating his point.
Name:
meeelting2005-06-22 11:10
I've recently just wrote something like this; as i decided that lua/xml was probably too hard for the graphicians and the designer.. anyway; try to make it as simple as you can. (did this in C++ btw, not too familiar with C)
Anyway, if you're gonna go ahead and make your own language: i suggest you start by simple loading a file into a large char string, and the parse it up piece by piece, looking for spaces.
Then simply start looking through your parsed char variables, looking for commands.
Good luck guy..
Name:
Anonymous2008-04-19 18:48
>>4
ONE WORD: FORCED INDENTATION OF CODE. Thread over.
Anyway, if you're gonna go ahead and make your own language: i suggest you start by simple loading a file into a large char string, and the parse it up piece by piece, looking for spaces. Then simply start looking through your parsed char variables, looking for commands.
After reading that part by chance, I began scanning the post for the string `C++'. Sure enough, there it was.
Name:
Anonymous2008-04-19 21:30
Just implement The ABC Programming Language. It can do everything.
Load a file into a string? Load the file char by char until you read whitespace: now you have loaded one token.
Start by writing code converters for stuff like brainfuck, befunge, and ABC. Easy: convert your made up language into code some other, working compiler can understand.
Name:
Anonymous2009-03-06 7:54
Assembly End the sector with x55 xAA It will get released next year I mean it might Read the C FQA Lite.