131 points · by basil · 14y ago · 107 comments
But it's only a half step. If you look at what's happened to the other two languages mentioned above, they have evolved such that their runtimes are now more important than the languages they originally hosted.
What really needs to happen to Obj-C is for people to wake up and realize that the runtime is actually really nice. Combined with LLVM, one could make the case that the Obj-C runtime could compete with the JVM or the CLR.
(Of course, the one huge, massive, glaring omission is any sort of managed memory... Well, at least there was a garbage collector at one point.)
I like Java for its low-cost allocations, sane implementation of constructors, and checked exceptions that prevent undeclared control flow behavior. The huge trove of solid-quality libraries and a general community focus on unit testing and documentation (perhaps in no small part driven by Apache) has been quite valuable.
I like C# for its type inference, relational algebra ala LINQ, reactive extensions, adoption of F#, and a general R&D focus on adopting language design from the functional languages.
I like Obj-C for the ease of which I can drop to C and assembly, and the ease-of-implementation inherent in Apple's GUI frameworks. That's about it -- there's a lot to dislike about ObjC.
All that aside, and given my own significant familiarity with the underlying runtimes, I'm trying to understand what you think is so advantageous about Apple's ObjC runtime. It is effectively an extremely simple dynamic dispatch runtime, reliant on the OS memory management combined with reference counting, zero support for any complex runtime state inspection (say, to support breaking reference cycles), and now with some C-derived glue for closures and compiler-emitable calls to support somewhat-automatic reference counting. The class registration system has hardly changed in 20 years, has no support for namespaces, the type encodings available at runtime are complex-to-decode-strings, and the whole thing is, quite honestly, the kind of rickety design you'd expect to emerge from C hackers in the late 80s early 90s, incorporating none of the advances in the field from either Sun/Java or Microsoft/C#.
ObjC predates the work on Strongtalk that led to the modern JVM, it either predates or fails to inherit from the language R&D outside of C, and predates the CLR runtime work done by Microsoft. It's a DINOSAUR.
I don't really understand where you see the runtime advantage here, and I spend nearly all of my time writing ObjC.
The only advantage I see to the ObjC runtime is that it's required to interface with their native libraries.
> It is effectively an extremely simple dynamic dispatch runtime
Yup! Just the way I like it. It's practically lisp-like in its minimalism. Just the minimum you'd need to get the job done.
> reliant on the OS memory management
This, actually, is one of my favorite points. Letting the JVM grab a giant allocation at startup is fine if all you're going to do with your machine is run JVM programs (i.e. a server), but it sucks when you've got multiple apps all trying to play nice together. The OS has a memory management system for a reason. I'd much prefer my runtime use the existing system, than re-invent the wheel (as it were).
> with reference counting
Right, well...I did mention that the lack of a GC kinda sucks. I suppose it's a trade-off that one must make if you are going to rely on the OS to manage memory. Still, I can't help but feel that some sort of opt-in system could be made to work at runtime.
> zero support for any complex runtime state inspection (say, to support breaking reference cycles)
Of course, the flip-side to this is that runtime performance is more predictable, since the runtime isn't attempting to do anything overly complex. I can see how you might argue this either way: more runtime introspection eases the burden on language implementors, but it also is a sunk cost whether you want it or not.
> The class registration system has hardly changed in 20 years
"It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away"
> has no support for namespaces
I'm not completely convinced this is a problem domain that I want my runtime solving for me. The addition of two-level namespacing to Mach-O addresses the only time I can think that I definitely want runtime managed namespacing. If I want namespacing to be part of my object model, let me determine how it should work. (It's always mildly annoyed me that Java's reverse-DNS-style bleeds into almost every JVM-based language.)
> the type encodings available at runtime are complex-to-decode-strings
The type encodings are simple C strings!
> the whole thing is, quite honestly, the kind of rickety design you'd expect to emerge from C hackers in the late 80s early 90s
If by that you mean that the central message dispatch routine is hand-optimized assembly for each platform the runtime is available on... I'll have some more of that, please!
Edit: Oh, and about the "like" part...I was being mildly facetious. There are aspects of all 3 languages that I enjoy, but I doubt they'd have become as popular as they have on their merits alone. (Well, ok, given the landscape at the time, Java's popularity could be said to be fairly won...)
So why not go the extra yard and make it properly homoiconic and reap all the benefits of such a rigid, simplistic syntax? The current syntax is the worst of both worlds - painful to read but disallowing macros.
I don't want Apple to turn Obj-C into Perl but Obj-C is badly in need of a little syntactic sugar. Thankfully some of this is coming in the new collection literals and operator overloads.
The OS memory management system is as general-purpose as possible. At the kernel/process interaction level, the APIs are thin abstractions on the underlying VM page mapping system. Below that, at the malloc level, malloc is designed to be as general purpose allocator as possible, without introducing complexity unsupportable in C, such as migrating allocations across generations.
The JVM's lack of ability to rededicate pages to the OS is a failing of Sun's particular implementation, and is not strictly inherent in the design of generational collectors.
Your argument dismantles Sun's architectural choice when used on mobile hardware, but does not address the relative merits of alternative allocation/collection schemes.
> In regards to the class registration system: "It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away"
That response has little substance. It's not perfect, or even great, it's merely functional. I would be enthralled if Mach-O two-level namespacing worked with ObjC classes, but it can not.
> The type encodings are simple C strings!
They're C strings, not particularly simple. Try decoding (with lackluster documentation) a complex structure return value. Modern runtimes use much more cleanly structured, cross-referenced data here.
> If by that you mean that the central message dispatch routine is hand-optimized assembly for each platform the runtime is available on... I'll have some more of that, please!
No, that's not what I mean. You'd find just as much complex hand-optimized assembly code in other runtimes, likely more.
I'm referring to design choices such as the use of unnecessarily complex data structures with minimal if not outright missing API to access them, poorly abstracted implementation details (such as exposing C string type signatures as the highest-level representation of a type encoding), minimal/missing/poorly-defined metadata.
An example is the failure to encode type data in blockrefs in the first public release of blocks for ObjC, which made it impossible to implement imp_implementationWithBlock(), due to the need to differentiation between stret vs non-stret return types and select the appropriate trampoline. This required changes to both the compiler and the runtime, and meant that prior to those changes' introduction by Apple, it would have been impossible for an external entity to implement similar functionality.
This sort of hackish minimalism is the polar opposite of the careful considered and long-term focused design that Microsoft (and even Sun) applied to the core of their platform. Compare the completeness (and longevity) of the JVM Virtual Machine specification to the ObjC runtime. Over roughly the same amount of time, Apple has had to introduce complete ABI-breaking fundamental changes of to their runtime to implement extremely basic language enhancements. In contract, the JVM specification has not, to my recollection, been broken once over the course of 20 years. Additions have always been forward-compatible.
An example of the above would be the addition of non-fragile base classes through the use of minimal ivar access indirection. This required a wholesale breakage of the entire language, and thus could only be introduced on 64-bit Mac OS X and on iOS.
Apple's language and runtime design is hackish at best.
There is a school of thought that says simplicity is a feature. That C++ is an example of "language gone wrong". That the C hackers in the 80s and 90s had the right idea.
It is not reasonable to compare Java and ObjC because in spite of the marketing material, they have very different performance characteristics. For the most part, garbage collectors are not efficient enough to be comfortably used on 5w computers. If you need a non-GC native-performance language, your choice is C++, C, or ObjC. Clearly you're in the "Features are good, use C++" camp, but the people who are not in that camp are also in pretty good company.
It appears that since you didn't understand my criticism, you decided to substitute your own strawman that you could respond to. Your reference to C++ -- and my assumed preference for it -- is an odd choice, given that I did not actually mention the language.
I think C++ is broken for reasons of poor language design. Simplicity is good in both implementation of a language and the use of it, the balance of that is complex and warrants significant consideration.
I will provide an alternative summary, since I think "The ObjC runtime is insufficiently complicated." is both loaded, and incorrect:
The ObjC runtime is poorly architected, shows its age, and is not sufficiently well designed to permit the implementation of features that would grossly simplify the use of the language.
In support of this I mentioned a number of features that simply are non-implementable on the current runtime, including automatic handling of reference cycles. Your contrary (and unsupported) assertion is that GC is "for the most part" not efficient enough for use on 5W computer. Somebody should tell Microsoft and the MonoTouch guys. Even Android's GC is usable, and it's an fairly primitive mark-and-sweep collector.
There's even some support for rudimentary stack inspection, but that's more limited.
Yes, it's a dinosaur, but a mighty cool one :-)
There's no safe way to walk the object graph to break reference cycles, despite Apple implementing both ivar indirection (to solve the fragile base class problem), and implementing what should be self-describable block structures.
Information such as whether a particular captured variable/ivar is a weak or strong reference would have been very simple and cheap to include in the runtime metadata, but was -- like many other things -- not included.
In another comment in this thread I described the difference between Apple's runtime/language design and everyone else's:
This sort of hackish minimalism is the polar opposite of the careful considered and long-term focused design that Microsoft (and even Sun) applied to the core of their platform. Compare the completeness (and longevity) of the JVM Virtual Machine specification to the ObjC runtime. Over roughly the same amount of time, Apple has had to introduce complete ABI-breaking fundamental changes of to their runtime to implement extremely basic language enhancements. In contract, the JVM specification has not, to my recollection, been broken once over the course of 20 years. Additions have always been forward-compatible.
Not accurate in my case. I tried Objective-C because I was told to by Apple. In fact, as a Smalltalker of 15 years, I found the addition of the header files and everything from C and the square brackets quite distasteful at first.
I now find that Objective-C is a powerful and elegant language on its own merits.
If eero is to Objective-C as Coffeescript is to Javascript, then I suspect I'm going to love eero.
I liked Java because it had a fairly large catalog of reusable libraries, and was decently easy to deploy back when I used it.
I loved C# because the language is really beautiful and fairly robust.
What makes you assume people can't pick tools by themselves?
On your second point, I think people (see http://rubymotion.com/) already realize that the runtime is really nice!
Oh, and did I mention that I'm on the MacRuby core team? ;-)
So I think it's more a matter of "personal sphere".
Note that I don't use it anymore at all personally either.
Thanks for your work on MacRuby! Did I mention I love Ruby? ;-) (really - all of my apps are Ruby/CoffeeScript based).
Same exact thing happened with Ruby, and the herd followed. Is their any doubt?
These are both hybrids of GC and reference counting that combine the strengths of both.
Basically, new objects tend to die quickly, so the overhead of reference counting is generally redundant, and GC techniques like copying collectors tend to excel. Old objects tend to stick around, so reference counting overhead is low. By using a hybrid of both techniques where they are strong, you avoid a lot of overhead: pointless ref-count changing, and pointless scanning of object graphs. The result is something with the high throughput of generational GC with only a fraction of the maximum pause time.
Oh, and thanks for the links!
F-Script is a nice language in the Smalltalk tradition built on the Objective-C runtime. If I was going to pursue something like this, I would probably work at making a clang-like front end for it.
1) Object-Oriented Programming: An Evolutionary Approach http://www.amazon.com/Object-Oriented-Programming-An-Evoluti...
The runtime really is great, and the fact that it is, essentially, the "C" runtime (~= native platform ABI) + one additional function (objc_msgSend()) is wonderfully minimal, and that this is all you really need to have a highly dynamic object oriented language is something even academia is only slowly figuring out.
What I particularly don't like are the tailing return types.
I also assume apple is actively working to reducing the Obj-C verbosity to some extend.
Regarding the website, I miss a "get started" link. How do I take it for a quick test-drive?
EDIT: It sais: "Eero is a fully binary- and header-compatible dialect of Objective-C". Does this mean, I can write a module in Eero and have it derive the correct header files for me? Or do I need to re-write the header file to be consumed by (legacy) Obj-C?
auto foo(int x) -> bool;http://www.cprogramming.com/c++11/c++11-auto-decltype-return... provides a rationale: so you don't have to type in ClassName:: twice. Is that really worth this monstrosity? The function name is still not at the start of the statement. '->' is being horribly misused. Anybody know if there's a better reason for this? Did the committee really have nothing better to think about?
The ugliness of ObjC has little to do with brackets and semicolons, and a lot to do with the lack of higher-level functional constructs and type-system features.
A language that was ObjC-compatible and yet could succinctly express LINQ/Rx-level type/api complexity would be a genuinely interesting successor to ObjC.
Syntax aside, however, the emergence of ObjC-compatible languages is contributing to the pool of knowledge on how to produce one, provides a set of possibly re-usable code to do so.
[edit] Dug into the code. It looks like the author is actually forking clang outright. This is an interesting approach, as it allows you to swap in a new compiler that supports both your language, and objc, possibly interchangeably.
The way that clang is designed (and as I understand it, I haven't looked in great detail), it's pretty much impossible to use it as a library to backend your own front-end parser/lexer atop -- you have to fork clang itself to inject your own code in.
I'm undecided as to whether tying yourself to clang (instead of the underlying llvm) is a net win for an alternative language implementation. Thoughts?
Given that the languages come from the same lineage, it is not even a big jump to switch between them from a developer's point of view. The thing that really stood out when I was learning Objective-C is that it essentially was Ruby, just with some C thrown in. I often wonder if people go in thinking Obj-C is some kind of worse version of C++ and then miss what the language really has to offer. While it is certainly not perfect, I'm constantly amazed at how elegant the design of the language really is.
Ruby could shine if Apple were to create a whole new set of APIs based around the language, but that would mean throwing away nearly 25 years or work. It would be a tremendous undertaking for what could be positive gain, but is just as likely to introduce a whole new world of problems, especially in the early years.
Official support for Ruby would certainly be welcome, but I don't see benefits in outright switching; not without also removing the Objective-C APIs from the equation and creating a whole new platform that centres around Ruby.
But it ain't going to happen. They need the drop down to C without the run around.
I would also be very curious how well eero adapts to pure C code. Many of Apple's performance-critical APIs are C, as our many third party libraries. So being able to effortless invoke C within Objective-C is essential.
eero's design seems to neglect this. For one, goto is outright banned, eliminating a rather effective tool for elegant C based error handling. (http://stackoverflow.com/questions/788903/valid-use-of-goto-..., but please let's avoid a long tangent on the proper use of goto)
Update: My mistake, the brackets apparently define an argument as optional, which might be a convenient shortcut in some cases.
I admit, the one time I paused was when I saw the trailing return types. It was the only part that felt unintuitive.
By mere convention it felt odd, but I'm willing to explore a break with convention. Seeing how well-designed the other 95% of the syntax is, I'm giving the architect the benefit of the doubt, and hoping that this trailing return syntax ultimately proves MORE intuitive, despite my initial recoil.
I'm really curious now about the practical issues of putting Eero into real-world use (which, since we're talking obj-c here, means OSX or iOS development).
http://joris.kluivers.nl/blog/2012/03/13/new-objectivec-lite...
The language may be decades old, but clearly Apple is continuing to advance the compiler to improve the language's syntax and verbosity without breaking the runtime.
Why do you assume that Apple isn't working on his language? They are heavily developing it!
- It's compiled, not interpreted. Even Java and C# are compiled into bytecode for a massive VM to interpret. Objective-C has no VM, it's pure binary + a shared library to implement the runtime. It also uses the very best compiler, clang, which gives incredibly helpful error messages, warnings and suggestions.
- It's a strict superset of C. Even C++ does not meet this criteria. This means any valid C is valid Obj-C and behaves exactly the same way, in any Obj-C file. You can drop down levels of abstraction for performance, and can even write assembly if that's what it takes.
- It has an amazing and fully supported debugger in the form of LLDB.
- It's fully dynamic, allows introspection, duck typing and even monkey patching (with a little effort; method swizzling). Everything is an object, except for native C types.
- It takes the right approach to memory management. Realizes that garbage collectors are abominations, and that managing memory is really the job of either the developer or the compiler.
- It has the most fantastic concurrency framework I've ever used, in the form of `libdispatch`. Now, to be fair, it's a C library that ought to work anywhere, but practically it only works well on Apple's platforms and using clang.
- Apple is moving in the right direction, cleaning up the language, removing annoyances and making syntax more succinct.
- Header files. I think I'm on my own in liking this—but I think headers are amazing. They're a succinct and standalone version of a documentation file that is extremely useful to both developers and the compiler. Use them to describe well the public interface to your class, and you don't even really have to write documentation anymore.
- Solid design patterns and convention-driven. These are getting better by the day, with the recent addition of closures to the language.
There's two major annoyances:
- It's often needlessly verbose. Not in the syntax, mind you, which is just fine, but in the naming conventions. For example, `NSArray` has a method called `enumerateObjectsUsingBlock:` instead of simply `each:`. Add that up to every single name, and you get pretty ugly code—and good luck writing it with anything other than Xcode's context-aware autocompletion.
- It's tied to Apple's platforms, and well not run on anything else. Now, I'm fine with Apple-specific frameworks and GUI frameworks (like QuickTime or UIKit) being Apple-only, but I'd really love to use the language to write a backend service, for which I'd only need Foundation & libdispatch, for example.
If we inspect your point about compilation vs interpretation, we ought to note that this is a technical decision, not an implementation constraint. Mono compiles C#/F# into native code when targeting iOS.
If we look at lldb, I think your assessment is overly generous. lldb is a new, buggy, but promising debugger. Most languages -- including C#, Java, Haskell, OCaml -- have a standard and viable debugger, and this does not particularly set Objective-C apart.
As for libdispatch, it simply a closure-based thread-pool executor / IO framework, like you'd find in any other language. It's better than pthreads and serves as a nice interface on top of kqueue, but it's certainly not so novel as to be the "best concurrency framework ever".
For example, compare against Microsoft's Reactive Extensions; Rx allows one to implement concurrency declaratively, rather than imperatively with chained closures as is done in with libdispatch.
http://rxwiki.wikidot.com/101samples#toc3
Lastly, I wish to address header files. Everything in a header file could be derived automatically from the original code. This is done on almost every other modern language platform, and there's no reason it shouldn't be done here.
Furthermore, headers do not elide the need for documentation; Objective-C type system is not nearly expressive enough to fully articulate the constraints and invariants of an API, and undocumented APIs are inescapably and destructively ambiguous APIs.
Apple even sets a good example here by providing complete documentation for every supported API in the system.
The Objective-C calls are not really compiled. They are dynamically dispatched at runtime in a very equivalent manner to an interpreter or via reflection in Java. You can read about it here:
http://www.mulle-kybernetik.com/artikel/Optimization/opti-3....
Quite far from the compiled C calls also covered in the linked article.
C code in an Obj-C method is compiled to the exact same machine code as it would be, were it in a C function. Constructs such as ifs, loops, return statements etc are no different than their C counterparts, are are just as fast. Obj-C method calls are simply compiled into calls to the ultra-fast runtime C function `objc_msgsend`.
Java execution is split into two pieces. First is the interpeter, which is used to execute bytecode prior to it being compiled. The second is the compiler, which implements runtime optimized compilation of hotspots into native machine code, including the ability to make assumptions regarding types and then uncompile hotspots if those assumptions prove false.
Before you say "ah ha, an interpeter!", it's also notable that the JVM's interpreter is not an interpeter in the traditional sense (ala Ruby). Rather, the JVM's interpreter is an architecture-specific interpreter that decodes JVM bytecode and spits out unoptimized direct machine code based on a standard set of machine code templates. This is fast, but there's not optimized compiler, and so it's not nearly as fast as the result of the optimizing compiler that is run over the hotspots.
All that said, JIT vs AOT is a technical decision with mixed advantages. In theory, there are optimizations that can only be performed via JIT, based on runtime analysis. The simplicity of AOT can often provide runtime performance gains simply by avoiding the runtime costs of evaluation and compilation. JIT of bytecode allows for binary/library portability across different machines without worrying about rebuilding or shipping multiple binaries. AOT is somewhat more difficult to decompile compared to unoptimized byte code.
Mono compiles down AOT for iOS, in theory you could do the same with Java. GCC did so with their optimizing AOT gcj Java compiler.
I can't agree with this at all. Most objects show up as opaque with no members. You can't even browse the contents of collection classes. Compared to a managed language debugger it's positively stone age.
Something I found today: "p/x $rip" will show you the PC, but "break set -a $rip" won't set a breakpoint there, because lldb can't figure out what $rip means.
The online help is also not very helpful.
Please elaborate why Objective-C's approach to memory management is Right, and why GC is Wrong.
Additionally, and importantly, without manual memory management, you cannot safely use pointers and memory directly. The whole idea of playing with memory directly by doing `void buffer = malloc(100)`, and being able to do pointer arithmetic such as `(buffer + 99) = NULL` goes out of the window.
Lastly, Automatic Reference Counting is awesome in that it brings you all the benefits of manual memory management (not having to worry about making mistakes, and saving yourself a little typing) without any of the drawbacks.
There are advantages and drawbacks to GC vs reference counting (whether manual or automated), but the disadvantages of GC certainly do not include doing "barely acceptable job of managing memory, and often lead to hard-to-diagnose bugs." I'd provide a more complete rebuttal, but lacking any specific examples, I can only definitively state that GC significantly reduces the likelihood of having to debug memory related issues, especially tracking down leaks due to reference cycles.
In comparison to GC, the main advantage of reference counting systems is that they are deterministic.
However, they do a lot of book-keeping that is expensive in aggregate and may not even be necessary in a garbage collected system. There are GC designs that mix GC and reference counting to achieve the best of both -- another poster in this thread provided a link to some papers on the subject.
The major downside to reference counting -- other than the expensive-in-aggregate book keeping mentioned above -- is, as mentioned above, that they can't handle reference cycles.
On iOS it's terrible easy to create cycles, and prior to the introduction of __weak, it was almost impossible to build thread-safe code that also involved a cyclic reference, due to it being impossible to invalid another thread's reference to your object (short of hacking out your own zeroing weak reference implementation, which is what people were forced to do).
This ease of creating cycles, especially with blocks and GCD, leads to a proliferation of careful and manual application of __weak designators on self-references. Instead of simply using an instance variable from a block, you must be certain to only access it through a __weak-marked references.
Additionally, you now have to worry about NULL-dereferencing! Example:
__weak MyObject *weakself = self;
_block = ^{
// Whoops! weakself could be nil here. Should have used a property,
// which would have just passed a nil argument to runWithTX. Whoops!
[opManager runWithTX: weakself->_txid];
// Also, weakself could be deallocated *after* the above call succeeds,
// so what we really needed to do as a first step in the block was
// capture a -strong- reference to weakself, and return immediately
// if we'd been deallocated
MyObject *strongSelf = self;
if (self == nil)
return;
// Whoops, accidentally referenced self via _txid below,
// causing a retain cycle
NSLog(@"Running with _txid=%@", _txid);
});
This is awful. If the language used a hybrid ARC refcounting with cycle breaking, that code would simply read: _block = ^{
[opManager runWithTX: _txid];
NSLog(@"Running with _txid=%@", _txid);
});Pointer arithmetic specifically, or direct memory access more generally, is bug prone and dangerous. Its valuable primarily in terms of performance, and is a terrible idea in terms of correctness and security.
In runtime-managed languages, efficient access to memory buffers is achieved by exposing an array type, and then performing basic bounds checking on array access. This is efficient enough for most purposes, is essentially what you achieve by using NSData, and is generally implemented in a way that is vastly more efficient than NSData.
Direct memory access in straight C will be faster, but it's also enormously error prone, and something I avoid if at all possible when writing ObjC or even straight C.
While there's no discounting the performance value of being able to operate at this level (or write straight assembly), it's rarely a useful thing to do when writing most application-level code, especially when weighed against the propensity for failure.
All managed languages allow for extension through C for the cases where low-level performance is required. ObjC has the easiest means of working with C, but that should be balanced against the fact nearly all of ObjC's ugly warts and pain points derive from being a strict C superset.
Without unsafe memory management, you can still do pointer arithmetic. See Cyclone's fat pointers, Go's slices, Rust's slices, etc.
For Java you have interpreters, JIT and native compilers.
C# is always compiled (either JIT or AOT), and both Mono and Microsoft Research have native compilers available for CLR free binary distributions.
One nit: the language is actually not tied to the Apple platform (although Apple bought the name at one time and is definitely the biggest user). There are actually several runtime/compiler/Foundation combos, most prominent of which are GNUStep and Cocotron. I have used both and run my (non GUI) code on Windows, Linux, Solaris, heck even AIX.
"It's missing too many useful libraries to be useful."
libdispatch can be lived without or worked around. What else in your list is missing?
Only stone age languages insist in using header files.
i.e. More suited to some kind of read-only overview browser than just another finicky text file.
Something similar could be done with Objective-C, judging by the output of the `class-dump' tool (see http://www.codethecode.com/projects/class-dump/). If you run it on an app's private frameworks - I hear that Xcode 4 might demonstrate the principle - you'll get back a surprisingly complete set of interface, method and ivar declarations. This suggests that if the will were there, we could do away with header files, even for libraries shipped as compiled objects. It works well for the CLR.
If you haven't already - I highly recommend following the link. RubyMotion was somewhat interesting, but really didn't feel like a massive improvement over plain old objective-c, especially once you factor in all the Cocoa APIs.
However, Eero looks amazing. The syntax used represents a vast improvement over straight objective-c or RubyMotion. Take a look - it's genuinely exciting.
The Cocoa/Cocoa Touch APIs are probably the best I have ever used. Rarely do I have to dive into the documentation thanks to the self documenting method names. The consistently and logically applied conventions (paired with autocomplete) mean I can usually use intuition to "feel" my way around. If ever I need to read the documentation, it is also some of the best around.
- Local type inferencing (i := 100) is identical.
- No parentheses for control structures.
- Lack of semicolons.
- Ranges in array enumeration (albeit with different syntax).
http://eerolanguage.org/documentation/index.html#noshadowing
helper := FileHelper new. "declare variable 'helper' via type inference"
files := [] "empty array literal implies mutable"
files addObject: (helper openFile: 'readme.txt'). "can group message in parens"
files do: [ | FileHandle handle | "all objects are pointers, so no '*' needed"
self log: 'File descriptor is %@', (Number)(handle fileDescriptor) ).
self handle: closeFile ].
^ 0
Of course, you'd still have to solve the lack of syntax for defining classes and methods, but there are a couple solutions to that problem out there already.But the old man in me says it'll never stick.
Oh god, please no.
I was initially thinking "another overly syntactic language", and then I went to the website and thought "Wow! This looks very nice!".