Dear Araq, how do I create a programming language?

2024-04-18 Thread sei
Hi bajith, I recently stumbled upon this: [My First Language Frontend with LLVM Tutorial](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html) Maybe that could serve as a starting point.

Use of typeof() in object member definition inside macro fails

2024-04-15 Thread sei
Hi Beef, your help is appreciated and valuable as always, and your suggestion solves my problem, thanks a lot! Interestingly using `typeof(T.color)` outside the macro does indeed compile and work, maybe a bug in the compiler? But of course using `default()` does make much more sense :)

Use of typeof() in object member definition inside macro fails

2024-04-14 Thread sei
Hi y'all! I wrote a macro for conveniently declaring widget types when using [traitor](https://github.com/beef331/traitor), it is used to create a type that conforms to the interface built with traitor with the corresponding member variables. The widget type is generic, where the parameter is t

Trying to get "interfaced" to run with latest nim

2024-04-09 Thread sei
Just for reference: I tried `traitor` as suggested by Beef and it works like a charm!

Trying to get "interfaced" to run with latest nim

2024-04-07 Thread sei
Hi Beef, thanks again for your help! I think I now better understand what the macro is actually doing, and at the moment I suspect it might be the same problem as here: I'll wait for a fix, and if it still won't work, I try it with traitor, which

Trying to get "interfaced" to run with latest nim

2024-04-06 Thread sei
/test_expanded.nim> This compiles fine (`nim --run compile test_expanded.nim`). But if I try to compile the original test (`nim --run compile test`), I get this error: `/home/sei/git/interfaced/interfaced.nim(54, 20) Error: internal error: environment misses: this` I'm a bit in over my head with this, so hopefully someone here knows how to fix this.

Which Nim Paradigm could I use instead of OOP with Generics and Inheritance?

2024-03-29 Thread sei
Hi Beef, thanks a lot for your suggestions! Not sure if want to go down the pointer road, but gooey looks like it is what I need! I'll try and rip out its skeleton so I can adapt it :)

Which Nim Paradigm could I use instead of OOP with Generics and Inheritance?

2024-03-28 Thread sei
Hi y'all! I'm working on graphics/ui Library for the fantastic [picostdlib](https://forum.nim-lang.org/postActivity.xml#picostdlib) (actually I'm using the nice [rework](https://forum.nim-lang.org/postActivity.xml#rework)) Right now I'm pondering on how to organize the widgets and make them si

Reuse generic Type of Concept as field Type of another generic Type

2023-10-28 Thread sei
Yes it works and looks simple enough, many thanks!

Reuse generic Type of Concept as field Type of another generic Type

2023-10-28 Thread sei
Hi y'all! I'm trying to reuse the type `T` of a generic concept `AnyFoo[T]` as a type of a field of another generic `Bar[A: AnyFoo]`, the code looks like this: type AnyFoo[T] = concept foo foo.color is T TheFoo = object color: int Bar[

Using Concepts for abstracting display graphics

2023-10-18 Thread sei
Thanks for the handy tutorial, quite a nice color scheme you have there :)

Using Concepts for abstracting display graphics

2023-10-18 Thread sei
Ah I see, I looked at the repo a while ago but haven't tried it yet, maybe I should!

Using Concepts for abstracting display graphics

2023-10-18 Thread sei
That's quite a lot stuff you have in your repo, I will definitively check it out, thanks!

Using Concepts for abstracting display graphics

2023-10-18 Thread sei
Thank you very much, that works perfectly! I've to read about `mixin` though, haven't encountered that so far :)

Using Concepts for abstracting display graphics

2023-10-17 Thread sei
Ah thanks! Missed that one entiely, I removed the color argument and now the `disp: AnyDisplay[T]` argument of `drawQuad` is matched correctly. Unfortunately, it still does not compile, and fails to match the first argument of `setPixel`: /home/sei/projects/nimoled/test.nim(50, 5

Using Concepts for abstracting display graphics

2023-10-17 Thread sei
Thank you for your suggestion, but I'm afraid that won't quite work for me: This library will only be useful embedded programming, and the difficulty with these kinds of displays is that you can have a variety of color types, such as monochromatic with on byte describing 8 pixels, or 16 bit colo

Using Concepts for abstracting display graphics

2023-10-17 Thread sei
bitor(disp.framebuffer[index],shift) else: disp.framebuffer[index] = bitand(disp.framebuffer[index],shift) var disp: SSD1309 disp.drawQuad(12,34,1) Run Unfortunately, this does not compile: /home/sei/projects/nimoled