未加星标

Planck 2

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二04 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

Planck now supports linux!


Planck 2

This capability owes its roots to Lucas Stadler who a started things off with a truly massive contribution which converted the bulk of the Objective C in Planck to portable C. With this effort, Lucas essentially got Planck running for the first time on Linux. Incredible!

Others who have helped with contributions to Planck 2 include Jonathan Leonard , Belaf , Ivan Kryvoruchko , and António Monteiro .

With these changes, Planck is now fairly portable. It can compile with either Clang or GCC, and works properly on a range of Linux distributions. It has even been built and run on the Raspberry Pi !

It is able to target both 32-bit and 64-bit boxes. The 32-bit capability is interesting in that it could provide a way to put a fast, lightweight ClojureScript REPL on older lower-end computers. I could see this being useful for children's educational outreach organizations like LoudounCodes .

If you'd like to build Planck on your favorite Linux disto it can be as simple as running script/build , but first check out the Building wiki page. It is essentially a cheat sheet with instructions for getting the build tooling and library dependencies set up on different distributions. Additionally, the Planck build tree has several Vagrant-based build environments that can be spun up to build Planck on different distributions.

Planck is still being distributed in binary form for macOS via Homebrew. For macOS it is still as simple as brew install planck . My hope is that we can get Linux binaries set up for the native distribution mechanism for the various popular Linux distros.

Some of the new features in Planck 2 were covered inPlanck Road Ahead.

Technical Background

Planck's implementation has always been splitroughly in two, with ClojureScript handling most of the REPL logic, and the native side handling most of the interaction with the OS. The main difference with Planck 2 is that the native half is now in C.

Interestingly, we took advantage of this split: For a while, the ClojureScript portion of Planck was simultaneously used for both the Objective C and C native portions. Planck releases 1.15 through 1.17 were made with the Objective C code, while the C version worked but was still being fully fleshed out until we could confidently ditch the Objective C.

In some sense, the ability to do all of this goes back to when David Nolen suggested that we take Ambly's native javascriptCore integration, and convert it fromObjective C to C. (Since Planck internally uses the Ambly JavaScriptCore interface and runtime bootstrapping code, this was key to allowing Planck to be converted to C.)

Some of the challenges with the C port involved threading. One is that Planck 2 lacks a good async event triggering mechanism and just employs threads to achieve the same for now. A tougher issue was handling subtleties around JavaScriptCore and threading on Linux, in particular with SIGUSR2 ―that issue and related forms took nearly half a year to finally resolve. As they say, persistence pays off.

Planck 2 is faster in some areas relative to 1.17. I think this is perhaps because we are able to use lower-level constructs directly in C, and this is also simply because we have optimized some things since 1.17.

Another issue that was nice resolved in Planck 2 is the ability to run shell scripts that produce lots of output. Try as we might, we never succeeded in getting this to work properly with the Objective C process API being used in 1.17. Now, Planck 2 uses select and breezes though tons of output.

Some other things, like Socket REPL support were much easier to do in C than Objective C . I think the reason here is that UNIX has a fairly straightforward API for TCP.

It has been a long road to ensuring the quality of Planck 2 relative to 1.17. It has had gone through several alphas, 6 betas, and 1 RC. (Planck has entered the mode where you definitely don't want to release breaking changes, if at all possible.) Thanks to all who tested these interim releases!

During that time Lumo came into existence and had two releases! I highly recommend making use of Lumo as well―it is cross-platform, fast , supports many of the same features with Planck, and sits atop V8 and Node―you can make use of NPM libraries with Lumo, something Planck cannot do.

The very first Planck issue was for Linux . I suppose one follow on question will be " windows? ". Well, it works now, in the Windows Linux subsystem. But, porting to Windows should be feasible. JavaScriptCore works on Windows, and Planck comprises some fairly portable C code at this point. I would suspect that the places where POSIX calls are used for threading, and other low-level facilities would need to be ported to Windows API calls.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

分页:12
转载请注明
本文标题:Planck 2
本站链接:http://www.codesec.net/view/529770.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(14)