News for hackers. Stuff that matters.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by TheMagicHorsey on Tuesday March 17, 2015 @06:58PM (#9222243)
Carmack 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.

Re:John Carmack: “I just dumped the C++ server I wrote for a... by AceJohnny2 on Tuesday March 17, 2015 @09:11PM (#9222898)
> on his iPad (which is nicely suited to editing S-expressions)

How so? I'm curious.

Re:John Carmack: “I just dumped the C++ server I wrote for a... by projectileboy on Tuesday March 17, 2015 @09:17PM (#9222931)
There's a fun iPad app called Lisping that let's you play with different flavors of Lisp. Not really a programming environment, but it's sort of neat for trying out ideas.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by CodeWithCoffee on Wednesday March 18, 2015 @02:53AM (#9223996)
App Store link, for anyone that's interested: https://itunes.apple.com/gb/app/lisping/id512138518?mt=8
Re:John Carmack: “I just dumped the C++ server I wrote for a... by chadzawistowski on Tuesday March 17, 2015 @09:37PM (#9223037)
How does that get around the iOS App store restriction on interpreted code?
Re:John Carmack: “I just dumped the C++ server I wrote for a... by rsynnott on Tuesday March 17, 2015 @10:19PM (#9223199)
I assume they got around that restriction by cunningly releasing it after that restriction was abandoned in 2010...
Re:John Carmack: “I just dumped the C++ server I wrote for a... by chadzawistowski on Thursday March 19, 2015 @07:07PM (#9235184)
Ah, my inexperience with Apple's platforms is showing.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by edvinbesic on Tuesday March 17, 2015 @09:57PM (#9223117)
I belive that restriction was lifted quite a while ago, like in 2010 or something. It didn't last long as game engines required the use of scripting languages for game logic, among other things. Apple simply had to cave in.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by paines on Wednesday March 18, 2015 @05:47AM (#9224424)
Excuse my ignorance, but what about the new situation that all apps MUST use ARC. Does that interfere with lets say embedded Lisps in Apps etc...
Re:John Carmack: “I just dumped the C++ server I wrote for a... by rsynnott on Wednesday March 18, 2015 @10:01AM (#9225480)
Apple no longer allow use of Objective C garbage collection on the MacOS App Store (it was never supported on iOS). This doesn't effect third-party garbage collection and there's no requirement for third-party languages to use ARC (it wouldn't be practical for most of them, anyway, though there is an AOT-compiled Ruby that uses it).
Re:John Carmack: “I just dumped the C++ server I wrote for a... by paines on Wednesday March 18, 2015 @10:21AM (#9225626)
Thank you!
Re:John Carmack: “I just dumped the C++ server I wrote for a... by coob on Wednesday March 18, 2015 @07:40AM (#9224769)
You don't have to use ARC. You can reference count manually if you like. What you can't do is use the old garbage collection (which was only ever available on OS X).
Re:John Carmack: “I just dumped the C++ server I wrote for a... by rsynnott on Wednesday March 18, 2015 @10:00AM (#9225469)
And in fact you _can_ still use the old garbage collection if you really want to; you just won't be able to submit new apps to the OS X app store.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by fulafel on Wednesday March 18, 2015 @06:22AM (#9224515)
The restriction was reformulated to something like "you can't allow dynamic code loading over the net" or something. So as long as the app ships with the example snippets it runs and otherwise works only with user input, it should be politically correct.

Edit: reference: http://seattleclouds.com/ticketfiles/8665/ios_program_standa... 3.3.2 "An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded." So in fact the Lisp app is also forbidden (but of course Apple is free to selectively enforce)

Re:John Carmack: “I just dumped the C++ server I wrote for a... by rsynnott on Wednesday March 18, 2015 @09:59AM (#9225463)
This seems to be done on a "spirit of the agreement" basis; they're okay with the various python REPL languages even though you can do things like eval(urlopen("http://bla.com/some_python.py").read()), for instance.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by fulafel on Wednesday March 18, 2015 @10:15AM (#9225580)
Ah, I didn't even think that far, I stopped at any REPL being a violation since it's running code which was not packaged with the app.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by AceJohnny2 on Tuesday March 17, 2015 @09:55PM (#9223104)
Is that still a thing? I thought they relented?
Re:John Carmack: “I just dumped the C++ server I wrote for a... by rsynnott on Wednesday March 18, 2015 @10:03AM (#9225488)
I think it might make more sense to say that S-expressions are less of a pain to edit on touch devices than most other expressions, as people have made nice tools for them.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by speeder on Tuesday March 17, 2015 @09:08PM (#9222885)
Not really secret, there is even an article about how to try to make Functional C++ that he wrote.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by dogma1138 on Tuesday March 17, 2015 @08:31PM (#9222713)
Well 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.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by 59nadir on Wednesday March 18, 2015 @05:09AM (#9224324)
While I understand your frustration with 'too many languages', Racket is older than quite a few (started in '95). I also think the danger of having this attitude is that if we all thought like this nothing would become better. If no one wanted to get out of C++ we wouldn't have had many languages.

The premise behind Racket, in broad strokes, is to provide a platform and programming language for making new programming languages. The most important identifier/keyword in Racket is '#lang' (specified at the top of a file to tell Racket which language the file is in). It's a whole ecosystem in which a multitude of languages exist and the only thing they really need to have in common is that on some level they speak Racket.

Personally, I think the above paragraph explains how exciting Racket as a language and platform is, but it doesn't sound that interesting on the surface. It does allow people to create things like this[0] and this[1], though, which displays real practical use; shaping the way you solve the problem to fit the actual problem.

[0] http://www.youtube.com/watch?v=oSmqbnhHp1c - Naughty Dog's scripting language [1] http://pollenpub.com/ - A web book publishing language

Re:John Carmack: “I just dumped the C++ server I wrote for a... by andrewchambers on Tuesday March 17, 2015 @09:09PM (#9222887)
Learn 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.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by FreeFull on Tuesday March 17, 2015 @10:26PM (#9223224)
Until you come to Prolog, or APL/J/K and realise that none of these languages have fully prepared you either. And then there are other things out there too, that will leave you learning all over again.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by jwdunne on Wednesday March 18, 2015 @03:33AM (#9224084)
APL and friends blew my mind when I read about them. I remember thinking "You can do all that with just those characters? That's the same length as the word function"! It's a good job I read this far down, I made a mental note to learn J but, as usual, forgot it by the time I got home. Thanks!
Re:John Carmack: “I just dumped the C++ server I wrote for a... by jevgeni on Wednesday March 18, 2015 @03:32AM (#9224080)
I have this ritual every year or so, where I try to write J, sigh, and go back to pedestrian F#.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by eggy on Wednesday March 18, 2015 @05:30AM (#9224378)
I always do one-liner stuff in J, and I keep trying to get into F#. I recently bought Dyalog's APL. I thought the symbols would get in the way, but it's a whole other door opening. I really like the array-oriented languages for math and science. Even Julia and Numpy are attempts to do what the APL/J/K family have always done. I've always had Racket on my machine, before it was called Racket. Having an IDE and a good standard library right off the bat is great for beginners and dabblers like myself. I do not program for a living. I only program when I have a math or engineering problem to solve.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by jevgeni on Wednesday March 18, 2015 @12:34PM (#9226698)
Racket is amazing, I agree. :)
Re:John Carmack: “I just dumped the C++ server I wrote for a... by bjwbell on Tuesday March 17, 2015 @10:31PM (#9223240)
C/C++ is not like all imperative languages. Basic, Go, Python - those are more bog standard imperative languages. C/C++ are off in a world of their own with implementation specific behavior (compiler, arch, ...), undefined behavior & memory safety.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by andrewchambers on Tuesday March 17, 2015 @11:07PM (#9223358)
If you know C/C++, the concepts of Go and python should be easy. Especially since you understand how python itself is implemented.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by bjwbell on Wednesday March 18, 2015 @12:01AM (#9223520)
I just pity the poor person who learns C++. I pity myself for having learned it.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by danieldk on Wednesday March 18, 2015 @03:56AM (#9224155)
Why? I think following a 3/4rd year university course on C++ was one of my best investments ever.

Nearly every imperative language is a walk in the park after you know C++, and you can still write C++ for performance-intensive code (if necessary with expression templates et al.).

Re:John Carmack: “I just dumped the C++ server I wrote for a... by TeMPOraL on Wednesday March 18, 2015 @09:10AM (#9225146)
Totally agree. Also, I'm very happy I learned C++ as my first language (after little bit of dabbling in QBasic, Pascal and VB in primary school). When you're learning programming for the first time, you have no reference points. You either learn it or don't. So I learned C++, not once thinking it's difficult or complicated, and it became my reference point, making other imperative programming languages trivial to learn.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by e12e on Tuesday March 17, 2015 @09:27PM (#9222983)
You forgot Prolog, and maybe Smalltalk (although CLOS may help or hinder you in understanding message parsing/"proper" OO)... but otherwise, yeah pretty much.

[ed: and perhaps PostScript/Forth...]

Re:John Carmack: “I just dumped the C++ server I wrote for a... by andrewchambers on Tuesday March 17, 2015 @09:48PM (#9223075)
Yeah, forgot about logic programming. There are some specialist languages too, and hardware languages like VHDL.

Overall, I think the more languages that exist, the better. Some people think we should be moving towards more domain specific languages.

There is a balance between using the best tool for the job, and getting a large potential developer base.

Re:John Carmack: “I just dumped the C++ server I wrote for a... by harperlee on Wednesday March 18, 2015 @09:20AM (#9225201)
I don't get the argument. Can't I say then "learn Logo and you can handle all programming?" Because you are defining an arbitrary cutoff of functionality and detail further which there is no effort involved in "handling" new languages, based on your experience, I suppose.
Re:John Carmack: “I just dumped the C++ server I wrote for a... by serf on Tuesday March 17, 2015 @09:22PM (#9222956)
>IMO it looks like were getting too many damn programming languages which is something I'm starting to really dislike.

Are there more now? I remember a zillion niche pet languages from forever ago.

Now a days I see less, probably because it's not in-style to write an in house scripting language for every single new project, they tend to just use a language that is nice off the shelf.

Re:John Carmack: “I just dumped the C++ server I wrote for a... by kenferry on Tuesday March 17, 2015 @08:52PM (#9222809)
Hacker News is (was?) written in Arc, no?
Re:John Carmack: “I just dumped the C++ server I wrote for a... by fjarlq on Tuesday March 17, 2015 @08:56PM (#9222832)
Correct, 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

[2] http://arclanguage.org/item?id=14608

[3] http://docs.racket-lang.org/mzscheme/

Re:John Carmack: “I just dumped the C++ server I wrote for a... by jeorgun on Tuesday March 17, 2015 @08:53PM (#9222816)
IIRC the Arc interpreter is itself written in Racket.