10 ms·
I thought the industry standard for game scripting is Lua. I mean - if you want to attract the wide range of game devs, why choose lisp?
by viach 11y ago
I thought the industry standard for game scripting is Lua. I mean - if you want to attract the wide range of game devs, why choose lisp?
- technomancy 11y agoBecause you're John Carmack. You'll attract devs no matter what you use, so it makes sense to use the best tools available.
- viach 11y agoYes, he of course can afford this - to play with things he likes. But will it blend?
- codygman 11y agoDoes it need to blend? Were Racket the only supported scripting language for Oculus I'm sure people would just learn Racket rather than skipping out on Oculus.
- sklogic 11y agoNo need to learn Racket, it's easy to build any language on top of it. Having a single meta-language as a base allows diversity and choice for end users that is not possible with any of the inferior (non-meta) languages.
- p4bl0 11y agoAs sklogic said, no need to learn Racket: It has multiple Lipsy dialects: http://docs.racket-lang.org/guide/dialects.html http://docs.racket-lang.org/guide/dialects.html And a datalog one: http://docs.racket-lang.org/datalog/index.html http://docs.racket-lang.org/datalog/index.html It knows C: http://pkg-build.racket-lang.org/doc/c/index.html http://pkg-build.racket-lang.org/doc/c/index.html And Javascript: https://github.com/lwhjp/ecmascript https://github.com/lwhjp/ecmascript And Algol: http://docs.racket-lang.org/algol60/index.html http://docs.racket-lang.org/algol60/index.html And Pascal: https://github.com/soegaard/minipascal https://github.com/soegaard/minipascal It shouldn't be too difficult to teach it Lua ;).
- ahoge 11y agoBest? If we'd all agree on what "best" means, we wouldn't discuss anything ever. Scheme and all the other Lisp variants look terrible to me. Having an excessively simple syntax doesn't mean that it's nice to use. They went too far. This is probably the primary reason why Lisp dialects aren't more popular. Even the simplest code examples look like some sort of practical joke. (let ((hello0 (lambda() (display "Hello world") (newline)))) (hello0)) [Edit: This example was taken from Wikipedia's Scheme article.] Something like that in Dart: hello() => print('Hello world'); hello(); Dart's syntax is way more complicated, but this is much easier to understand, isn't it?
- Arcanum-XIII 11y agoSeriously ? (defn hello [] (println "hello world")) (hello) ;; in Clojure (defun hello () (format t "hello world")) (hello) ;; in Common Lisp.
- ahoge 11y agoThe example was taken from Wikipedia's Scheme article. I do not know how to write Hello World in Scheme. By the way, I really like how everyone's Hello World looks different.
- sklogic 11y agoSo, you know nothing about Scheme, but yet dare to have an opinion?
- ahoge 11y agoYes, I "dare" to have an opinion on that syntax. I like it from a theoretical point of view. It's very uniform which is convenient for implementers. It's brilliant, really. However, I dislike it from a practical point of view, because this uniform soup is hard to scan and also hard to write. I pretty much like any other language's syntax better than this one. Even fairly cryptic ones like Erlang's.
- deckiedan 11y agoHere's his (brief) answer (from the same thread): John Carmack: > >An imperative API makes functional abstraction harder. What are the main selling points for Scheme/Racket now? > I am a big believer in functional programming (and static types) for large projects, but there is an undeniable bit of awkwardness compared to just imperatively poking things for small projects. That is one of the wins for Scheme -- I can make it super-easy to get easy things working, but it isn't just a "scripting language" unsuitable for large scale development. I am going to have to sort out my Racket / Chibi module strategy sometime soon, though. > As far as language choice goes, I don't claim to have broadly evaluated every possibility and chosen the optimal one. > Java or C# would have been more familiar to a broader base of game industry developers, but I really didn't want to drag in all the bulk of a JVM / .NET system, and a class focused world view seems less suited for the smaller scripting tasks. > Javascript would have been more familiar to a broader base of web industry developers, but I have basically no experience with javascript, and little desire to explore it (which is admittedly a fault of mine). > S-expression reading and writing is a strong factor for network communication, and I like the fact that there are available options for Scheme to interpret / compile / compile-to-C. I can see valid use cases for all of them, and I'm not sure how important each will be. > The bottom line is that I have been enjoying myself working with Racket / Scheme this year, and I have evidence that it has been objectively productive for me, so I'm going out on a bit of a limb and placing a bet on it. > >Initial impression: 7 years after starting to program in Racket, it still surprises me how easy it is to do something > >useful in just a few lines of code. > A big goal here is to make the authored code very clear and simple. I may yet get to a single #lang vr <ip address> declaration that gets rid of the boilerplate at the top and bottom of the file and flips the right switches to make Racket closer to R7RS. > There are sets of creative-types that are learning how to put things together in Unity to accomplish fairly simple media related tasks. I think I can make it easier for them with very domain specific helper libraries and a little bit of scheme.
- viach 11y ago> I am a big believer in functional programming > I have basically no experience with javascript > The bottom line is that I have been enjoying myself working with Racket So there is no logical reason behind, he just loves Racket, ok
- deleted 11y ago[deleted]
- TeMPOraL 11y agoI think it is pretty much expected of devs to be able to learn new languages on the fly, as you need them. Also, just because something is the "industry standard" (of popularity), doesn't mean you should always follow.
- davedx 11y agoI've worked at a couple of games companies and we didn't use Lua on any of the projects I worked on. One was starting to experiment with it when I left. A large AAA studio I worked at actually rolled their own scripting language, compiler, and VM from scratch. I got to get my hands dirty with this. The only time since University I've had to utilise my compilers knowledge :) Unity gives you the choice of C#, a JavaScript dialect, or a Python dialect. Why not lisp? :D
- devloper 11y agoC# is also a dialect there AFAIK.
- viach 11y agoBecause, in my opinion, when you create a tool for the masses, the individual preferences should be the last in line of factors when you choose scripting programming language for that.
- andrewchambers 11y agoGod forbid javascript developers are being encouraged to broaden their horizons by a master of the discipline. He is going to be forced to add javascript by whiners anyway, I am enjoying the pipe dream of keeping it away.
- TeMPOraL 11y agoWhen you create a tool for the masses, you get a crap tool. You should focus on creating a good tool first; the masses will have to follow anyway.
- pmelendez 11y ago> when you create a tool for the masses, the individual preferences should be the last in line Well Javascript is Javascript because of some guy personal prefences at Netscape. The same is true for C# and Java in their respective companies, and they didn't start as popular languages either.
- TazeTSchnitzel 11y agoLua's a minimal and easy-to-learn language that's easy to embed. But is it a good language? I'm not sure. It's weakly-typed and dynamically-typed, for example.
- beagle3 11y agoLua is not weakly typed (at least not in the sense of Javascript and PHP where "3"+4 is either 7 or 34, can't remember which. It is dynamically typed, but so is Scheme, so that's not a reason to choose Scheme over Lua. It has the bestest JIT currently found in any dynamically typed language, and rivaling the best JITs of statically typed languages like Java. What's your definition of a good language that accepts scheme but not Lua?
- sklogic 11y agoTypedRacket is statically typed. Good language is a meta language. There is MetaLua, of course, which qualifies it as a "good" language, but Scheme got more bells and whistles.
- JoshuaScholar 11y agoMetalua isn't compatible with luajit. It needs the slower C based interpreter. Its problem was that it was based on a very old version of Lua and it needed things like goto that weren't in lua yet, so it goes straight to bytecodes. I'm working on building languages on top of Lua/Luajit, since Lua has a good tracing jit, there's no reason you can't write an expanded metalanguage on it that will preprocess a bit and give you a brand new language. By the time I'm done it will have the power of scheme (including continuations, with some functions compiled internally to use continuation passing style, since Lua guarantees tail call elimination) and macros. The main difference should be that the base type will be arrays and tables not lists, but that could be an improvement. I'll probably tack on something like s-expressions too.
- JoshuaScholar 11y ago
- sklogic 11y agoScheme (or any other Lisp) is the best choice for a baseline implementation, because it can be easily (and without any runtime cost) turned into any other language. You can do similar things with MetaLua, but at a greater cost.
- AUmrysh 11y agoThe Naughty Dog team made a lisp (GOAL) for some of their games.
- stchang 11y agoWhen moving to PS3, they used Racket instead. https://www.youtube.com/watch?v=oSmqbnhHp1c https://www.youtube.com/watch?v=oSmqbnhHp1c