[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - newLISP in a browser

newLISP in a browser

Notices and updates

newLISP in a browser

Postby Lutz » Thu Jan 02, 2014 9:43 pm

newLISP can now be compiled to JavaScript using the Emscripten SDK (1) and it runs fastest in a Chrome browser but also runs in the Firefox browser (turns out Firefox is faster edited: 2014-1-4)

The default newlisp-js.html generated has different windows for input and output with the input popup-box only about 25 characters wide. So a better front end would have to be written in JavaScript and HTML to either simulate a console REPL or make the input box bigger and integrated into the page (2). The newlisp-js.js has a size of about 2.3 MB and is loaded by newlisp-js.html of 4K size.

For bandwidth reasons and because it’s not yet a finished product, I don’t want to install the file on the newlisp.org website. But if some JavaScript expert here on the board wants to take this up as a project, I can send the files to that person by email.

A 'makefile_emscripten_utf8' with more info in the header section can be found in the source distribution here:

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

(1) https://github.com/kripken/emscripten/wiki/Tutorial
(2) I wonder if there is JS code from other applications, which could be used.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby bairui » Thu Jan 02, 2014 10:38 pm

You're tireless, Lutz! Awesome.
newLISP deserves a lot more attention; perhaps this move to the browser will help?

One thought I just had for this is to convert the newLISP manual example code segments into embedded, runable, modifiable, interactive learning tools.
bairui
 
Posts: 64
Joined: Sun May 06, 2012 2:04 am
Location: China

Re: newLISP in a browser

Postby Lutz » Fri Jan 03, 2014 12:31 am

newlisp-js.js, newlisp-js.html and newlisp-js.html.map are zipped together here:

http://www.newlisp.org/downloads/develo ... isp-js.zip

See README.txt inside
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby HPW » Fri Jan 03, 2014 7:15 am

Hello Lutz,

Thanks for creating this interesting new option.

I wonder why the Emscripten-generator/auhor decided to make a popup-promt as the input-element.
Not easy to understand the HTML and js logik and interaction.
I wonder that there are reference to a imageplugin and webgl in the javascript code.
It would be nice if more browsers would be supported. (IE etc.)

Regards
HPW
 
Posts: 1376
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: newLISP in a browser

Postby HPW » Fri Jan 03, 2014 7:36 am

Hello,

Interesting read about emscripten:

https://github.com/kripken/emscripten/wiki/FAQ

Also the list of demo is quite impressive:

https://github.com/kripken/emscripten/wiki

Seems other programming languages are also ported to emscripten.

Regards
HPW
 
Posts: 1376
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: newLISP in a browser

Postby HPW » Fri Jan 03, 2014 7:42 am

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

Re: newLISP in a browser

Postby hartrock » Fri Jan 03, 2014 8:48 am

hartrock
 
Posts: 136
Joined: Wed Aug 07, 2013 9:37 pm

Re: newLISP in a browser

Postby hartrock » Fri Jan 03, 2014 10:03 am

hartrock
 
Posts: 136
Joined: Wed Aug 07, 2013 9:37 pm

Re: newLISP in a browser

Postby Lutz » Fri Jan 03, 2014 3:31 pm

Initially, the goal would be a simple learning, tutoring and development environment for newLISP. We should go by little steps and start with the minimum possible:

- Implement a simple HTML editable text field for input and another HTML text field for output. Both fields stacked on top of each other or side by side. The default newlisp-js.html is only 95 lines long and 80% of it isn’t even needed and could be thrown out, for this first phase.

- Make a facility to display manual or tutoring text for a specific topic or function

- Improve the editor using JavaScript from other projects which do editor syntax highlighting like http://jsfiddle.net/ , http://ace.c9.io/#nav=about (comes with embedding instructions!) and many others. JavaScript is the only language builtin to the browser and with Document Object Model integration. So using jQuery, Bootstrap, etc. would be a natural thing.


Ps: http://www.evolgo.de/RYT/ this is incredible, wow! There is tons of stuff here, which could be used in a more advanced complex browser-based newLISP IDE.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby Lutz » Fri Jan 03, 2014 8:27 pm

a much faster, optimized version, now best on Firefox with almost native speed:

http://www.newlisp.org/downloads/develo ... isp-js.zip

load index.html ino the browser which is a streamlined newlisp-js.html - but still with popup window input.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby Lutz » Fri Jan 03, 2014 11:36 pm

Now with two windows, one for input and one for output:

http://www.newlisp.org/downloads/develo ... isp-js.zip

unzipping newlisp-js.zip creates a newlisp-js directory with the necessary files. See the README.txt file in the package.

Ps: now also works on Safari on OSX and IOS
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 7:54 am

Great, getting better and better. Exactly like my wish.
(Maybe you sould exchange the Position of Input and Output)

>>In this sandboxed JavaScript environment, File and network I/O functions
will not work.

Does any function for web access work? Like javascrpt Ajax etc.?
(Maybe (load "url") can internally use XMLHttpRequest in js to load the string from thr url and then evalstring in newlisp)

It seems also to work on IE 11 (Tested on my Win 7 tablet)!!

Is it possible to Gzip the js-lib?
I tried it but I am struggling with the gzip-support-configuration on my test-Server.
When it would work the lib would get under 500kb.

Regards
Last edited by HPW on Sat Jan 04, 2014 11:02 am, edited 1 time in total.
HPW
 
Posts: 1376
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 8:22 am

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

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 9:48 am

Is it possible to add a newlisp function to call javascript 'eval?

(jsEvalString "A valid javascript call")

https://developer.mozilla.org/en-US/doc ... jects/eval

Then we could build the javascript-call dynamicly in newlisp and do a callback to whatever is needed.

PS: Just tested the demo-html successfully on my daughters Samsung Galaxy S3 Android Handy!!

Seems that 'newlisp everyware' comes true! So great!

I had a projekt to build another xlisp-interpreter in javascript. Seems that it is no more needed. ;-)

Regards
HPW
 
Posts: 1376
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: newLISP in a browser

Postby hilti » Sat Jan 04, 2014 2:01 pm

--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de
hilti
 
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 2:41 pm

Hello Marc,

Nice Editor, maybe you should link the indexed doc:

http://www.newlisp.org/downloads/manual_frame.html

You may also choose better Colors. It is difficult to see selected text and the Output area.

Edit: Also tested on the Android Handy of my kids. Works fine

Regards
HPW
 
Posts: 1376
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: newLISP in a browser

Postby Lutz » Sat Jan 04, 2014 5:41 pm

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

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 5:59 pm

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

Re: newLISP in a browser

Postby hilti » Sat Jan 04, 2014 6:32 pm

--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de
hilti
 
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany

Re: newLISP in a browser

Postby Lutz » Sat Jan 04, 2014 6:44 pm

What browser and version are you using? I don't get any "undefined" messages when using only one parameter for the window.prompt call. I am using:

Firefox 26.0
Chrome 31.0
Safari 7.01

Also, all the code from Emscripten uses windows.prompt() with only one string argument.

Regarding the the size of the returned string from eval-string-js:
It seems that JavaScript is allocating the memory for the returned string and then is also managing it for GC. newLISP makes a copy of it and manages that copy. I tested for memory leaks when invoking eval-string-js and it seems that memory is managed well by JavaScript and newLISP for this call. I haven't tested for the max memory allowed as return value but believe, there will be no problems loading code source.

Talking about memory in general:
At this moment newlis-js-lib.js is limited to about 16MB of heap memory, which is the default Emscripten allocates and probably a sensible (conservative) choice for browser based applications. This value can be changed in a configuration file and perhaps I will bump it up to 32MB or even more. There are many other limits which can be configured before compilation and as things move along, I will experiment. At the moment I go with the defaults until we know more.

Ps: thanks for the great examples Marc. Do you also get this “undefined” message HPW is talking about? And what browser version do you run?

Ps2: I am getting a "undefined" as return value from (eval-string-js "alert(6)"), but believe this is Ok, "undefined" is simply the return value from the JavaScript alert() function in this case, perhaps in JavaScript alert is "void alert()".

Ps3: Note, that using $(window).width(); also would need jQuery installed.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 7:33 pm

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

Re: newLISP in a browser

Postby HPW » Sat Jan 04, 2014 8:02 pm

Hello,

sys-info on newlisp-js shows 203 for me.
Does it mean UTF-8 and what else?

Regards
HPW
 
Posts: 1376
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: newLISP in a browser

Postby hilti » Sat Jan 04, 2014 8:14 pm

--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de
hilti
 
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany

Re: newLISP in a browser

Postby Lutz » Sat Jan 04, 2014 11:19 pm

The second argument is now included in the example together with some other cleanup in index.html and some more instructions in README.txt:

http://www.newlisp.org/downloads/develo ... 10.5.7.zip

I am very excited about Marc's editor, which looks better each time I load it. Fortunately once the same newlisp-js-lib.js is loaded it goes pretty quick as it is cached by the browser, but there seems to be some load on your site at times.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP in a browser

Postby Lutz » Sun Jan 05, 2014 12:26 am

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

Next

Return to newLISP newS

Who is online

Users browsing this forum: No registered users and 1 guest

cron