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

Give feedback on ValueScript #13

Open
voltrevo opened this issue Aug 29, 2023 · 3 comments
Open

Give feedback on ValueScript #13

voltrevo opened this issue Aug 29, 2023 · 3 comments
Labels

Comments

@voltrevo
Copy link
Owner

ValueScript is free and open source. We want it to be guided by community feedback.

Comment here for small things or questions about giving substantial feedback.

If you have something detailed or thorny, please open a dedicated issue for it.

@voltrevo voltrevo added good first issue Good for newcomers no coding labels Aug 29, 2023
@Metalymph
Copy link

Hi! First of all congratulations for your great job, it's indeed a good improvement over TS/JS environment in terms of safety (avoiding side effects) and performance thanks to the no GC to RC aspect. There are however some points which are not clear to me, being a subsystem forced to interact with the outer world:

  • If functions are pure by default, how you handles the specific cases where you want to pass a parameter from TypeScript to the inner ValueScript execution and have it back (essentially a "projection" of the mutable value) in order to avoid multiple allocations? For instance in the request/response model you can avoid a good amount of dynamic allocations rewriting a specific pre-allocated buffer and doing so, not instantiating a response (and also some requests) object to return. Supposing i use ValueScript for a request handler so, how can i force the subsystem to take a "mutable" param?
  • Which is the context switch cost of calling the ValueScript environment evaluation inside (for instance) a TypeScript program?
  • Since ValueScript launches a new thread instead of a concurrent task on the same single threaded JS runtime, can i lunch multiple instances of ValueScript runtime?

Thanks for your time and i hope i'm been specific enough :)

@voltrevo
Copy link
Owner Author

Hi @Metalymph. Thanks for your feedback and sorry for the slow reply.

If functions are pure by default, how you handles the specific cases where you want to pass a parameter from TypeScript to the inner ValueScript execution and have it back (essentially a "projection" of the mutable value) in order to avoid multiple allocations? For instance in the request/response model you can avoid a good amount of dynamic allocations rewriting a specific pre-allocated buffer and doing so, not instantiating a response (and also some requests) object to return. Supposing i use ValueScript for a request handler so, how can i force the subsystem to take a "mutable" param?

Well if you want to keep the ValueScript system pure, then you don't do that. However, these kinds of foreign interactions are planned, so that you can introduce the kinds of things you're talking about if you choose.

Which is the context switch cost of calling the ValueScript environment evaluation inside (for instance) a TypeScript program?

Good question. Not sure yet.

Since ValueScript launches a new thread instead of a concurrent task on the same single threaded JS runtime, can i lunch multiple instances of ValueScript runtime?

Absolutely :).

@Metalymph
Copy link

Hi @voltrevo and thanks for your kind answer.

Having multiple isolated runtimes is a good advantage but only if you have a way to preallocate the single runtimes before the several calls to start the runtimes, avoiding the context switch costs at least partially (the warm-up/launching part) exactly like a executors pool.

This is a good project especially for TS related codebases indeed. Congratulations for your great work :) !

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

No branches or pull requests

2 participants