00:46:07 | FromDiscord | <nervecenter> In reply to @majortrips1763 "Hmm .. anyone know": also https://nim-lang.org/docs/unittest.html |
00:47:30 | FromDiscord | <eightbit_dboy> Is it possible to use macros to create the futhark `importc` statements? |
00:48:13 | FromDiscord | <eightbit_dboy> Because that's what I'm trying to do here, but getting this error: https://media.discordapp.net/attachments/371759389889003532/1293736809909588061/create_wrapper.nim?ex=670875cb&is=6707244b&hm=dfbd88e81d8dbc132fe7b2d016307716cd22537af7a3e5f356835f094a9c307d& https://media.discordapp.net/attachments/371759389889003532/1293736810295590953/image.png?ex=670875cc&is=6707244c&hm=c04117734d932e286fd98edf3e8e515b593e5544ca05099f893ff9046a2e |
00:58:13 | * | tiorock joined #nim |
00:58:13 | * | tiorock quit (Changing host) |
00:58:13 | * | tiorock joined #nim |
00:58:13 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
00:58:13 | * | tiorock is now known as rockcavera |
01:54:42 | * | ryuukk quit (Ping timeout: 265 seconds) |
01:54:49 | * | ryuukk_ joined #nim |
02:55:03 | FromDiscord | <ardisan_> What is the benefits of using Zig compiler with Nim? I tried it and noticed my program performed faster and was reduced in size but as a newb I'd like to learn anything more. |
02:56:31 | FromDiscord | <leorize> it's easier to cross-compile |
02:57:13 | FromDiscord | <leorize> you can get the same benefits by using clang directly if you don't care about the cross-compilation part, since zig just employ libclang to perform compilation for Nim use case |
03:02:45 | FromDiscord | <ardisan_> Oh alright I'll just use it then since I will probably cross compile someday. |
03:04:44 | FromDiscord | <determiedmech1> is there an easy way to update all my nimble packages |
03:05:10 | FromDiscord | <determiedmech1> currently im just using a little ruby script |
03:05:32 | FromDiscord | <determiedmech1> sent a code paste, see https://play.nim-lang.org/#pasty=QNQKciDp |
03:05:47 | FromDiscord | <determiedmech1> (edit) "https://play.nim-lang.org/#pasty=hnOqAyOf" => "https://play.nim-lang.org/#pasty=iWbpdMJs" |
03:06:25 | FromDiscord | <determiedmech1> (edit) "https://play.nim-lang.org/#pasty=cNMVsuDu" => "https://play.nim-lang.org/#pasty=cYAelfxJ" |
03:07:22 | FromDiscord | <leorize> don't↵(@determiedmech1) |
03:07:32 | FromDiscord | <determiedmech1> oh |
03:07:44 | FromDiscord | <determiedmech1> i see |
03:07:48 | FromDiscord | <determiedmech1> why |
03:08:09 | FromDiscord | <leorize> the packages you have should be selected to have the "right" version for the project you build |
03:08:17 | FromDiscord | <determiedmech1> ah |
03:08:28 | FromDiscord | <leorize> because packages can have breaking changes between releases, which make your software stops compiling |
03:09:13 | FromDiscord | <leorize> `nimble --localdeps` is useful for having package storage scoped for a particular project |
03:09:31 | FromDiscord | <determiedmech1> oh i actually didnt know about localdeps lol |
03:09:33 | FromDiscord | <determiedmech1> thx |
03:10:08 | FromDiscord | <leorize> I'm not sure if it's still the case now, but it used to be that you can have package version conflicts in the global store that'd break all of your projects |
03:11:37 | FromDiscord | <leorize> or your project would compile today, build another project which changes the global package store and suddenly your project wouldn't compile anymore |
03:11:55 | FromDiscord | <leorize> I heard that new nimble is a lot better now, but some scars doesn't fade |
03:25:55 | * | rockcavera quit (Remote host closed the connection) |
04:08:25 | * | SchweinDeBurg joined #nim |
04:19:27 | FromDiscord | <eightbit_dboy> Is it possible to use macro expansion to generate `futhark` `importc` statements? |
04:19:33 | FromDiscord | <eightbit_dboy> I'm trying to do that, but it's not working. |
04:20:11 | FromDiscord | <eightbit_dboy> https://media.discordapp.net/attachments/371759389889003532/1293790155588505700/image.png?ex=6708a77a&is=670755fa&hm=24b9abe68b819c4a0322af8dfb2e2756e2ba47c461821ca69ca5a82fe811daf9& |
04:20:45 | FromDiscord | <Elegantbeef> use a template |
04:20:58 | FromDiscord | <eightbit_dboy> Ah, so the `[T]` stuff? |
04:21:04 | FromDiscord | <Elegantbeef> No |
04:21:08 | FromDiscord | <Elegantbeef> Use a template |
04:21:52 | FromDiscord | <eightbit_dboy> I thought the `[T]` stuff in Nim was templates, lemme look into it. |
04:22:16 | FromDiscord | <eightbit_dboy> aH |
04:22:20 | FromDiscord | <eightbit_dboy> (edit) "aH" => "Ah." |
04:22:51 | FromDiscord | <eightbit_dboy> So templates expand to whatever's inside them? |
04:25:48 | FromDiscord | <eightbit_dboy> So I changed it to this, but that gives me the following output: https://media.discordapp.net/attachments/371759389889003532/1293791566972059658/image.png?ex=6708a8cb&is=6707574b&hm=e8c599a57bfabaaec9e9bc876bd8f6dc1738caef211dcfe0a118b0ff2a61ca12& https://media.discordapp.net/attachments/371759389889003532/1293791567215202304/image.png?ex=6708a8cb&is=6707574b&hm=01fe100a52cb682edacb3fabadcaeda5c99c8f5064093d20ac19a29c3a3a809f& |
04:26:23 | FromDiscord | <Elegantbeef> The issue is inside futhark |
04:26:29 | FromDiscord | <eightbit_dboy> Dang. |
04:26:37 | FromDiscord | <Elegantbeef> Futhark is likely doing `.strval` and expects a strlit there |
04:27:08 | FromDiscord | <eightbit_dboy> So I'll have to do the template expansion all myself in the text file? |
04:28:18 | FromDiscord | <Elegantbeef> Well you could make an issue on futhark |
04:28:25 | FromDiscord | <eightbit_dboy> Can do |
04:46:35 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=yERNZUnJ |
04:46:44 | FromDiscord | <TFed> how can i make that work |
04:46:55 | FromDiscord | <eightbit_dboy> Tables |
04:46:59 | FromDiscord | <Elegantbeef> `std/tables` |
04:47:03 | FromDiscord | <Elegantbeef> Or use an enum indexed array |
04:47:14 | FromDiscord | <eightbit_dboy> try `.toTable()` |
04:47:25 | FromDiscord | <Elegantbeef> Though look at `std/colors` and `std/terminal` |
04:49:17 | FromDiscord | <TFed> yup it works somehow |
04:50:09 | FromDiscord | <TFed> there is a problem, i need exactly to index by string |
04:50:42 | FromDiscord | <Elegantbeef> If you only need those colours do you really need to ? 😄 |
04:51:48 | FromDiscord | <TFed> i need to take input from terminal in text form |
04:51:58 | FromDiscord | <Elegantbeef> But you can just do `import std/[color, terminal]; echo parseColor("blue").ansiForegroundColorCode(), "hello")` |
04:52:51 | FromDiscord | <Elegantbeef> `std/color` and `std/terminal` handle this all |
04:53:18 | FromDiscord | <TFed> I'll give it try, if i can use colors from std library this way, that would be nice |
04:54:09 | FromDiscord | <TFed> anyway, also nice to know how build dict as well😏 |
05:14:10 | FromDiscord | <basilajith> Is there a Nim alternative for https://github.com/thoughtworks/pii-anonymizer? |
05:15:44 | * | disso-peach quit (Quit: Leaving) |
05:23:19 | FromDiscord | <odexine> No |
05:23:23 | FromDiscord | <odexine> Not as of now |
05:23:27 | FromDiscord | <odexine> Sounds like a good project though |
05:28:18 | FromDiscord | <basilajith> Oh, okay. |
06:27:30 | * | PMunch joined #nim |
06:43:30 | FromDiscord | <TFed> once again a forgot to mention, what app I'm working on.... It's a tiny highlight command |
06:44:12 | FromDiscord | <TFed> so i need to store colors inside of the string as well |
06:46:47 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=orDDZiUx |
06:46:56 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=IruxBOJf |
06:47:37 | FromDiscord | <TFed> i can't concatenate colors this way... |
06:47:55 | FromDiscord | <Elegantbeef> `ansiResetCode()` |
06:48:01 | FromDiscord | <Elegantbeef> There is also `styledWrite` |
06:48:32 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=dTNOWDTl |
06:48:41 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=JQzGhAJG |
06:49:25 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=RHujeFor |
06:53:38 | FromDiscord | <TFed> as i said it's not for output, my code works, anyway |
06:54:00 | FromDiscord | <TFed> as i said it's not for output, does not matter, my code works anyway |
06:54:09 | FromDiscord | <Elegantbeef> You never said it was for output, but yes you can concatenate colours using `parseColor` |
06:54:22 | FromDiscord | <Elegantbeef> not for output\ 😄 |
06:55:17 | FromDiscord | <TFed> yup, i did not, sorry😅 |
06:55:42 | FromDiscord | <TFed> yup, i did not, sorry😅, i thought i did |
06:56:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=czEKkFOM |
06:58:47 | FromDiscord | <TFed> it was my mistake, i never said that it's not for output, i should provide more info about what i'm trying todo 🙂 |
07:01:41 | FromDiscord | <Elegantbeef> I have to applaud the introspection in your process, even though there is no need to admit to anything 😄 |
07:02:45 | Amun-Ra | hmm, I've done something bad in CT, I have "Error: unhandled exception: cannot extract number from invalid AST node [ERecoverableError]" on nim pre 2.2.0 |
07:03:30 | FromDiscord | <Elegantbeef> This is why we need a debug compiler |
07:05:22 | FromDiscord | <Elegantbeef> Well that error message only appears in 3 procedures so it's likely related to where you're attempting to get an ordinal or a float |
07:05:30 | FromDiscord | <Elegantbeef> So ensure you do not do anything funky |
07:06:41 | Amun-Ra | I've found the culprit: let colors = palette.splitWhitespace.mapIt it.parseHexInt |
07:07:11 | FromDiscord | <Elegantbeef> That does not seem like it'd cause an issue |
07:07:36 | Amun-Ra | I commented it out and it compiles fine |
07:08:20 | Amun-Ra | at least that file ;) |
07:09:10 | Amun-Ra | no, you're right, I'm blind |
07:09:34 | FromDiscord | <Elegantbeef> I always am, when I am |
07:10:00 | Amun-Ra | ;) |
07:24:44 | Amun-Ra | I have a function that reads a string of "rrggbb rrggbb" data and creates an array of RColor objects |
07:25:08 | Amun-Ra | it was declared as: proc parse_color_palette*[N: static[uint]](palette: string): array[N, RColor] {.compiletime, raises: ValueError.} |
07:25:29 | Amun-Ra | a few days ago (I git blamed myself), I changed it to: |
07:25:35 | Amun-Ra | it was declared as: proc parse_color_palette*[N: static[uint]](palette: static string): array[N, RColor] {.compiletime, raises: ValueError.} |
07:27:31 | Amun-Ra | even func with empty body gives that error |
07:30:21 | Amun-Ra | play.nim shows different, more clear error: "Error: cannot generate code for: N", hmm… |
07:37:12 | Amun-Ra | git clone to a fresh directory; git checkout v2.0.8; ./build_all and now I can see that error too |
07:38:23 | Amun-Ra | previous installation was built after checking v2.0.8 from v2.0.6 |
08:44:48 | Amun-Ra | I rebuilt all nim 2 version from scratch and now everything's hunky dory |
08:48:52 | FromDiscord | <Elegantbeef> Must've been a cosmic ray corrupting your install |
08:49:58 | Amun-Ra | mhm |
08:50:31 | Amun-Ra | or, what's more probable, pebkac |
08:50:53 | FromDiscord | <Elegantbeef> Blame the first, then if that fails the second |
08:51:00 | Amun-Ra | ;) |
08:57:57 | FromDiscord | <spotlightkid> I have a custom task in the nimble file of my library wrapper project, which compiles some examples. These examples should not be installed with `nimble install`. How can I define a `require` just for this task? The dependency is not needed for the normal install of the wrapper. |
08:58:34 | * | Artea joined #nim |
08:59:06 | FromDiscord | <spotlightkid> Do I need to create a separate nimble file in my `examples` folder? |
09:05:51 | PMunch | Hmm, I guess you could throw in a `when not defined(examples)` or something like that |
09:05:59 | PMunch | Nimble files are NimScript after all |
09:06:44 | PMunch | Not sure how subcommands are done in NimScript, but you might be able to just do a static check on whether the task runs or not |
09:08:13 | Amun-Ra | is 'requires' required to be on top level? |
09:09:26 | Amun-Ra | is not I wonder whether requires inside a task would work |
09:10:29 | FromDiscord | <spotlightkid> Nope. tried that. Doesn't work. Required dependency not found.↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
09:12:04 | FromDiscord | <Elegantbeef> There is a new `taskrequires` iirc |
09:19:08 | FromDiscord | <spotlightkid> that's it! `taskrequires("examples", "sdl2")` |
09:19:13 | FromDiscord | <spotlightkid> thanks, beef! |
09:20:05 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=KFCHsnSM |
09:20:18 | FromDiscord | <albassort> error at [1] DbConn != DbConn |
10:05:25 | FromDiscord | <eightbit_dboy> sent a code paste, see https://play.nim-lang.org/#pasty=cQJbmaIf |
11:18:03 | * | cnx quit (Ping timeout: 252 seconds) |
11:25:57 | * | ryuukk_ quit (Remote host closed the connection) |
11:26:14 | * | cnx joined #nim |
11:33:49 | * | ryuukk joined #nim |
11:35:50 | FromDiscord | <majortrips1763> Soo, any advice on writing an iterator that will not need `malloc()`, uses no new memory structures, and doesn't use yield? Thinking of doing `Type.next()` as that fits the bill, and is what I am used to. |
11:41:11 | FromDiscord | <odexine> What do you exactly mean by “use no new memory structures”? |
11:41:24 | FromDiscord | <odexine> Iterators require a state somewhere |
11:42:32 | FromDiscord | <demotomohiro> In reply to @majortrips1763 "Soo, any advice on": Default non-closure iterator is inlined and shoudn't allocate memory. |
11:42:48 | FromDiscord | <majortrips1763> The memory in question was already setup by the bootloader, so each member, even though they can all be different sizes, has the same leading structure, allowing me to cast the 1st entry to a structure which contains `{type, flags, size}`. So given the address of any of the members I can `obj.next()` to find the following entry. |
11:44:05 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
11:45:14 | FromDiscord | <demotomohiro> Do you need to use closure iterator and inline iterator doesn't work? |
11:46:28 | FromDiscord | <majortrips1763> I have yet to write any iterators. Picked the project to learn Nim .. I know what the memory looks like at the lowest level .. trying to understand the bestest Nim'ish solution that works when there is no allocator available .. and a temporary stack at that. |
11:47:37 | FromDiscord | <majortrips1763> The data structures I am iterating over describe the hardware, memory, devices, etc.. so I need to be able to process it all in order to initialize memory and get `malloc()` working. |
11:50:06 | FromDiscord | <majortrips1763> and .. realistically .. setup a long-term stack |
11:51:20 | FromDiscord | <majortrips1763> calling symantics are really no different than a singly linked list. Given any node, just return the next node in the list. |
11:52:08 | FromDiscord | <majortrips1763> Ahh, std/list does use `list.next()` |
11:52:17 | FromDiscord | <majortrips1763> (edit) "std/list" => "std/lists" |
11:54:12 | FromDiscord | <majortrips1763> I will just go that route as it is the closest analog. Each node doesn't actually have a pointer to the next node .. have to compute it, but the end result is the same. |
12:06:51 | FromDiscord | <demotomohiro> `list.next` is just a ref type field points to next node. Probably `iterator items` is what you want to read to learn about an iterator. |
12:09:34 | FromDiscord | <majortrips1763> Hmm |
12:11:01 | FromDiscord | <majortrips1763> Doesn't that expect each item to be the same size? |
12:13:45 | FromDiscord | <demotomohiro> inline iterator doesn't expect each item to be the same size. |
12:13:48 | FromDiscord | <majortrips1763> Oh, I see how it is implemented for characters in a string.. interesting |
12:14:15 | FromDiscord | <majortrips1763> What is `yield` doing in Nim? |
12:16:05 | FromDiscord | <demotomohiro> inline iterator just transform AST. Data structor you iterate doesn't matter. |
12:17:37 | FromDiscord | <majortrips1763> Was curious about the the stack behavior honestly. Trying to understand as much as I can about all of it. |
12:18:35 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=bnBaYmNs |
12:19:53 | FromDiscord | <demotomohiro> Inline iterator works like template, but `yield x` is replaced with for loop body. |
12:20:36 | FromDiscord | <majortrips1763> Interesting. Thanks! |
12:21:01 | FromDiscord | <majortrips1763> Okay .. so .. next up .. the structure param I am passing to this proc needs to be a ptr ... |
12:21:13 | FromDiscord | <majortrips1763> No copies, no refs, no GC |
12:30:57 | FromDiscord | <majortrips1763> Okay, so .. now .. do I re-cast the result from the iterator into the proper structure type, or let the caller do that... |
12:38:32 | FromDiscord | <demotomohiro> Type of the iterator yields cannot be changed at runtime. |
12:39:27 | FromDiscord | <majortrips1763> Good to know. That fits my decision to make the caller cast things as they see fit. |
12:54:45 | FromDiscord | <tauruuuuuus> Think I've encountered a gencode bug https://media.discordapp.net/attachments/371759389889003532/1293919650652094546/image.png?ex=67092014&is=6707ce94&hm=924d5131fd5003ff2b0a64f4dc098f02ef35b227fc026248d39fc521d3e9e99a& |
12:54:50 | FromDiscord | <tauruuuuuus> on v2.2.0 |
12:55:53 | FromDiscord | <einjonas> what is gencode? |
13:01:14 | FromDiscord | <tauruuuuuus> lol meant to say codegen |
13:18:41 | FromDiscord | <olfactoryhallucinations> sent a code paste, see https://play.nim-lang.org/#pasty=HVTYElxS |
13:27:49 | FromDiscord | <majortrips1763> So, I have this memory packed list of structures, where each structure can be of a different type. I can identify and itterate them fine, but I am sort of trying to figure out some way to write the iterator such that I can do something like `for entry in header of type <type>` |
13:31:32 | FromDiscord | <majortrips1763> I suppose the larger issue is that I am trying to avoid touching memory too much, so I could likely setup a ptr to the first entry of a given type in a list and then have an itterator that can leverage that data to act as an iterator... 🤔 |
13:42:39 | FromDiscord | <majortrips1763> Oh .. subtypes might help... |
13:56:06 | * | ntat joined #nim |
13:57:20 | FromDiscord | <majortrips1763> Hmm .. doesn't look like I can use subtypes .. |
14:00:50 | * | ryuukk quit (Remote host closed the connection) |
14:02:22 | * | ryuukk joined #nim |
14:17:25 | * | SchweinDeBurg joined #nim |
14:45:29 | FromDiscord | <majortrips1763> Can enums be given a type such as uint32? |
14:53:52 | FromDiscord | <fabric.input_output> uh `type Enum {.size: sizeof(uint32).}` = enum ...` something like that |
15:59:26 | FromDiscord | <majortrips1763> is there a bitfield type? |
16:01:24 | FromDiscord | <majortrips1763> Basically something like an enum, but understands that it is dealing with bit flags.. would kinda of be nice to support checks that validate an undefined bit isn't being set. |
16:08:20 | FromDiscord | <tauruuuuuus> In reply to @majortrips1763 "is there a bitfield": https://nim-lang.org/docs/tut1.html#sets-bit-fields |
16:14:04 | * | xet7 quit (Remote host closed the connection) |
16:16:17 | FromDiscord | <majortrips1763> In reply to @tauruuuuuus "https://nim-lang.org/docs/tut1.html#sets-bit-fields": Perfect |
16:25:40 | FromDiscord | <tauruuuuuus> This is one of my favorite things about Nim actually |
16:30:16 | FromDiscord | <tauruuuuuus> You can use set semantics and notation for tests and initialisation with that |
16:34:03 | FromDiscord | <kryp7on> In reply to @m4ul3r "Nim is absolutely a": sry for replying to months old msg haha, but, my question is: how Nim is interoperable with C? Can you just import C library like you can in Zig? |
16:35:50 | FromDiscord | <m4ul3r> In reply to @kryp7on "sry for replying to": https://nim-lang.org/docs/manual.html#foreign-function-interface |
16:35:51 | FromDiscord | <kryp7on> zig |
16:35:56 | FromDiscord | <tauruuuuuus> FFI is really easy, you just annotate a procedure definition and it brings in the c symbol |
16:36:42 | FromDiscord | <m4ul3r> Not sure how easy it is with zig, but with nim it’s pretty easy. Furthark is a goatd library to wrap so files with ease. I use it quite often for stuff like capstone and unicorn |
16:37:03 | Amun-Ra | kryp7on: there's no 1:1 equivalent of zig's cInclude |
16:38:59 | FromDiscord | <kryp7on> okay, I tried reading this docs u sent but I cant see how I can import C source code that someone already made, called `example.c` for example |
16:41:59 | FromDiscord | <kryp7on> also, I see that you can manually manage program's memory but you can also use GC. Is it possible that in your program, you manually manipulate memory then switch to GC. Bcs I am sometimes doing low level memory management but sometimes in the code I dont need manually management and just want to use GC. Is that possible? |
16:48:52 | Amun-Ra | you can turn gc on or off during compilation, basic types etc are not gc collected |
16:49:40 | * | om3ga joined #nim |
16:49:45 | Amun-Ra | refs, strings, seqs use gc |
16:51:42 | FromDiscord | <kryp7on> In reply to @Amun-Ra "you can turn gc": I meant like, can I switch to memory management in SOURCE CODE? Not when I need to compile program? |
16:51:57 | FromDiscord | <kryp7on> like, in one part of my software, i manually map memory, then I dont and just use GC? |
16:51:59 | Amun-Ra | IIRC not in runtime |
16:53:27 | FromDiscord | <majortrips1763> Like defining structures/data that you want the GC to ignore? |
16:54:25 | Amun-Ra | you can't write code without using the gc, I don't know how strings behave without one (no free?), probably you'll have to roll your own string type in that case |
16:55:36 | FromDiscord | <majortrips1763> I am honestly not really following the use case, though from my experience so far, you can certainly grab memory that isn't under the GC's control. |
16:56:05 | Amun-Ra | I wrote low level code in nim, but I haven't used stdlib ad all |
16:56:07 | Amun-Ra | at* |
16:57:43 | Amun-Ra | there is create, resize and dealloc - low level functions that work on pointers |
16:58:36 | FromDiscord | <majortrips1763> I am currently working on a module to "hopefully" handle multiboot1/multiboot2... it is my first real project in Nim so I am certainly fumbling through a few things, but at the end of the day I am finding it quite a bit more powerful as a low level language than I expected... I have been interfacing to both C and ASM directly. |
16:59:11 | Amun-Ra | nice |
16:59:44 | FromDiscord | <majortrips1763> holy crud I have too many tabs open .. in too many windows.. |
17:02:01 | Amun-Ra | that's what memory is for ;) |
17:02:37 | FromDiscord | <classid> Could y'all give me a cool project idea, rather something new without reinventing the wheel, or perhaps even perfecting something |
17:03:04 | FromDiscord | <classid> Doesn't matter if it's a fun and bullshittery idea |
17:03:08 | Amun-Ra | is there something you wanted to write since eons? |
17:03:10 | FromDiscord | <classid> cool |
17:03:34 | FromDiscord | <majortrips1763> Yah .. just no good way to find the tab I was looking for. @demotomohiro has some very low-level code that has examples of compiling/linking .S files and interacting with low-level memory and cstrings and such.↵↵https://github.com/demotomohiro/MinimumNimPico/blob/main/src/startup.nim |
17:04:12 | FromDiscord | <majortrips1763> Also, https://github.com/demotomohiro/MinimumNimPico/blob/main/src/uartReg.nim#L7 |
17:16:35 | * | disso-peach joined #nim |
17:35:47 | FromDiscord | <double_spiral> does `readFile` understand relative paths? ie `../assets/example.txt` |
17:38:29 | Amun-Ra | yes |
18:16:58 | * | coldfeet joined #nim |
18:43:19 | * | disso-peach quit (Ping timeout: 252 seconds) |
18:47:20 | FromDiscord | <double_spiral> So is `glGetUniformLocation` just not wrapped in the offical nim openGL bindings? I cant seem to find it |
18:48:07 | FromDiscord | <double_spiral> Or is that more of a glfw thing? Still considerably new to this |
18:48:45 | FromDiscord | <double_spiral> Not in there either |
18:50:00 | FromDiscord | <double_spiral> Nvm found it, the lsp was being weird and grep is case sensitive :) |
19:05:01 | * | beholders_eye joined #nim |
19:22:40 | * | PMunch_ joined #nim |
19:27:09 | PMunch_ | Hmm, thinking of doing an example for my NimConf talk, anyone got a library with which I could create a short sample? |
19:28:17 | * | beholders_eye quit (Ping timeout: 252 seconds) |
19:29:27 | * | Batzy_ joined #nim |
19:29:45 | FromDiscord | <jmgomez> In reply to @PMunch_ "Hmm, thinking of doing": A driver for something like mongo, redis or a db can be a great showcase. Not sure if the scope is too big though |
19:30:57 | PMunch_ | I mean the scope of the project doesn't really matter |
19:31:06 | PMunch_ | I just need the example snippet to be short |
19:31:56 | * | Batzy quit (Ping timeout: 255 seconds) |
19:53:17 | * | ntat quit (Quit: Leaving) |
20:22:22 | * | lain left #nim (kthxbai) |
20:34:24 | * | PMunch_ quit (Quit: leaving) |
20:48:24 | FromDiscord | <kiloneie> The flashier the better |
20:59:41 | * | coldfeet quit (Remote host closed the connection) |
21:29:12 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=XRVGSJqG |
21:34:17 | FromDiscord | <Elegantbeef> @albassort are you `include`ing? |
21:34:22 | FromDiscord | <Elegantbeef> Do you have multiple modules with dbconn? |
21:39:57 | FromDiscord | <albassort> i have multiple modules with db_sqlite |
21:40:04 | FromDiscord | <albassort> im not using include |
21:43:49 | strogon14_ | PMunch: something like https://www.nayuki.io/page/qr-code-generator-library maybe? |
21:54:22 | FromDiscord | <Robyn [She/Her]> Can I force Nimble to install a package even with incompatible versions? |
22:01:23 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=lSiTQotX |
22:01:41 | FromDiscord | <majortrips1763> (edit) "https://play.nim-lang.org/#pasty=uhDHoUkR" => "https://play.nim-lang.org/#pasty=uUgLYIsP" |
22:05:02 | FromDiscord | <Elegantbeef> Yes if you use inhertiance it implicitly dispatches |
22:09:34 | * | krux02 joined #nim |
22:10:49 | * | krux02 quit (Client Quit) |
22:14:46 | * | rockcavera joined #nim |
22:49:20 | FromDiscord | <eightbit_dboy> What do I put in a `config.nims` in order to get it to build for the SH-4 cpu? |
22:49:57 | FromDiscord | <eightbit_dboy> Because apparently `sh4` isn't one of the options, and I didn't see anything SuperH-related there. |
22:51:15 | FromDiscord | <Elegantbeef> > The SH-4 is a RISC CPU |
22:52:05 | FromDiscord | <eightbit_dboy> Yes |
22:52:24 | FromDiscord | <eightbit_dboy> Is there a generic RISC option that could work? |
22:53:49 | FromDiscord | <eightbit_dboy> > m68k↵Well, at least I could target the Sega Genesis. |
23:07:01 | FromDiscord | <muddmaker> Looks like a PR would be required to add SuperH to the TSystemCPU enum |
23:07:41 | FromDiscord | <eightbit_dboy> Is it possible to bypass this? |
23:08:26 | FromDiscord | <Elegantbeef> Target a similar CPU and hope that the compiler for your target is compatible with that generated code |
23:08:32 | FromDiscord | <Elegantbeef> Though it's more sensible to make a PR |
23:09:06 | FromDiscord | <muddmaker> Different RISCs are not compatible with each other. SuperH is a bit unique |
23:09:40 | FromDiscord | <Elegantbeef> Well there is not much raw asm in Nim, so it's mostly hoping that things are compatible, but yea add the target |
23:10:44 | FromDiscord | <Elegantbeef> Since Nim emits C and does not really use much ASM you might be able to just grab a target that has the same specs as your desired and hope that it works |
23:11:52 | FromDiscord | <eightbit_dboy> I omitted the `cpu` flag and at least the output was different: https://media.discordapp.net/attachments/371759389889003532/1294074953230192660/message.txt?ex=6709b0b7&is=67085f37&hm=93b630a7a060eac83436bb35666849350e701bfcb5e5800090b926be14e5fe05& |
23:12:18 | FromDiscord | <muddmaker> The PR to add loongarch64 was just +13,-4 |
23:12:45 | FromDiscord | <Elegantbeef> Omitting the cpu flag will target your CPU which likely is amd64... which is a whole lot of wrong I imagine |
23:14:42 | FromDiscord | <eightbit_dboy> Hmm |
23:50:47 | FromDiscord | <eightbit_dboy> Is there a CPU flag to have it not spit out any ASM? |
23:52:22 | FromDiscord | <muddmaker> You can dump the C source, but that's not guaranteed to be portable because of pointer sizes and the like |