Try Objective-C
tryobjectivec.codeschool.com
tryobjectivec.codeschool.com
Fabrice Bellard's browser-based Linux boots in less time than this prints out "Hello, world!"
https://github.com/kripken/emscripten/pull/1162/files
Still, a long way to go.
What are some of the coolest applications of emscripten?
For a recent example of emscripten, try this one from yesterday: https://news.ycombinator.com/item?id=5673356
Besides causing incorrect output, this may crash your program, or potentially be a vector for an exploit.
NSLog(untrusted); bad. NSLog("The user entered %s", untrusted); OK.
"In particular, the varargs mechanism allows functions to accept any number of arguments (e.g. printf) by "popping" as many arguments off the call stack as they wish, trusting the early arguments to indicate how many additional arguments are to be popped, and of what types."
NSLog is similar; it has to trust its first argument to be consistent with the number and types of arguments actually passed to it.
If you call NSLog(x), but do not have complete control over the value of x, you cannot guarantee that.
#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt),__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
# define DLog(...)
#endif
Put that in your [Project]-Prefix.pch file to make it available globally. Aside from letting you log without fear, it gives you better performance in production, and you can get extra context for your output.
1: http://stackoverflow.com/questions/969130/how-to-print-out-t...
You could also roll your own in a very few lines of code. Maybe even have the output of the program, not the compiled code, be the content of the hashed file, assuming you aren't reading STDIN or anything like that from the user.
Or even better, use ZFS snapshots as your sandbox. Copy on write kicks butt. See: http://vocalbit.com/article/402/freebsd-jails-using-zfs-and-...
GNUstep/GCC is possible, but you lose support for all of the above, blocks, and several other recent additions to the Objective-C language.
I'm afraid I've been scared off Obj-C for life now.
What does this have to do with the Objective-C language itself?
Nothing except they had a bad experience using the language. It's like that time you ate a bunch of meatloaf right before coming down with the flu. It wasn't the meatloaf, but you still might never eat it again...
http://rubymaverick.com/try-objectivec-book/
The content is up on my Github and any pull requests would be welcome!
Please form a single file line behind mietek ;)
For example, on the first exercise, you're asked to write NSLog(@"Name"); When I did it, I first missed the semicolon, and got an error "expected ‘;’ after expression". Okay, fine and good, that makes sense. I added the semicolon and got "‘extern’ variable has an initializer" because I called NSLOG instead of NSLog. Even for a programmer, that's not a helpful error message...
I ended up buying the Big Nerd Ranch book (it's great!) on iOS programming, which also covered Objective C in more detail.
On the 1st level, I couldn't progress unless I used 'Ishmael' as firstName and 'Moby-Dick' as lastName.
/shrug
Oh well, I'm sure there are other sites out there.
I still fail to see the appeal of learning a language with such extremely limited value (only works, has tools and adaptation on a certain lawsuit-happy gadget-vendor's OS).
Anyone? And what about principles? What about giving back to the community? Shouldn't hackers hacking away on the next big thing be using open technologies as open technologies was what enabled them to get hacking in the first place?
Open source is good, but I don't condemn software that's closed source. I use OSX and dualboot Windows, for one.
2 years of Lua work, and I absolutely cringe with the idea of having to go back to Java/Obj-C/C++, in any context other than to push a bridge across the VM gap to some framework.
Its a smaller language, its lighter. It performs quite well, and can be put almost anywhere there is a lib.so file (so: everywhere). Choose what you want to link with, extend the external API's with Lua, and leave the whole problem of obscure languages for the young 'uns..
So, its not so much about my desire to pimp Lua, but my point is this: You can choose whatever language you want, actually, to develop a core host environment with, but use a very simple, sweet language for the majority of the work.