15 ms·
John Carmack: “I just dumped the C++ server I wrote for a new one in Racket”
- nacs 12y ago> but it is winning for development even as a newbie Not sure Carmack qualifies as a newbie when it comes to anything programming-related.
- jwatte 12y agoNot to mention, the test of a platform doesn't come in the first hour, it comes after shipping, some Saturday morning at 4am. And then over the course of the next ten years. Not saying Racket is bad, but first impressions usually give way to time.
- deleted 12y ago[deleted]
- Guthur 12y agoIn my opinion anyone can be a newbie once taken out of their comfort zone. John Carmack was mostly a C programmer up until quite recently and then started experimenting with some Functional Programming languages, and I'm sure he had a few things to learn when doing so. Not to take away from an obviously intelligent individual.
- Dewie 12y ago> Not to take away from an obviously intelligent individual. It's interesting to observe how programmers and other similar intellectual workers prostrate themselves in their own specific way when referring to someone of high status in their field.
- deleted 12y ago[deleted]
- astrocyte 12y agolots of editing on your post .. I reckon it takes more effort to be politically correct and toe the popular line than to just state the obvious truth : All across the globe, software engineers of value do amazing stuff everyday. They're too busy doing the amazing stuff to be praising someone for doing what they do on a daily basis. The ones that aren't doing amazing stuff can be found prostrating themselves to every tweet some high profile person makes because they don't grasp the normalcy of coding at that level on a regular basis. Sadly this idolization is what is probably the biggest impediment to them progressing to the level of the person they praise. For every Carmack, there's 1000s of unspoken/unheard of people doing the same thing. I try to think of them, myself, and not get too excited... Steve Jobs was Steve jobs because he thought different. You're not going to turn into him or Carmack by trying to emulate them or by following tweets and prostrating yourself. P.S - the only reason why I commented is because I have friends who constantly give me updates about what Carmack is doing as if they've just had an encounter with God. I can't help but think they are this way because they themselves have never coded at that level. Sadly, you don't get to that level by going Gaga over another programmer. You get to that level by understanding that there is nothing amazing about what Carmack/etc does, digging into something you care about, and pushing your own personal limits... People don't want to hear these kinds of things though as it necessarily compels them to action. They'd much rather rally around the superstar and put him/her on a chariot. Vicarious living? P.S.S - Constructive discussions can occur on a topic easily as long as individuals aren't over hyping it and are actually capable of conversing at a similar level. Fanfare is just as harmful as it makes people believe there is some mystical magic to achieving things. There isn't.. Just dedication and passion.
- to3m 12y agoI've deleted my post as I think it was incorrect. Having worked with Carmack's code, two things I liked about it: it always came across as being the first obvious thing that popped into his mind, and yet it was always somehow the right thing. Sadly, I myself can only manage one out of two.
- O____________O 12y agoFor every Carmack, there's 1000s of unspoken/unheard of people doing the same thing. Well, okay, then, there must be millions and millions of programmers writing CRUD apps and for loops, because that covers probably 95% of the general value created in programming worldwide. I don't see anything wrong with being impressed by the accomplishments and interests of others. I'm not Carmack. I'll never achieve anything like his level of productivity. I don't care, but I'm still vaguely interesting in reading about the guy. I don't plan to climb Mt. Everest either, but I wouldn't mind hearing a story about it. And yeah, there are thousands of people planning Mt. Everest climbs, but that has zero bearing on my feelings about it.
- astrocyte 12y agoI tend to observe that seasoned/good software engineers are too busy tackling problems of similar difficulty to be caught up praising, following, and prostrating themselves to others. It's not a habit of mine and I don't hold anyone who does it in high esteem. I tend to think someone praises another to a large extent because they don't hold themselves in high regards. If they did and were of similar skill level, it wouldn't seem a big deal to them right? i.e : Tweet (high profile software engineer) : Today I cut 500ms out of a 4 second operation on a consumer device Me : OK .. last week I cut a 10 second switch-over operation on a enterprise switch (grosses 8 billion dollars in revenue a year) down to 300ms. I thought that was just a part of my job as a software engineer.
- Dewie 12y agoThe upvotes and downvotes on this post has been a true roller coaster. EDIT: someone is fast on the vote-trigger; hello, friend. ;)
- sehugg 12y agoDoom 3 was written in 2004, and was in C++, not to mention Carmack's other scripting langauges and VMs he wrote for his other game engines .. not to take anything away from your comment.
- Narishma 12y agoThe C++ used in Doom 3 was basically C with classes. Even Carmack says it's not his best work since he wasn't proficient in it and didn't take the time to learn it correctly.
- a8da6b0c91d 12y agoI would be willing to bet he's still eight years behind the times with his C++, and that is the explanation for this post. Writing a solid and flexible server in C++ is just not very hard with modern tooling.
- mwcampbell 12y agoWhat would you consider "modern tooling" for writing a network server in C++? Boost Asio, perhaps?
- a8da6b0c91d 12y agoAsio is good but can frustrate people unaccustomed to the heavily templated boost approach. High learning barrier. cpp-netlib aims to wrap and simplify Asio for people doing the typical stuff, but I've no experience. POCO, Qt, and libevent are all good approaches. Having followed Carmack a bit over the years my guess is he built something from scratch himself in C++.
- jeff_marshall 12y agoI think perhaps you've forgotten all the ways to shoot yourself in the foot... C++ may be an effective language for experienced users, but it's got quite the learning curve (beginning with how exactly DO I write a correct constructor in the presence of exceptions...). Every time I have to work on C++ code I dig out my Meyers book to make sure I'm not fucking something up. C is small enough that I don't have to perform the same ritual.
- S_A_P 12y agoI don't wan to call tha false modesty but damn when JC is using the language how "newbie" can you be?!?
- threeseed 12y agoI've seen a team of incredible developers struggle pretty hard when we first used Clojure on a project. It always takes time to learn something new. Especially the fundamentally different way of working between OO and Functional programming.
- deleted 12y ago[deleted]
- tracker1 12y agoSome people find it hard to reason in passing around lamdas and functions as arguments to other methods... I see this with people coming up to speed with JS (node in particular)... Using tools like Ramda, and node streams/pipes feels really natural to me... I think it just depends on how you see things... I always feel that deeply OO patterns usually just add complexity to things that can be much simpler.
- eru 12y agoCompared to his C++ wizardry, he probably counts as a newbie to Racket.
- paulannesley 12y agoTask-Relevant Maturity is a management term which recognizes that maturity (the scale that “newbie” is one end of) is fairly isolated to particular tasks/contexts. Somebody can excel in their comfort zone (e.g. C++ for Carmack?) but be a newbie in other areas until they gain that specific TRM.
- TheMagicHorsey 12y agoCarmack has a secret affection for Lisps I think. A while back he wrote about programming in lisp on his iPad (which is nicely suited to editing S-expressions). Anyway, Carmack has convinced me to take a look at Racket again. When I looked at it a few years back, it seemed nobody was using it.
- dogma1138 12y agoWell the only other thing i know of which is written in Racket is HN. So not sure if it's any popular today either. IMO it looks like were getting too many damn programming languages which is something I'm starting to really dislike. Too much shit flying around forcing you to pickup some niche languages for a project, and worse having fresh developers being forced to learn like a billion languages instead of mastering 1 or 2.
- kenferry 12y agoHacker News is (was?) written in Arc, no?
- jeorgun 12y agoIIRC the Arc interpreter is itself written in Racket.
- fjarlq 12y agoCorrect, HN is written in Arc, a dialect of Lisp. But, the Arc compiler is written in Racket[1], and internally outputs Racket code[2]. "mzscheme"[3] is an early version of PLT Scheme, aka Racket. [1] https://github.com/arclanguage/anarki/blob/master/ac.scm https://github.com/arclanguage/anarki/blob/master/ac.scm [2] http://arclanguage.org/item?id=14608 http://arclanguage.org/item?id=14608 [3] http://docs.racket-lang.org/mzscheme/ http://docs.racket-lang.org/mzscheme/
- andrewchambers 12y agoLearn scheme and you can handle all lisps, learn C/C++ and you can handle all the imperative languages, learn ocaml/haskell and you can handle the rest. That is 3 languages to master.
- waterlesscloud 12y agoI've been vaguely aware of Racket, but I haven't paid much attention to the details. If I'm reasonably familiar with Common Lisp, what are the main differences/advantages of Racket to pay attention to? What's the best resource (preferably online) to use to learn about Racket?
- mkozlows 12y agoRacket was PLT Scheme before they renamed it, so it's got a very academic focus, documentation focuses on the DrRacket (formerly DrScheme) IDE, and it's got a kind of old-school Lisp feel. Their documentation is great, though, so it's a good place to start: http://docs.racket-lang.org/ http://docs.racket-lang.org/
- orthecreedence 12y agoI think the main difference is that Racket is a Scheme, and Common Lisp is, well, Common Lisp. Racket has some great tooling like their IDE (Dr Racket, already mentioned). Really it comes down to the old CL vs scheme thing, which seems to boil down to "has almost everything you need already but is huge" vs "lets you build anything you need yourself and is tiny." However, I think this is less so with Racket because, while I haven't used it much, from what I know it's more of a batteries-included scheme used for Getting Shit Done (and does a good job of this). If I was going to use a scheme and I didn't have the requirement of needing to embed it, I'd probably go with Racket.
- deleted 12y ago[deleted]
- e12e 12y agoOther than what's been mentioned by others, Racket also comes with a nice way of bundeling up different languages/dialects (like typed racket for a strongly typed variant). See eg: http://docs.racket-lang.org/scribble/ http://docs.racket-lang.org/scribble/ I suppose it isn't technically such a different thing from other lisps, but like most of Racket -- it's pretty well thought out, and actually works really well. [ed: as per my other comment, see also eg: http://pkg-build.racket-lang.org/doc/sweet/index.html http://pkg-build.racket-lang.org/doc/sweet/index.html ]
- mahyarm 12y agoI wonder what kind of server it is. What is it's purpose?
- fjarlq 12y ago"multi-user VR stuff" https://twitter.com/ID_AA_Carmack/status/577889129284898816 https://twitter.com/ID_AA_Carmack/status/577889129284898816
- deleted 12y ago[deleted]
- andrewstuart 12y agoSo many brackets. Resolving mismatched brackets seems to be just about the most pointless developer activity possible.
- beeworker 12y agoI know right, I totally hate having to match Map<String, Map<String, Object>> foo = someMethod(withMethodArg1(), andTwo()); Let's all just use Forth, and implement washing machines as simply as: : WASHER WASH SPIN RINSE SPIN ;
- wyager 12y agoWhile that's a bit of an acerbic way to put it, I agree. The human brain has a very short stack depth, so we're no good at nested pattern matching. Indentation or delimiter based languages are much easier for me to parse than lisps.
- pjscott 12y agoThe usual solution is to indent your lisp code.
- lmm 12y agoWhy repeat myself? If the indentation contains the information, why can't I just use that?
- current_call 12y agoBecause then you end up with thinks like Python's one expression lambda.
- nialo 12y agoThe parens are the single point of truth, the indentation is just for display and is (almost entirely) mechanically generated.
- iopq 12y ago
- Dewie 12y agoI guess this is where the anti-FP people forget their staunch scepticism for a second because a respected imperative programmer uses an FP language? Regular functional programmers haven't been able to change their view, but I wouldn't be surprised if all it took was one tweet from the right person. Other than that, I don't see what else there is to say about this. 'Dropped some C++ for Racket server: may not scale but is more productive'. That's the most standard high-level vs. low-level dichotomy.
- AceJohnny2 12y ago> I wouldn't be surprised if all it took was one tweet from the right person. Well, the "Argument from Authority" is called out because of when it's misused (kinda how "experts are always wrong". No: those are only the times you remember), but it is a fundamental way of how social humans form opinions.
- Dewie 12y ago> , but it is a fundamental way of how social humans form opinions. Wow, that's amazing: people form opinions in part based on how much they respect/trust someone. Consider my cynical views totally and irreversibly changed. Then there are those times when it is taken too far: like 115 points on HN for a pithy message like "rewrote to another language".
- davexunit 12y agoAlways interesting to see what Carmack is up to in Lisp land. It's particularly interesting to me because he seems to have some sort of Lisp guilt. Every time he talks about it, he has to mention that he's not sure if it's useful for "serious" projects because it's not statically typed or because it might not scale.
- fizixer 12y agoI remember him (either in the QuakeCon 2013 talk, or one of his writings) mentioning that all these years he was so busy he never got a chance to have his lisp enlightenment. I think he might be having it now.
- agumonkey 12y agoAnd Tim Sweeney (Epic) went in Full FP : http://www.reddit.com/r/haskell/comments/1jj40p/john_carmack_talking_at_length_about_haskell_in/ http://www.reddit.com/r/haskell/comments/1jj40p/john_carmack...
- fitzwatermellow 12y agoHad to read that twice. Was pretty sure he meant "RakNet" the first time ;) Oh, and just gonna put this out there: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=racket&lang2=go http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
- e12e 12y agoThen again: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=racket&lang2=hipe http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan... and Erlang is certainly a valid platform for servers, so as usual benchmarks are just benchmarks... would be interesting to see if typed racked made a difference in these tests -- although I'm not sure if performance is the main focus of typed racked (as opposed to just type safety).
- igouy 12y agohttp://www.erlang.org/faq/introduction.html#idp32166576 http://www.erlang.org/faq/introduction.html#idp32166576
- glogla 12y agoIf you look at the graph, you'll see "possible mismatch - one-core program compared to multi-core program." there. And indeed, of the ten benchmarks, four of them are singlecore racket vs quadcore Go. Single core-comparison is much less dramatic, though Racket is still slower.
- igouy 12y agoWell done!
- archagon 12y agoIt's refreshing how humble Carmack always sounds in his Twitter feed. I've found that old school game programmers tend to be hardline and a bit belligerent about their code; Carmack, on the other hand, often tweets about going against his better instincts and exploring new technologies. Not a lot of sarcasm or negativity at all. If only more people had Twitter streams as pleasant and informative as his!
- rtpg 12y agoI think this has been a theme with him the past couple of years. He's gone into Haskell territory, and has recently been an extremely vocal proponent of immutable structures (coming from the man behind some pretttty fast programs, that's a nice cold shower for a lot of people), and generally higher-level thinking. I think this is a consequence of a lot of these languages getting a lot nicer tooling recently, as well as other FP ideas being pulled into newer languages.
- Zelphyr 12y agoI second this. Its something we can all take a lesson from. Unfortunately I see too FAR many programmers who model their persona's after Kanye West. I had the great fortune of meeting Steve Bourne, inventor of /bin/sh. If ever there was a guy who could accept any and all accolades it would be him. Instead he was most gracious and humble and spent all his time showing interest in our work as well as answering our questions about the invention of the shell and Unix. Speaking of; did you know he was the first alpha tester of Unix? When Ken Thompson and Dennis Richie were writing it they would hand the magnetic tapes over to Steve Bourne and have him test it.
- anothermoron 12y ago> I second this. Its something we can all take a lesson from. Unfortunately I see too FAR many programmers who model their persona's after Kanye West. Most indie dev. are like that, they don't have anything to show but act like they know everything and that everything they say is pure gold.
- 12y ago
- GrandTheftR 12y ago> John Carmack @ID_AA_Carmack 3h3 hours ago > @touristtam If I run into catastrophic perf problems, I may try rewriting in Go. he apparently has lots of fun with languages, very curious what kind of server he is writing now. He also spoke highly about Haskell before.
- touristtam 12y agoHi I did ask the following: > thoroc @touristtam 12h12 hours ago > @ID_AA_Carmack what guided your choice of Racket vs Rust and Go? > Just curious. :)
- jdeisenberg 12y agoI've always thought Racket to be a highly under-rated language.
- Johnny_Brahms 12y agoI use it for everything I write. It brings the joy back after having to maintain a Java project in my day job. Well written racket code brings so much satisfaction :)
- fasdjkjksdf 12y agoHonestly, just about anything is going to be faster, productivity-wise, than C++. When you stop having to think about how you're going to structure your inheritance and classes, you--shockingly--get things done. But more metaprogramming is not the answer. And I've used Scheme since 2002 or so. I'm implemented Scheme interpreters and compilers. But I'm no longer a cheerleader for macros and call/cc or Scheme (or Lisp, for that matter). You know what gets things done and makes things easy to maintain? Boring ass code. IF statements. FOR loops. I mostly use Perl today. It doesn't get in the way. But getting things done is not trendy. That's where we are today.
- andrewchambers 12y ago"You know what gets things done and makes things easy to maintain? Boring ass code. IF statements. FOR loops." I think you are channeling some of the Go philosophy there :).
- robmccoll 12y agoOr C philosophy perhaps?
- elmin 12y agoThe C philosophy is: an easier alternative to writing assembly.
- Dewie 12y ago"Go philosophy" apparently being an absolutist and unwavering belief in One True Way To Actually Get Stuff Done. It's surprising that a philosophy that tries to promote simplicity also manages to come across as so elitist at the same time.
- axaxs 12y agoIf there were multiple accepted styles, the code wouldn't be as boring. But it is, and to some of us, that's a good thing.
- lawnchair_larry 12y agoA random Carmack tweet is news now?
- jpgvm 12y agoCarmack is an interesting fellow, especially interesting to the types that frequent this forum. What he is doing is thus interesting to this forum though maybe as you pointed, not news worthy. But since when does everything has to be news worthy?
- hackrnews 12y agohttps://twitter.com/ID_AA_Carmack/status/553697333817659392?s=17 https://twitter.com/ID_AA_Carmack/status/553697333817659392?...
- GreaterFool 12y agoIt is not hard to write code in Racket or Clojure; what's hard is maintaining it! I've written a small Clojure project, maybe 3k loc. It was great fun. But when I go back to add small features I find it quite tricky. Bugs often sneak in.
- biesnecker 12y agoI think maintaining old software is a known problem, regardless of the language. What about lisps make them more challenging in this regard?
- bitwize 12y agoFor one, static typing is optional in Lisp -- if it's even there at all. If you want to write maintainable code and catch bugs early, that pretty much rules out dynamically typed languages.
- ayrx 12y agoAre you implying that it's impossible to write maintainable code in any dynamic language?
- GreaterFool 12y agoIn lisp you have the power to easily invent abstractions. Strip things down to a bare minimum and you can see that your code is good. And write some tests just in case. OTOH in strongly typed languages with rich type systems the actual code might be uglier and more complicated because you're constructing a proof of something. The property might be week (tests needed!) or strong (tests? what tests). Depends how far the rabbit hole you want to go. At least that's my view on this.
- kd0amg 12y agouglier and more complicated because you're constructing a proof of something It's rare for the programmer to actually produce proofs that a piece of code meets the spec given by its type[1]. Those proofs are generally produced by the type checker, possibly with occasional hints from the programmer. 1: Even in Coq, detailed specs for some code are typically given (and proven) separate from the code itself rather than in that code's own type.
- agentultra 12y agoI really love that the majority of the responses to that tweet are of the form: Why not X? Use Y! It's very illustrative to me of just how tribal we've become. As if it matters what language Carmack decides to use. I'm sure it's a boon to the Racket tribe that the others are now jealous of. To have the name recognition of John Carmack tweeting about your language! Imagine! Racket is a fine enough language and ecosystem. I'm more curious about what he's building. Is this the VR-version of Facebook?
- drzaiusapelord 12y ago>As if it matters what language Carmack decides to use. I think if we look at the history of adoption of technology, a lot of it is driven by the top 1% endorsing it. I think its a pretty big deal when high profile people endorse a technology. Social capital is as real as financial capital. Carmack has lots of social capital and it can get results. His celebrity helped launch Oculus from a weirdo company playing with 90s relics to a Serious Threat to The Status Quo and I'm sure drew in big investors and eventually Facebook's purchase of it. >It's very illustrative to me of just how tribal we've become. This is how we've always been and will forever continue to be.
- agentultra 12y ago> I think if we look at the history of adoption of technology, a lot of it is driven by the top 1% endorsing it. I suppose this might be true but it's rather hard to quantify. I don't recall ever choosing to invest in and master a language from a celebrity endorsement. Some people might have -- I can't say. But it obviously does have merit because of the responses Carmack's tweet solicited so I don't disagree. I just found that the majority of responses were of this patronizing sort. If Carmack is amongst the top 1% of programmers, as you say, and is a minor celebrity as we both know then it seems disingenuous to immediately ask him, "Why not Haskell/Erlang/Clojure/Whatever-my-favorite-X-is?" Given his previous essays on functional programming and his move to adopt C++ I think it's safe to say he knows what he's doing and picked Racket for good reasons (even if it's as simple as, "I like it."). I made the tribe observation when it became apparent to me that perhaps they were jealous that Carmack didn't pick their tribe and bring his celebrity power along to them. I find that kind of sad and funny. I'm more curious as to what he's building than what language he's using to do it with. There are interesting things to talk about wrt the system he's building and the run-time he's building it on but that seems to go over the majority of peoples' heads. Even as a newcomer to the Racket ecosystem I think Carmack will have quite a lot to teach us as he develops this system: about Racket, the language VM, system architecture, his process, etc. So when I said, "As if it matters what language Carmack decides to use," what I was implying was that he probably has reasons and it's more interesting to know what those are. He could have continued writing it in C++, Haskell, anything... it's what he does choose, as opposed to the multitude of choices he didn't make, that is interesting here in my opinion.
- rasz_pl 12y ago>May not scale, but it is winning for development even as a newbie Sounds like Python. Works great at the start, and then one day you wake up and realize you are running 50K ppl online at the same time MMO (Eve Online), your code cant take advantage of multi core CPUs = every game region (star system) starts to lag above ~500 people and there is nothing you can do about it.
- yoanizer 12y ago...* after reading some of the comments here *... I think we would be better off caring a little bit less about what language to use and a little bit more about what programs to write.