Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primitives and spec missing on website #7

Open
iacore opened this issue Aug 27, 2023 · 13 comments
Open

primitives and spec missing on website #7

iacore opened this issue Aug 27, 2023 · 13 comments

Comments

@iacore
Copy link

iacore commented Aug 27, 2023

Hello @thesephist

I can't find the primitives like input() on oaklang.org/.

I also have some other questions

  • is there read and write from lisp
  • how to use Oak inside an application as scripting language
@SpcFORK
Copy link

SpcFORK commented Sep 8, 2023

You can use Oak inside of another language easily if you and the language have Shell access and can keep doing so.
Just install Oak, and then use 'oak' to enter the repl.

@SpcFORK
Copy link

SpcFORK commented Sep 8, 2023

I can't find the primitives like input() on oaklang.org/.

You could probably find some clues in the 'env.go' file starting at oakinput on line 577.

@iacore
Copy link
Author

iacore commented Mar 13, 2024

I end up finding the built-in functions in docs/spec.md

@SpcFORK
Copy link

SpcFORK commented Mar 13, 2024

This is true, but there are a few variables that aren't listed there inside the env

image

As you can see, these variables are usable within the latest Oak.
They just aren't in the old spec.md.

@iacore
Copy link
Author

iacore commented Mar 13, 2024

lib -> import
gc -> collect garbage
mem -> show memory usage
lib__oak_qm -> ?

@SpcFORK
Copy link

SpcFORK commented Mar 13, 2024

lib__oak_qm -> ?

lib__oak_qm -> import exists in memory?

@iacore
Copy link
Author

iacore commented Mar 13, 2024

lib__oak_qm -> import exists in memory?

i can't find it in the source code

@SpcFORK
Copy link

SpcFORK commented Mar 13, 2024

lib__oak_qm -> import exists in memory?

i can't find it in the source code

Well, you can use it to get a true or false if a lib has been imported, e.g. ___runtime_lib?('std')

@iacore
Copy link
Author

iacore commented Mar 14, 2024

I also found ___runtime_proc(), which returns the current pid and oak excutable name.

	c.LoadFunc("___runtime_lib", c.rtLib)
	c.LoadFunc("___runtime_lib?", c.rtIsLib)
	c.LoadFunc("___runtime_gc", c.rtGC)
	c.LoadFunc("___runtime_mem", c.rtMem)
	c.LoadFunc("___runtime_proc", c.rtProc)

Oak is a good language. Will the author ever come back to update the official website?

@SpcFORK
Copy link

SpcFORK commented Mar 14, 2024

Not sure, but I've been using it with Kaboom for my games.

It's pretty good when you build to the web since you can interop between JS and Oak almost seamlessly.

@iacore
Copy link
Author

iacore commented Mar 15, 2024

It's pretty good when you build to the web since you can interop between JS and Oak almost seamlessly.

How do I do that interop? Do I print the object to string and send it?

@SpcFORK
Copy link

SpcFORK commented Mar 15, 2024

It's pretty good when you build to the web since you can interop between JS and Oak almost seamlessly.

How do I do that interop? Do I print the object to string and send it?

No, you have to be building with --web

@iacore
Copy link
Author

iacore commented Mar 15, 2024

I misunderstood. I thought you were mentioning interop between Oak code in browser and Oak code on server.

I want to add basic features such as chdir to Oak. Can I submit the patch to your fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants