News for hackers. Stuff that matters.
Re:JXCore LLVM JavaScript Frontend by mpweiher on Wednesday February 12, 2014 @11:52AM (#7225379)
Objective-C is a dynamic OO language and it has always been AOT compiled.

Also there's Smalltalk/X: http://www.exept.de/en/products/smalltalkx

libart for Android also brings AOT to a jitted/VMed language.

Re:JXCore LLVM JavaScript Frontend by ris on Wednesday February 12, 2014 @12:28PM (#7225693)
> Objective-C is a dynamic OO language

Objective C is not a dynamic language.

Do not confuse dynamic language with dynamic typing or whatever the standard wisdom in the Apple cult is.

Re:JXCore LLVM JavaScript Frontend by mpweiher on Wednesday February 12, 2014 @04:47PM (#7227581)
Sure is.

Supported:

Dynamic typing.

Fully dynamic message dispatch with doesNotUnderstand: (called forwardInvocation:), proxies, Higher Order Messaging, etc.

Addition of (a) classes ( objc_registerClassPair() ) and (b) methods ( class_addMethod() ) at runtime.

Changing an object's class at runtime (objc_setClass() slightly hacky, but done by system services such as KVO, so supported).

Closures/Blocks.

Reflection.

Addition of (associated) instance variables at runtime. Interpreted languages can be fully interoperable peers.

Not supported:

Eval (but see above re: interpreted peers).

Continuations.

----

See: https://developer.apple.com/library/mac/documentation/Cocoa/...

EDIT: added references.

Re:JXCore LLVM JavaScript Frontend by pjmlp on Thursday February 13, 2014 @02:48AM (#7230043)
How do you dynamically?

- add fields to a struct

- create a function

Objective-C is only dynamic typed in the OO runtime, everything else is static typed.

Dynamic languages are 100% dynamic, unless the CS classification got changed in the last years.

Re:JXCore LLVM JavaScript Frontend by mpweiher on Thursday February 13, 2014 @03:38AM (#7230163)
That's just silly.

By that definition, Smalltalk is not a dynamic language: you cannot change the definition of assignment ( := ), message return ( ^ ) or the messenger itself. You also cannot change the the way the GC works.

Re:JXCore LLVM JavaScript Frontend by pjmlp on Thursday February 13, 2014 @06:56AM (#7230821)
> That's just silly.

No it is not. I can do that in fully dynamic languages like TCL and Python, for example.

Re:JXCore LLVM JavaScript Frontend by ris on Wednesday February 12, 2014 @05:48PM (#7227935)
> Addition of (a) classes (b) methods at runtime.

This is news to me.

Re:JXCore LLVM JavaScript Frontend by mpweiher on Wednesday February 12, 2014 @05:58PM (#7227992)
Always glad to help you learn new stuff :-)
Re:JXCore LLVM JavaScript Frontend by Alphasite_ on Wednesday February 12, 2014 @01:04PM (#7226036)
I'd certainly say that it is, it certainly meets the dynamic binding pre requisite. And small talk certainly does, so why does Objective-C not qualify?
Re:JXCore LLVM JavaScript Frontend by pjmlp on Wednesday February 12, 2014 @01:18PM (#7226140)
Because of the C subset.
Re:JXCore LLVM JavaScript Frontend by strmpnk on Wednesday February 12, 2014 @01:41PM (#7226314)
Many languages have static subsets. For example, many languages won't let you change the meaning of `1+1` while others might allow you to dispatch the addition dynamically.
Re:JXCore LLVM JavaScript Frontend by KMag on Wednesday February 12, 2014 @07:49PM (#7228598)
In fact, a static subset is a very nice property to have in a dynamic language. It's probably the easiest way to make a dynamic language self-hosting. For instance, PyPy uses a static subset of Python called RPython and Squeak uses a subset of Smalltalk called Slang.
Re:JXCore LLVM JavaScript Frontend by pjmlp on Wednesday February 12, 2014 @12:08PM (#7225517)
You forgot Lisp, Scheme, Dylan, Julia, Basic.
Re:JXCore LLVM JavaScript Frontend by rayiner on Wednesday February 12, 2014 @12:56PM (#7225971)
Julia isn't AOT compiled. Indeed, one of the things that makes it so fast is that it does JIT compilation of method bodies using runtime information to drive type inference and to produce multiple type-specialized copies of methods.
Re:JXCore LLVM JavaScript Frontend by pjmlp on Wednesday February 12, 2014 @01:03PM (#7226029)
Silly me, you are right. I forgot about it.
Re:JXCore LLVM JavaScript Frontend by AlexanderDhoore on Wednesday February 12, 2014 @12:14PM (#7225565)
Funny enough, even C#: http://www.mono-project.com/AOT

This is used to run C# on iOS.

Re:JXCore LLVM JavaScript Frontend by pjmlp on Wednesday February 12, 2014 @12:58PM (#7225989)
C# is not a dynamic language.
Re:JXCore LLVM JavaScript Frontend by Skinney on Wednesday February 12, 2014 @02:14PM (#7226555)
Not by default no, but it easily supports dynamic code through 'dynamic'
Re:JXCore LLVM JavaScript Frontend by pjmlp on Wednesday February 12, 2014 @02:44PM (#7226778)
The use of dynamic keyword and interface, doesn't make it dynamic from CS semantic analysis point of view.
Re:JXCore LLVM JavaScript Frontend by Skinney on Thursday February 13, 2014 @05:22PM (#7234914)
C# allows generating and re-writing code at runtime. Couple that with reflection, bypassing private/protected modifiers etc. Does that make it dynamic? Genuinly interested, what defines a dynamic language?
Re:JXCore LLVM JavaScript Frontend by danabramov on Wednesday February 12, 2014 @12:33PM (#7225757)
Still does.
Re:JXCore LLVM JavaScript Frontend by lohan on Wednesday February 12, 2014 @12:48PM (#7225904)
+1