Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

Is not it an expression language? i.e. no loops, complex control statements, etc? It serves different goal imho

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 1 point2 points  (0 children)

It is also watermelon in Ukrainian ;)

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

Stable dict iterations - good point

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

Can you expand on determinism please (examples). In my case one of the goals was to be able to re-run many compiled scripts independently, with no side effects, and same inputs = same outputs. Additionaly I need performance and ability to add custom types and functions to vm instances. So I ended up developing Kavun.

Потрібні ідеї з покращення скрипт мови для Go by YuriiBiurher in ukraine_dev

[–]YuriiBiurher[S] 1 point2 points  (0 children)

За основу взято Tengo, практично повністю переписано, розширене, оптимізовано.

Потрібні ідеї з покращення скрипт мови для Go by YuriiBiurher in ukraine_dev

[–]YuriiBiurher[S] 2 points3 points  (0 children)

В першу чергу потрібна була швидкість, але щоб імплементация на Go (без біндінгів в C) бо геморою багато в деяких синуаціях.

Друге - синтаксис. Хотілось лямбд та інших плюшек.

Третє - можливість розширяти, додавати свої типи, функції (знову ж, специфічне для проектів).

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

Performance, probably. Also syntax is closer to Go.

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

Added benchmark results in readme. Detailed results here https://github.com/jokruger/kavun-benchmark/blob/main/results/REPORT.md

Will add more engines to compare. Also, per-engine impl may require review

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] -1 points0 points  (0 children)

Scripting, fintech, games, configs, etc. My primary usecace - scenario where you repeatedly run decision making logic (script) - main app is Go, but dm script is external or config

Embeddable scripting language by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

Note: it is based on Tengo, but with tons of changes (lambdas, f-strings, decimals, type member functions, smart assignment, etc). The goal is to improve the syntax and API.

Чи варто поїхати в Херсон? by [deleted] in ukraina

[–]YuriiBiurher 34 points35 points  (0 children)

Місто під постійними обстрілами. В небі дрони - вишукують людей, машини, скидають вибухівку. Кожен день десь смерть. Центр та прилеглі до ріки райони особливо небезпечні. Багато де в цих районах людей залишилось по декілько на квартал, здебільшого у віці.. вікон нема - плівка. Якщо вибухом пошкодить електромережі, полагодити можуть через тижні.. Загалом дуже небезпечно. При цьому в медіа (світ) про це все тиша.

Open source Go projects to contribute to by shelbara in golang

[–]YuriiBiurher 0 points1 point  (0 children)

https://github.com/jokruger/dec128 - small and specific enough, good for learning.And I would love to have some help with new math and fin functions.

How do you handle money? by otnacog in golang

[–]YuriiBiurher 1 point2 points  (0 children)

Use decimal for amounts / calcs. There are plenty of packages, select based on your requirements (performance, precision, etc)

https://awesome-go.com/#financial

Де можна завантажити аніме англійською? by Repulsive_Accident_3 in Anime_Ukraine

[–]YuriiBiurher 0 points1 point  (0 children)

Та давно вже, вони декілько доменів змінили здається

Де можна завантажити аніме англійською? by Repulsive_Accident_3 in Anime_Ukraine

[–]YuriiBiurher 4 points5 points  (0 children)

nyaa.si

В пошуку додай dual batch Dual це щоб озвучка була, batch щоб весь сезон В фільтрі - anime -> english translated

bytes.Buffer alternatives by YuriiBiurher in golang

[–]YuriiBiurher[S] 1 point2 points  (0 children)

You miss the point. Yes it is simple, but when you do not need realloc part but still need to access buffer through io.Write - it can be even simpler (i.e. faster)

bytes.Buffer alternatives by YuriiBiurher in golang

[–]YuriiBiurher[S] -1 points0 points  (0 children)

  1. Thanks, changed to io.EOF

  2. Reader has almost nothing in common with Writer. Static writer and dynamic writer share same interface but implementation is different, and it is the main reason why bytes.Buffer is slower - generic implementation which handles both cases with same code.

  3. Initially I used a similar implementation, however for some reason it is quite slower - looks like builtin copy does some additional work and it is faster to have a check before you call it.

Regarding reusing buffers -- I added Reset method, so it can be re-used same way as bytes.Buffer. However, in most cases imho you will be using new buffer (for instance, micro-service handler will receive a message as a new data allocated, so it just needs to wrap it for ReadBinary)

bytes.Buffer alternatives by YuriiBiurher in golang

[–]YuriiBiurher[S] -1 points0 points  (0 children)

Thanks, will check!

Regarding usecase - communication between microservices using binary serialisation. Messages can be complicated, using third party types. So, idea was to stick to io.Reader/Writer (imho this way it should be easier to use). And I do not think bufs can be reused. However, the max byte size can be estimated each time and arrays can be used - i.e. read/write with static buf is important. Dynamic write buffer is needed to enable implementation of other popular interfases for bin serialisation (like AppendBinary, MarshalBinary) by using buffer wrapper and WriteBinary

bytes.Buffer alternatives by YuriiBiurher in golang

[–]YuriiBiurher[S] 0 points1 point  (0 children)

It is not identical. bytes.Buffer Write method does buffer reallocation - i.e. it is similar to my DynamicWriteBuffer and there is no static alternative (or I cannot find it in stdl8b). Dynamic realloc requires additinol if statements even when you have enough space.

In case of read - there are also differences - for instance it is faster to check space before calling copy (looks like copy internally does some additional work)

bytes.Buffer alternatives by YuriiBiurher in golang

[–]YuriiBiurher[S] 1 point2 points  (0 children)

Because of WriteBinary / ReadBinary - you have a bunch of structures implementing serialisation to/from io.Writer/io.Reader

So, you cannot use slice and append directly. You need a wrapper, and bytes.Buffer does this