Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ On Android running ClojureScript     - Present Situation and Development Trend of firewall products (Linux)

- Oracle data row split multiple lines (Database)

- Object Oriented Programming Java reflection (Programming)

- Linux System Getting Started Learning: Join cron job in Linux (Linux)

- VMware clone Linux find eth0 (Linux)

- Search Linux commands and files - which, whereis, locate, find (Linux)

- Cache implementation APP interacts with the server-side interface control Session (Server)

- MogileFS system installation configuration example (Server)

- To install Xen in Ubuntu 12.04 (Linux)

- top command causes the system load increases (Linux)

- How to create a cloud encrypted file system in Linux systems (Linux)

- Boost notes --Thread - problems encountered in the initial use on Ubuntu (Programming)

- Upgrade to Node V4 seven reasons (Programming)

- Apache Web Security Linux systems (Linux)

- Kitematic how seamless and DockerFILE (Server)

- Linux program analysis tool: ldd and nm (Linux)

- Java integrated development environment common set of operations (Linux)

- Java 8 stream parsed into SQL (Programming)

- HDFS Hadoop Distributed File System Works (Server)

- How to protect your eyes automatically adjust the screen brightness on Linux (Linux)

  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!
- Linux port mapping system (routing and forwarding) (Server)
- On the design of Oracle database backup (Database)
- Graphics of Java Tools (Programming)
- Java data structures - the linear form of the single-chain applications (Programming)
- How to install Linux on a MacBook Pro Retina (Linux)
- Related to optimize the use of Btrfs file system on SSD (Linux)
- Oracle 11g manually create a database (Database)
- MySQL Server Time Synchronization Problem (Database)
- Linux deploy Tutorial (Linux)
- Thinking in Java study notes - initialization and cleanup (Programming)
- How to configure a development environment elegant Lua (Linux)
- Linux, modify / etc / profile file (Linux)
- To install Emacs under CentOS 6.5 (Linux)
- Linux Kernel 4.2 Installation Instructions (Linux)
- Modify grub solve computer startup error: ERROR 17 (Linux)
- Let you Fun Ubuntu desktop eleven weapon (Linux)
- NFS-based services and service utilization Corosync DRBD high availability cluster configuration, respectively (Server)
- Setting Linux desktop environment, achieve HiDPI display support (Linux)
- The headers for the current running kernel were not found when VirtualBox installation enhancements (Linux)
- redis configuration in detail (English) (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.