NativeScript – Cross-platform framework for building native mobile applications
blogs.telerik.com
blogs.telerik.com
This project exposes the native platform APIs to a JavaScript VM running on the device. It does not try to build cross-platform widgets as far as I can tell. This is generally a good idea.
It's much better than WebView and friends because the DOM will always be slow and not have native-feeling interactions unless W3C decides to break backwards compatibility (they won't).
It's also much better than trying to do a "write-once-run-anywhere" cross-platform widget library because those solutions never feel like the target platform either (see Swing vs SWT)
This approach lets you teach your team one language and one set of idioms and then implement across different platforms. While I have some beefs with the details of the implementation it appears to me to be a winning strategy.
BTW: I don't work for Telerik and know nothing about them.
It's a nice idea, and works pretty well. But instead of the idea of JavaScript-as-assembly, I'd like to see a standard bytecode, integrated into the browser as well as JS, designed for apps as well as/rather than document tweaking, with better control over the memory model, data manipulation, and thus performance. We could still run JavaScript, and even crazy C++-emscripten-asm.js stuff on top of that bytecode, but it would enable much faster (startup and runtime) and more power-efficient apps with a much simpler stack.
asm.js is a really clever play to leverage Javascript to get JS out of the way, while never making it obvious that's what it's doing.
What? You're stuck dealing with ints and a heap of memory... which is exactly what you get when developing native code. On top of that, you can implement any memory model and type system you want.
Are you saying you want a managed VM, so something further away from the processor? What features do you want, and which tradeoffs would it make? Why can't you just implement your managed VM on top of asm.js?
PS: no transpilation and other 3+ step "compilation" offers.
Stack machines tend to have small bytecode and it's relatively easy to write a small low-performance stack machine interpreter. Register machine bytecodes tend to take up more space, but it tends to be easier to write high performance interpreters and reasonable JITs. If you're always going to generate machine code, an SSA format minimizes the work/time necessary for a JIT to generate high-performing machine code, but it's difficult to write a high performance non-JITing interpreter for SSA-based bytecodes.
SpiderMonkey, Java, CPython, Forth, and SmallTalk (blue book) all use stack-based bytecodes. LuaJIT, Android's Dalvik, Squirelfish, and Parrot use register-based bytecodes. Michael Franz's SafeTSA (alternative JVM bytecode) and LLVM bitcode are compactly serialized SSA representations.
Microsoft has done some research on using arithmetically compressed syntax trees as an alternative JavaScript format. Part of me feels this is the best approach, as it speeds up transmission and parsing that all JavaScript engines have to do anyway, without performing transformations that JITs spend a fair amount of effort undoing later.
Ideally, I'd like to see a compressed SSA format, with optional debugging symbols and optional decompiling hints, analogous to WavPack's hybrid lossless audio format. The format could be losslessly expanded back into the original JavaScript source, or it could be stripped down to something like a binary with debugging symbols, or it could be further stripped down to just the data necessary to generate fast machine code.
The Mill CPU is interesting here, in that it's a belt machine, so SSA is very close to what its native machine/assembly looks like. It basically takes what is currently register renaming and drops the layer of ISA registers, and just refers to the results of previous instructions relative to the current one. That sort of architecture would be almost trivial to JIT SSA for- you wouldn't even need register allocation, just instruction scheduling.
Another consideration to go along with decompiling hints, debug symbols, etc. is that web pages are very transparent and manipulable with the browser's inspector and JS console. Any new bytecode would ideally keep the ability to poke around the app's data and interface- it's a very nice REPL-type tool.
Though -- they're of course tackling a problem that gets harder the deeper you get into it, and has already been tried a few times, never with really great success.
Java's AWT made a "lowest common denominator" kind of cross-platform UI back in the last 90s, and was fairly universally disliked (so Sun made Swing after that, which switched from "native components" to "over-engineered fake native components").
I hope the people building cross-platform UI for mobile devices now have studied the lessons to be learned from previous attempts -- mainly, I suspect, that getting something that kind-of works is exciting and fairly easy, but getting the detail right is grueling, thankless work, and ultimately impossible.
It might be wise for them to start with the hardest, least-cross-platform-appropriate bits, and see in advance what compromises those will force.
The Android Spinner is an example: http://developer.android.com/design/building-blocks/spinners...
There is no alternative in iOS, but if you don't use it in your Android app you are missing out, because people on that platform expect it and know it.
What about Back buttons in iOS? You don't need them in Android. If you are developing a cross-platform UI without using these elements, you are probably compromising the UX of your app.
I am very interested in how those problems are solved. Will try and play around with it.
Say, for an app like Timely [1] which I'm a fan of, I would think the data models for timers and alarms are trivial, and the code for all the subtle animations is where all the meat is.
[1] https://play.google.com/store/apps/details?id=ch.bitspin.tim...
I looked quickly through the article and the NativeScript web site, but couldn't find any. All I saw was rather useless marketing imagery.
https://itunes.apple.com/us/app/nativescript/id882561588?mt=...
https://play.google.com/store/apps/details?id=com.telerik.Na...
I’m very, very curious to try it.
Been there, done that, bought the t-shirt.
I would love to be proven wrong though! ;)
These things are almost constantly breaking so good luck to the team working on this, its a hell of a problem to bite off.
https://play.google.com/store/apps/details?id=com.telerik.Na...
Also curious if you will be encouraging/hosting a components store similar to http://components.xamarin.com/?
At least they're not breaking the back button, but they are breaking all the keyboard scrolling buttons, such as PgUp/PgDn/UpArrow/DownArrow in FF
use javascript api to connect with native components and compile...
Whenever I've had to work with there stuff I've ripped it out every time and replaced it either with a .net baseline control that was actually easier to work with and extend, or wrote my own. Now if I'm considering a job and I hear they are a heavy Telerik shop I know they are probably either all newbies or simply don't know what they are doing and I don't even interview there.
I'm curious, do these guys actually have a positive rep outside the .net community?
edit: typo.
A lot of people like working for them because they do take almost anybody and don't have high standards. You could call it the "bullshit job" of CS.
Edit: typo
Sorry, I didn't read the article. Just looking for an excuse to curse Telerik.
$1,299 / developer
That was downright enough to lead me away.As I recall, a while back, there was another open source solution llvm or something like that which also let's you write cross platform mobile apps with Javascript but have not heard about them since.
But if you guys decided to change your mind and open the source, I will be glad to try :-)
Also, "...This is the reason why we decided that once the core framework is implemented we will release the framework code under the Apache License Version 2. We already have an organization on http://github.com/NativeScript where the project will be hosted and will be pushing the code shortly - now just go ahead and star us."
... from the section titled, "Open Source - not yet another proprietary framework".