海龟宇宙至今未支持非netlogo的编程语言,不支持访问网络或自定义扩展,仅能使用为数不多的几个netlogoweb扩展和专有拓展。
两年前我意外发现了一个JavaScript注入漏洞,于是海龟宇宙就有了非官方的JavaScript,CoffeeScript,WebAssembly语言支持(尽管这些基本只有我在用)。
自定义扩展,netlogo语法糖,空编辑器运行代码,网络汇编实现的高效素数筛选,完全在v8中运行的三维图形的光栅渲染,基于png.js和importDrawing的位图显示,破碎的瓦片世界,注入教程系统实现的更好的对话框,midi打包器,这些都是我在海龟宇宙用JavaScript干的。
另外还有基于网页canvas元素的webgl渲染,基于请求API的AI,基于网页script元素重放本地环境脚本,这些仅在iOS可用
因为iOS运行在本地文件系统的网页中,其它平台运行在仅提供WebAssembly和少量必要接口的v8环境中,
只有iOS设备上的海龟宇宙能通过实验中注入的脚本进行网络请求,画布绘制和导出图片,创建专有工作者线程,使用原生的流式压缩和解压接口。
非iOS平台相对于前者唯一的优势就是可以使用SharedArrayBuffer(默认的file协议禁用共享内存,即使通过WebAssembly.Memory获取共享内存实例也无法跨线程共享,并且Atomics.wait不能用在主线程中),
但是v8环境根本没有其它线程可以访问,因此SharedArrayBuffer只能算是可以用Atomics.wait廉价暂停线程指定毫秒数(精度约15毫秒)的,不可缩小的内存缓冲区
并且在没有setTimeout和setInterval的v8环境中,Atomics.waitAsync是实现定时器的唯一可靠方法
海龟宇宙正在往奇怪的方向发展…
The Turtle Universe does not yet support non-netlogo programming languages, web access or custom extensions, and only a few netlogo web extensions and proprietary extensions are available.
two years ago, I stumbled across a JavaScript injection vulnerability, and the turtle universe has unofficial JavaScript, CoffeeScript, and WebAssembly language support (although I’m pretty much the only one using these) .
Custom extensions, netlogo syntax sugar, empty editor run code, network assembly to achieve efficient prime number filtering, fully run in v 83d graphics raster rendering, based on PNG. Bitmaps from JS and importDrawing show the world of broken tiles, better dialogs from the injection tutorial system, and MIDI wrappers that I did in the turtle universe with JavaScript.
There’s also webgl rendering based on the web canvas element, AI based on the request API, and replaying local environment scripts based on the web script element.
These are only available on iOS because iOS runs on the local file system web page, other platforms run in V-8 environments that offer only web assembly and a few required interfaces,
and only the turtle universe on iOS devices can make web requests, paint canvases, and export images from scripts injected into the experiment, create proprietary worker threads, using native streaming compression and decompression interfaces.
The only advantage that non-iOS platforms have over the former is the ability to use SharedArrayBuffer (the default file protocol disables shared memory, even through webassembly. Memory fetches shared Memory instances that can not be shared across threads, and atomics. exe. Wait can not be used in the main thread) ,
but the V 8 environment has no other threads to access at all, so the SharedArrayBuffer is only usable with atomics.
exe. Wait cheap pausing threads specify non-scalable memory buffers in milliseconds (with a precision of about 15 milliseconds) and in a V 8 environment without setTimeout and setInterval, atomics. Waitasync is the only reliable way to implement a timer.
The Turtle Universe is going in strange directions…