newLISP in a browser

Notices and updates
Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

The editor IDE is now in pretty good shape, but running a lot of stuff in JavaScript compiled newLISP over the weekend, too often optimization problems and exception handling problems occur which are problems of the Emscripten compilation.

When new versions of the LLVM-Clang-Emscripten toolchain come out, I will try again. At least the LLVM and Clang parts seems to be stable. Since a few versions now, newLISP is compiled using LLVM and Clang for the OSX 9.1 (Maverick) for all OSX binary distributions. Emscripten works by taking LLVM, Clang generated low level bit code and translating it to a subset of JavaScript called asm.js, which then gets fed to the JavaScript runtime VM.

The current newlisp-js-10.5.7.zip is Ok for demo purposes but not for production work.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello Lutz,
When new versions of the LLVM-Clang-Emscripten toolchain come out, I will try again.
The current newlisp-js-10.5.7.zip is Ok for demo purposes but not for production work.
Not so good news. I hope the Emscripten-team is aware of the problems and get them fixed.
A stable engine is a must-have to move serious projects to that engine.

Regards
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

Occasional problems with exceptions persist but can be defined more precisely now. See the CHANGES notes for more about this. I believe it is still possible to build stable applications with newLISP compiled to JavaScript.

It was possible to cut the size of the library in half doing more compiler optimizations. This did not make the exception problems worse. The compressed newlisp-js-lib.js.gz is now only 250K.

http://www.newlisp.org/downloads/develo ... nprogress/

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Typo in changes: to work
For this to wordk emsdk-portable.tar.gz must be installed ....
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

Since the last 'newLISP in a browser' announcement many things have been added to the editor. I use it now frequently for trying out and developing smaller code portions.

The execption handling problems (setjmp(), longjmp()) only occur rarely and I hope they will go away completely with newer versions of the Emscripten tool set.

- Syntax highlighting now with CodeMirror editor. This is the same editor, Marc is using at the http://newlisp.neocortex.io/ demo. He could take the syntax highlighting file from here:
newlisp-js-x.x.x/codemirror/mode/newlisp/newlisp.js

- Several dark and brigth color schemes.

- Keyboard short cuts for most buttons (click [info]).

- Automatic vertical and horizontal resizing when browser window changes and sensing of mobile device rotation.

- Tool tips for all buttons.

- line numbers can be toggled on/off.

Access it here: http://www.newlisp.org/newlisp-js/

The info page has a link to the source package. At least for me, a bluetooth keyboard connected to the iPad did not work with the CodeMirror editor. I hope this is something getting fixed soon by the Emscripten team.

johu
Posts: 143
Joined: Mon Feb 08, 2010 8:47 am

Re: newLISP in a browser

Post by johu »

Hello, Lutz.

For Stable Release or Development version,

in newlisp_manual.html
line 1430
newLISP code and JavaScript code together. Bot languages can call
                     ↓
newLISP code and JavaScript code together. But languages can call
line 7309
<table border="0" cellpadding="1" width="95%" align="center" summary="Reflection and customization">
                                 ↓
<table border="0" cellpadding="1" width="95%" align="center" summary="API for newLISP in a web browser">
line 12401
<br/><br/> might be added
Because there is between display-html and div.


in README.html
line 309
(eval-string-js (string "GetUrl('" url "')"))
                  ↓
(eval-string-js (string "GetUrl('" url "')")) )
line 322
new webpage. When evaluating the following snipped in the editor box,
                     ↓
new webpage. When evaluating the following snippet in the editor box,
Thanks,

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

Thank you very much for all the corrections Johu.

Everything is online here: http://www.newlisp.org/newlisp-js/

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

....and I hope they will go away completely with newer versions of the Emscripten tool set.
Since some time/versions have passed, is there any Progress in newer versions of the Emscripten tool set for more stable newlisp-implementations?

Regards
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

The current version at http://newlisp.org/newlisp-js was installed on September 16th and based on the latest version of Emscripten. All exception handling problems fortunately have disappeared :) On all platforms it runs best on Firefox.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello Lutz,

Good News, It would be interesting to try newlisp in a browser combined with one of the popular JavaScript-GUI-frameworks for example: http://www.jqwidgets.com/jquery-ui-widgets-toolkit/

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

In http://www.newlisp.org/newlisp-js/README.html we can read:
For a tutorial in to the basics of newLISP type (load "newlisp-js/tutorial.lsp") in to the editor ....
But when I try it I get:
ERR: problem accessing file in function load : "newlisp-js/tutorial.lsp"
Regards
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

Thanks Hans-Peter, the link has been taken out. It is not completed yet but perhaps it will appear in a future version.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

A observation for IE11 on Win7 tablet and the provided links here:

http://www.newlisp.org/newlisp-js/ does not finish loading.The word 'Downloading...' stays visible and Buttons do not work.

http://newlisp.nfshost.com/newlisp-js/ works as expected on IE11.

Both links work on Chrome as expected.

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,
..... and based on the latest version of Emscripten.
Just curios:

http://kripken.github.io/emscripten-sit ... loads.html

shows 1.29 as download-Version. The newlisp-js Shows 1.22 as the version number.

Regards
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

During the coming week, I will try to update the Emscripten.

Also: the best browser for using Emscripten is - by far - Firefox. It is more than double the speed of Chrome. To check the speed: clear the windows using the x-edit and x-log buttons, then execute:

Code: Select all

(module "qa-bench")
this will give you the relative speed to a MacOSX 10.9, 2.3GHz Intel Core i5. Firefox comes in with 1.89 and Chrome with 5.01. On my iPhone 5s and iPad Mini (version 1) it will crash, because of the lack of memory required by the bench mark routines - you must then hit the red reload button. Haven't tried on a iPhone 6 or newer iPad, which all have more memory.

Firefox is also the only browser, which allows you to run locally on a laptop or desktop without going through a web server.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello Lutz,

I will try also Firefox.
But why does the first link not work on IE11.
What can be the difference between the both server setups.
Just to make sure that it work on all target-platforms.

Regards
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »


Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP in a browser

Post by Lutz »

Updated here to Emscripten v1.29 and current in progress newLISP v10.6.3. http://www.newlisp.org/newlisp-js/ . Performance on Firefox has slightly improved, now 1.68 compared to native 1.0 performance.

For IE11 issues see here: https://github.com/kripken/emscripten/issues/3180

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

Thanks for the update.
Now it loads again from the link on IE11 on my Win7 tablet (I5 470UM / 1.33GHz).

Qa-bench on IE11:
>>>>> total time: 50358
>>>>> Performance ratio:82.10 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Qa-bench on Chrome 40:
>>>>> total time: 15157
>>>>> Performance ratio:24.86 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Not installed Firefox yet, have to upgrade my 64Gb SSD first.

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

After upgrading Chrome to 41:

>>>>> total time: 2844
>>>>> Performance ratio: 4.83 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

Another bench from my CAD-Workstation (WIN 7 64bit Xeon E5-1620 3.7 Ghz)

IE 11:
>>>>> total time: 4806
>>>>> Performance ratio: 8.02 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-
Chrome 41:
>>>>> total time: 1097
>>>>> Performance ratio: 1.99 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)
Firefox 36:
>>>>> total time: 818
>>>>> Performance ratio: 1.54 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Firefox is also the only browser, which allows you to run locally on a laptop or desktop without going through a web server.
Just tried it out. Nice tip. Will be usefull for further testing.

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

Upgraded my tablet SSD today from Sandisk 64Gb to Samsung evo 470Gb.
Installed firefox 36 and here is the benchmark result:
>>>>> total time: 1945
>>>>> Performance ratio: 3.37 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)
Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

Today I could test on a aged intel core 2 duo P8400 with 4GB
Windows 10 Pro 32 bit

Chrome 46
>>>>> total time: 3792
>>>>> Performance ratio: 6.37 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Firefox 41.0.1
>>>>> total time: 1605
>>>>> Performance ratio: 2.82 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Edge
>>>>> total time: 5214
>>>>> Performance ratio: 8.68 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

IE11
>>>>> total time: 11433
>>>>> Performance ratio:18.80 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)

Regards
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: newLISP in a browser

Post by HPW »

Hello,

By the way emscripten is now at 1.34.1

http://kripken.github.io/emscripten-sit ... loads.html

Regards
Hans-Peter

Locked