Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ On Android running ClojureScript     - Oracle 11g RAC manually playing GI PSU patch ( (Database)

- Linux System Getting Started Learning: Change the name of the network interface on CentOS7 (Linux)

- MySQL restart process can not be taken lightly (Database)

- Ubuntu 14.04 Configuring cuda-convnet (Linux)

- Linux operating system Samba server configuration and use (Server)

- LinSSID: a graphical Wi-Fi scanner under Linux (Linux)

- CentOS 7 How to install MySQL Server (Database)

- Source encountered problems and solutions when installing SaltStack (Server)

- Linux installation notes under GAMIT (Linux)

- How to modify the Linux NIC eth1 to eth0 (Linux)

- History and Statistics tuptime use tools to view Linux server system boot time (Server)

- Oracle Migration partition table (Database)

- Hadoop 2.7.1 installation configuration based on availability QJM (Server)

- Build your own Web server under Ubuntu Linux system (Server)

- Java gets the current system time System.currentTimeMillis () (Programming)

- Linux user status query, and to unlock locked user (Linux)

- Golang use Oracle database on Ubuntu 14.04 (Linux)

- C ++ stderr / stdout redirected to a file (Programming)

- Grep how to find files based on file contents in UNIX (Linux)

- Installation and deployment of MariaDB under CentOS (Database)

  On Android running ClojureScript
  Add Date : 2016-04-17      
  In the past few years, I have developed one of the most rewarding experiences of his career, would like to share with you.

Now that we have ClojureScript runs on the Android. Not in a WebView inside, nor is the use of something like Cordova, but a real run on an embedded JavaScript engine. In the end what happened?

Recently, we have some work to do to create an application for iOS ClojureScript REPL, Replete. Whole looks cool, and the corresponding Android application will only be considered barely created. Unfortunately, my mediocre Android technology, it can not get started immediately.

However, this aspect of the technology also Tahmid Sadik got on the table.

Tahmid UI can string together, but also can be instantiated and Rhino JavaScript statement calculations, but let's guided the ClojureScript running for him can be described as a challenge.

But before that, he must be in his app will ClojureScript boot up. The word is my guide specially marked, he pointed out the need to use Google's Closure dependency management system to start up ClojureScript running, no JavaScript, no other optimizations (such as: none Mode), if necessary, you can define CLOSURE_IMPORT_SCRIPT environment variable. If you want to include a REPL, it is very important when introduced in this way to run. It also contains the source code in your REPL level namespace provides support.

In fact, Replete also need to do this, used is a function of Ambly. Of course I know, Replete is an independent REPL, it does not need to Ambly. But I used a little trick, you can reuse this function, so ClojureScript start running Replete inside.

By the way, I initially intended to use to achieve Replete React Native of. The results found that the use of ClojureScript React Native support is still too early, but can be guided ClojureScript really just the beginning of the function, in order to be able to practice a lot of effort needs to be done. So, for Replete, I kept it simple, even Goby also not used.

With the above results, a good point is not required React Native dependence (Android version has not been officially released publicly), nor Goby dependent (only supports iOS). Replete built ClojureScript very simple, the use of traditional iOS UI, it proved to be helpful for Android Tahmid to accomplish the same functions.

Let us return to the story began: essentially copied Ambly Tahmid the bootstrap logic, one by one in the order of execution in the Rhino in the JavaScript statement. But from time to time he will encounter some strange questions, I can remember a few months ago will encounter similar problems in Ambly studied the code, I gave some recommendations.

After that, he basically can boot successfully ClosureScriptle.

cljs.core.apply.call (null, cljs.core.inc, new cljs.core.PersistentVector (null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [1], null))

JavaScript code for this line is (apply inc [1]) to be bound

Then finally Tahmid 2.0. Awesome! This should be the first time ever, running up ClojureScript on Android-based embedded Rhino.

Next, we need to try to use them reader, analyzer, and compiler. Now we have to try, simply use Replete in the JavaScript, so that the Android app Replete execution of read_eval_print function parameter is a string (+ 12). If this works, then congratulations, ClojureScript has been successfully launched.

replete.core.read_eval_print.call (null, '(+ 1 2)')

Wait a minute, Transit in execution goog.require ( 'replete.core'); time is a problem, it should be with randomUUID related. Tragedy, looks obviously there are many places need to be addressed.

But it's been experimenting with different ways to load the cache analysis, thank Karl Mikkelsen before Replete, we have a version available for use only pure JavaScript, no dependencies. After this put up with in the print callback somehow (this method println like this can work), then you Tahmid Notify me by Slack:

I got 3
(+ 12) = 3

... And then continue to bother me, but also without hair blog. In this way, guided ClojureScript REPL on Android born!

After Tahmid at the interface encapsulates something, fix JavaScript / ClojureScript integrated some minor problems on the release of Replicator.

It is simply a storm!

Now, Tahmid is replacing Rhino with JavaScriptCore, this is not so fast.

I think this will speedup. This provides some important foundation for our use JavaScriptCore local switching functions on Android.

From the big picture, I really think ClojureScript run on Android soon. Particularly the use JavaScriptCore. For this issue of view, you can see the difference on the Android Bocko Vladimir Iakovlev port on the boot speed.

Clojure ~ 14 Miao
Clojure / Skummet ~ 11 Miao
ClojureScript ~ 2 Miao
These are the results on the simulator to run, but I still think it shows the true realization ClojureScript reduce computation delay on mobile devices commitments. I think it's time for ClojureScript active, used to develop applications for mobile devices!
- 10046 trace only open for a particular SQL statement (Database)
- Tab set to four spaces in Vim (Linux)
- Java-based data source database access (Programming)
- Learning UNIX good habits (Linux)
- MySQL & NoSQL - Memcached widget (Database)
- To compile and install Clang 3.5.0 in Linux CentOS (Linux)
- Custom Android UI template Comments (Programming)
- error 1819 (HY000): your password does not satisfy the current policy requirements (Database)
- Developing a Web server yourself (Server)
- Tune in high resolution to 1280x800 in Fedora 14 (Linux)
- Python 3 for instructions encoded string conversion (Programming)
- MySQL uses mysqld_multi to deploy stand-alone multi-instance detail procedures (Database)
- CentOS 6.5 Telnet SecureCRT use management tools (Linux)
- How to use tmpfs in RHEL / CentOS 7.0 (Linux)
- Impact test noatime Linux file access time (Linux)
- Linux system man help tips (Linux)
- ogg start being given libnnz11.so: can not open shared object file (Database)
- Oracle study notes view (Database)
- Three details reflect the Unix system security (Linux)
- Ubuntu users to install household financial management tools HomeBank 5.0.0 (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.