Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hi all, I'm the creator of SmallJS, and was wondering why its GitGub star count had suddenly shot up :-). Feel free to ask me any any questions here. I'll try to respond to some. Here's a short presentation that has fallen off the News page: https://small-js.org/News/Why_SmallJS.pdf


Very Cool! I had Smalltalk-80 back in the mid 80s and loved it. Prob forgot most by now tho. Just cool you've made it a thing again.


i have been trying to find an example how to run a site without build tools. i understand the playground can interpret smalltalk code in the browser, so i think there might be a way.

i would like the smalltalk code be loaded from files into the browser and interpreted/compiled there, without writing the resulting js back, but just running it in the browser.


The ./Playground project in the repo does that (taking ST source from a HTML text area). But you could modify it to open a file. (Note that browsers cannot read arbitrary files without user interaction.) The Playground has a slightly modified version of the compiler built in to make this possible.


i don't mean opening files from disk, but fetching them from the server. i build my site as usual, but instead of converting to js in a build step, i upload the st files to the server. the html in the browser then loads the compiler and fetches the st files from the server, passes them to the compiler and runs them


I see. Then you would first have to have (make) a server that serves up *.st source files throug a REST api. Then you would modify the ./Playground project to fetch the files from your server in stead of from the TextArea. This is done in the PlaygroundApp.evaluate method.


would it have to be a REST API? couldn't i just fetch them as plan text?


Sure, you could do that too in SmallJS. See the classes in ./Smalltalk/Core/Fetch and in ./Smalltalk/Node/Server. The Fetch unit tests actually have a case for this, I think.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: