MiniLang icon indicating copy to clipboard operation
MiniLang copied to clipboard

For Standard Library or Another Thing

Open yakupcemilk opened this issue 1 year ago • 13 comments

I hope you are well, we talked before at reddit and I said I can help if there is things to do at this excellent project. If there is anything to do, I can handle it with your permission.

yakupcemilk avatar Aug 09 '24 20:08 yakupcemilk

Yeah man, a good first contribution would be enum. All enum members should have the same element type. The len_of builtin should return the number of members. size_of builtin should also work. Check how structs are implemented in the language, it would be really helpful since the parsing syntax is nearly identical (enums could even be represented by the compiler as a struct)

enum myenum
  a = 15
  # Or: member: type = ...
  c: int8 = 15
end

=> len_of(myenum) == 2 => size_of(myenum) = sizeof(myenum) (the c builtin) => type_of(myenum) == "enum"

NICUP14 avatar Aug 10 '24 11:08 NICUP14

I would also appreciate any contributions to the standard library if you have any ideas to add/improve any libraries.

NICUP14 avatar Aug 10 '24 11:08 NICUP14

This is needed and I understand it well, give me 1 week for reading and understanding the whole project. I'm moving to another country, so, I'll be busy for a week but I want to make this contribution. Thank you for your response.

yakupcemilk avatar Aug 10 '24 11:08 yakupcemilk

I would also appreciate any contributions to the standard library if you have any ideas to add/improve any libraries.

I think Minilang needs basic media and a GUI library. For the standard library I'll prepare a report to you about what I can do.

Edit: most of the languages don't have these and most of the people who see the language for the first time, don't want to create hard-work needed libraries. They want ready-for-development.

yakupcemilk avatar Aug 10 '24 11:08 yakupcemilk

It's all yours man. There's lots of features which are missing, plus documentation plus standard library among other things which I probably missed. I'll do something else in the meantime

NICUP14 avatar Aug 10 '24 11:08 NICUP14

It's all yours man. There's lots of features which are missing, plus documentation plus standard library among other things which I probably missed. I'll do something else in the meantime

I'll be working hard for Minilang, it is like my Syscall project. I love the project. So, I think I'll be well enjoyed when I work on it.

yakupcemilk avatar Aug 10 '24 11:08 yakupcemilk

Glad you like the project. Appreciate it!

NICUP14 avatar Aug 10 '24 11:08 NICUP14

Glad you like the project. Appreciate it!

Thank you!

yakupcemilk avatar Aug 10 '24 11:08 yakupcemilk

Can you read the proof of concept codes for the enums at my repo and enum branch? There is things to do but I want to kindly asked about your plan for enums.

yakupcemilk avatar Aug 10 '24 16:08 yakupcemilk

I will take a look rn

NICUP14 avatar Aug 11 '24 15:08 NICUP14

What I meant about the builtins like size_of, len_of and type_of are part of the language. The are parsed internally similar to macros and are expanded in the src.backend.c.CDef.c_expand_builtin(). Take a look at that. Parsing those builtins is already taken care of, you just need change that function a bit to make it work with enums.

NICUP14 avatar Aug 11 '24 15:08 NICUP14

What I meant about the builtins like size_of, len_of and type_of are part of the language. The are parsed internally similar to macros and are expanded in the src.backend.c.CDef.c_expand_builtin(). Take a look at that. Parsing those builtins is already taken care of, you just need change that function a bit to make it work with enums.

Of course, I create these for proof of concepts. There is a comment about C builtin but because of the busy week, I can't read all of the codes. But after the week I will fully focus on the subject. I asked to see what I have on my mind. I think the proof of concept can be usable.

Edit: You can reach me Slack, Discord, E-mail or anything you want. It will be more comfortable.

yakupcemilk avatar Aug 11 '24 15:08 yakupcemilk

What I meant about the builtins like size_of, len_of and type_of are part of the language. The are parsed internally similar to macros and are expanded in the src.backend.c.CDef.c_expand_builtin(). Take a look at that. Parsing those builtins is already taken care of, you just need change that function a bit to make it work with enums.

Of course, I create these for proof of concepts. There is a comment about C builtin but because of the busy week, I can't read all of the codes. But after the week I will fully focus on the subject. I asked to see what I have on my mind. I think the proof of concept can be usable.

Edit: You can reach me Slack, Discord, E-mail or anything you want. It will be more comfortable.

Agreed, I've sent you a mail containing my contact information.

NICUP14 avatar Aug 12 '24 15:08 NICUP14