just-js / lo

it's JavaScript Jim, but not as we know it. :space_invader:
MIT License
241 stars 9 forks source link

Syntax for builtin objects #18

Closed mikeptweet closed 8 months ago

mikeptweet commented 11 months ago

How do I access the builtin objects, i.e. sqlite

Can you provide a simple example that uses this api?

billywhizz commented 11 months ago

i should have some docs and examples up tonight and over weekend @mikeptweet. will reply here when i have something.

right now, there are some benches here and some examples and docs will be going here.

what OS are you running on? latest builds are really only working on linux. i need to get access to a macos machine to test and fix some things for macos.

mikeptweet commented 11 months ago

I am running on MacOS Intel x64. The binary runtime works great from the release but for the life of me, I can't figure out how to use the builtin objects like sqlite.

Awesome work BTW

billywhizz commented 11 months ago

cool. there are some issues building bindings on macos that i can't really look into until i have a mac machine to work on. hopefully soon. but, if you want to give it a try and let me know what breaks, that would be very useful. maybe jump on the discord and we can chat there? https://discord.gg/ZnNsBwaBKr

there's a docker file here you can use if you can't get things running on macos rn. this will download, compile source and build all the bindings. i have commented out duckdb as it takes ages to build. the commands should be same on macos but you will need to set C=clang and CC=clang++ in your env when running the build commands.

if you get the bindings built, there is a nice wrapper around the sqlite bindings here. i think it should be easy enough to figure out, but i will push an example of usage up to the docs repo shortly.

billywhizz commented 11 months ago

looks like i can get a mac instance up on scaleway now so i will have a look at any of the build issues on macos over the weekend. i think they will be pretty easy to fix. :rocket:

allcpu commented 10 months ago

What about windows did just-js will not support it

billywhizz commented 10 months ago

there will be windows support but it's lower priority right now because everything on windows is so wildly different to macos/linux. goal is to expose the low level system api's we need for windows into JS and we can build on top of those in JS rather than creating a very complex cross platform abstraction in a lower level language like C++ or Rust.