#myta - A declarative language built for metadata definition and general-purpose configuration.

1 messages · Page 1 of 1 (latest)

empty notch
crisp harness
#

cool project, generators are probably my favorite part of the syntax

empty notch
crisp harness
#

i can think of a lot of potential uses for it

empty notch
crisp harness
#

that syntax is super neat

#

now it reminds me a bit of the nix language with some new keywords

empty notch
#

I didn't really like the syntax of Nix though

#

some of the keywords have pretty weird names

crisp harness
#

that is true

#

i love nix but the language can suck to write

empty notch
#

agree

crisp harness
#

also i dont like the fact that things like rec exist, they feel more like a cheap way to do things that you can just use a let binding for

#

and i think most people recommend not using rec anyways

#

im pretty sure Nix has a proposal to get a pipe operator which is neat tho

empty notch
#

recursive?

crisp harness
#

yes

#

you can like run an attribute set recursively if your doing like packages for example

#

and you have like 10 packages and you need 1 of those to be default

#

but its kinda useless since let exists and you can just define your packages in that and then it gets passed to the attribute set where you declare default

empty notch
#

I used rec when writing a small helper function for parsing hex colors, it was just so I can have a context set which contains some state and functions (the functions need to access the states)

#

and I didn't want to use let to add another layer of indentation

#

I do hope at some point Nix people can figure out a way to make system rebuild way faster though

#

idk what the bottleneck is

#

but just imagine JIT for nix

crisp harness
#

ive thought of this before lol

#

nix jit would be awesome

#

nix is just very slow at evaluating tho, they didnt make it fast

crisp harness
#

this project has been under my radar for a while

#

its basically an alternative to the nix package manager

#

still compatible with nix but also designed to be faster + more modular so you can like plug it into programs as a library or something

empty notch
#

interesting

empty notch
#

man I really should make a FFI API for Myta

#

have some apps I wanna do and I don't think I'll write them in Zig

#

but writing FFI API is kinda a pain 😭

empty notch
#

I'm thinking if I should add "shadow" type where it just reference to another table value but it can store some modification like extra fields, exclude fields, value modiofications etc...

#

so I can allocate less stuff

#

but it might use a lot more memory during execution depending on the use case (cause large table can't be freed because there's shadows of it)

empty notch
#

I'm going to do a rewrite to remove recursive function calling in the parser and interpreter, and syntax to export and import so we can have a little module system, also going to make generators actual value that you can pass around

empty notch
#

The parser is done, going to do some semantic analyzing, and then byte code gen

#

also changed the syntax of pipline to

|@| $std.string.split("1|2", "|") -> $[0]
|@name| 123 -> $std.string.split("1|2", "|") -> $name[0]
#

to tried making it more explicit to where the "$" (current value in the pipe) comes from

#

for now the |@| (capture) syntax kinda mean declaring a value that "changes" over the operation, so I also added it to the for loop to capture the current collection that's being transformed

for |@current| [void] * 10 with $index do (
  if $index == 0 then 1 else @current[$index - 1] * 2
)
#

I guess you can argue that $index should also use the |@| syntax but I'm still thinking about it

#

mainly because currently the capture is a token so having multiple declarations is kinda hard

timid tree
#

This is really cool!! I currently use CUE lang for schema/closedness and registry function but had glue in zig build, native would be amazing. Would myta, be able to declare invariant dependencies?

empty notch
timid tree
#

By invariant dependencies, I mean semantic dependency edges like: begin_object depends on value_allowed, frame_capacity, push_object_frame, and top_is_object.

empty notch
#

the Zig API provides a Schema comptime utility which lets you convert a Myta runtime value to a native Zig value. You can do some simple validation with string length, integer value range, etc... but not really anything "dynamic"

empty notch
# empty notch The parser is done, going to do some semantic analyzing, and then byte code gen

The with syntax can now declare annotation, I was previous only supporting simple type like table or list, but man that's really not doing it, I think it needs to support something like list[integer] and table{ "key": integer }.

{
  (@aGenerator) @anArgument: (
    with $anArgument as void or string do void
  )
}

The semantic analyzer should also be smart enough to figure out the type of $anArgument by looking into the body of the generator. The best case is when there's an annotative declaration, otherwise it'll need to guess based on the usage of the argument.

timid tree
#

@empty notch appreciate the response.

empty notch
#

yeah so I just tried parsing a 3.2MB JSON and it tooks myta 0.3s to parse it, kinda slow and all the time is spend on allocation and deallocation, idk how I can optimize it though

#

the main problem is that there's just a lot of hashmaps, maybe I can use an ArrayList backed KeyValue storage for smaller table, but idk if that will actually help with the performance all that much