00:38:41 | * | tk_ joined #nim |
00:38:56 | * | nmz- joined #nim |
00:39:04 | * | ox joined #nim |
00:39:04 | * | cm_ joined #nim |
00:39:08 | * | alice quit (Killed (lithium.libera.chat (Nickname regained by services))) |
00:39:10 | * | alice joined #nim |
00:40:40 | * | Jjp137 quit (Ping timeout: 268 seconds) |
00:40:40 | * | tk quit (Ping timeout: 268 seconds) |
00:40:40 | * | oz quit (Ping timeout: 268 seconds) |
00:40:40 | * | nmz quit (Ping timeout: 268 seconds) |
00:40:40 | * | cm quit (Ping timeout: 268 seconds) |
00:40:42 | * | cm_ is now known as cm |
00:40:52 | * | tk_ is now known as tk |
00:48:52 | NimEventer | New Nimble package! dlutils - Nim package for easy shared library loading., see https://github.com/amnr/dlutils |
00:51:24 | Amun-Ra | \o/ |
01:05:01 | * | Mister_Magister quit (Quit: bye) |
01:05:55 | * | krux02 quit (Remote host closed the connection) |
01:06:54 | * | Mister_Magister joined #nim |
01:07:23 | * | jay-tuckey joined #nim |
01:21:14 | * | jay-tuckey quit (Ping timeout: 268 seconds) |
01:50:51 | FromDiscord | <exelotl> woah! this showed up right when I needed it haha |
01:55:57 | Amun-Ra | my first registered package ;) |
01:57:00 | * | jay-tuckey joined #nim |
02:15:25 | NimEventer | New thread by dsrw: Brackets and unary operators, see https://forum.nim-lang.org/t/10688 |
02:29:30 | NimEventer | New thread by thedistantforest: Using the var type to modify a separate object from another, see https://forum.nim-lang.org/t/10689 |
02:47:29 | * | Jjp137 joined #nim |
03:19:13 | * | cm quit (Quit: Bye.) |
03:19:32 | * | cm joined #nim |
03:39:11 | FromDiscord | <Elegantbeef> Amun-ra is the abillity to reassign these procs a feature or a bug? |
05:19:27 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4MAq |
05:21:00 | FromDiscord | <sOkam! 🫐> In reply to @user2m "How would I go": tried `= typeof(nil)`? 🤔 |
05:21:34 | FromDiscord | <sOkam! 🫐> likely wont work, but its probably not finding T because it cannot assign `nil` to `typedesc[T]` |
05:21:54 | FromDiscord | <jviega> Nil is a value it doesn’t have a single type |
05:22:03 | FromDiscord | <jviega> So it’s ambiguous |
05:22:17 | FromDiscord | <user2m> In reply to @heysokam "likely wont work, but": yeah that seems to be the issue. i've gotten around this with simple proc overloading but id love to have schema be an optional value |
05:22:34 | FromDiscord | <user2m> less code to write |
05:23:47 | FromDiscord | <sOkam! 🫐> @user2m first thought is to do `type NilType = distinct uint8` and asign that to the default↵it won't do anything, and you can keep it private, just for that proc in case you are not using it anywhere else |
05:23:48 | FromDiscord | <Elegantbeef> Just make two overloads |
05:24:05 | FromDiscord | <sOkam! 🫐> or two overloads, which is really the proper way indeed |
05:25:20 | FromDiscord | <Elegantbeef> `proc test(query: string)` and `proc test(query: string, T: typedesc)` |
05:25:50 | FromDiscord | <user2m> yeah I'm currently using overloads but if I can write less code then better |
05:27:18 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4MAr |
05:27:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4MAs |
05:28:04 | FromDiscord | <Elegantbeef> Your code should be `[T: typedesc](..; T= typeof(nil))` if you want an explicit generic |
05:28:19 | FromDiscord | <user2m> hmm that just might be it! |
05:28:27 | FromDiscord | <Elegantbeef> `typedesc[T]` means you never can infer `T` if you do not supply a value |
05:28:46 | FromDiscord | <Elegantbeef> I still say do not use generics to represent overloads |
05:29:16 | FromDiscord | <user2m> ahh ok I see |
05:29:34 | FromDiscord | <Elegantbeef> I cannot stop you from doing it, but I can judge you deeply |
05:29:41 | FromDiscord | <sOkam! 🫐> 🙈 |
05:31:40 | FromDiscord | <user2m> LOL I'll implement a test version of this in the actual code and if it doesn't have your approval I'll strike it 😂 I'm working on a JSON db which is just a port of this awesome library https://tinydb.readthedocs.io/en/latest/ |
05:33:04 | FromDiscord | <ElegantBeef> "json db" jesus people are unhinged |
05:35:20 | FromDiscord | <user2m> Lol you'd be surprised. Obviously not for prod. But it's great for quick MVPs and mockups |
05:35:37 | FromDiscord | <Elegantbeef> Next week someone will ask about yaml gameplay scripting |
05:35:47 | FromDiscord | <Elegantbeef> Yay bridge is low latency agaain |
05:40:54 | * | Guest22 joined #nim |
05:42:07 | * | Guest22 quit (Client Quit) |
05:54:43 | FromDiscord | <odexine> CI-driven gameplay |
06:46:07 | NimEventer | New question by Nate Ackerman: Why is my call of a nim template not simply expanding the template code?, see https://stackoverflow.com/questions/77554955/why-is-my-call-of-a-nim-template-not-simply-expanding-the-template-code |
06:52:31 | * | azimut quit (Ping timeout: 240 seconds) |
07:06:48 | * | advesperacit joined #nim |
07:07:43 | * | mal`` joined #nim |
07:08:13 | * | mal``` quit (Ping timeout: 276 seconds) |
07:36:20 | Amun-Ra | Elegantbeef: feature |
07:37:56 | FromDiscord | <Elegantbeef> Probably should have a feature that uses `let` instead of `var` |
07:41:28 | Amun-Ra | that would work in nim 2.0 but closing library wouldn't |
07:42:12 | Amun-Ra | I use that for declaring low level abi, and then create high level nim api on the top |
07:42:41 | FromDiscord | <Elegantbeef> Why wouldn't that work for closing? |
07:42:51 | FromDiscord | <Elegantbeef> You can use `.addr` to override variable mutabillity |
07:42:59 | Amun-Ra | hmm |
07:43:04 | * | PMunch joined #nim |
07:43:06 | FromDiscord | <nnsee> In reply to @user2m "LOL I'll implement a": not to hate on your work, but... dear god why does this exist |
07:43:26 | FromDiscord | <nnsee> "indexing"? what indexing? |
07:43:48 | Amun-Ra | Elegantbeef: but if anyone can do that that it's almost the same as keeping these pointers var |
07:43:55 | FromDiscord | <nnsee> just seems like the added overhead of having to interact with a db with literally none of the benefits |
07:44:04 | Amun-Ra | I didn't know you can do that, btw |
07:44:29 | FromDiscord | <Elegantbeef> Using that logic why use `let` whatsoever |
07:44:40 | FromDiscord | <Elegantbeef> The point is to show intent, and to reduce the scope of possible errors |
07:44:55 | FromDiscord | <Elegantbeef> someone doing `myProc.addr[] = myOtherProc` is a clear sign they need to get shot |
07:45:12 | FromDiscord | <Elegantbeef> someone doing `myProc = myOtherProc` is passable mistake that is much easier to miss |
07:47:05 | Amun-Ra | that may be a good idea |
07:47:33 | FromDiscord | <Elegantbeef> Plus it makes it symmetric with normal procs, they cannot be assigned to by default 😛 |
07:47:45 | Amun-Ra | :) |
07:53:35 | Amun-Ra | works like a charm, thanks Elegantbeef :) https://play.nim-lang.org/#ix=4MAS |
07:53:52 | FromDiscord | <Elegantbeef> Would I lie to you? |
07:54:11 | Amun-Ra | I'll implement setting custom name too, like {.importc: "nameonnimside".} |
07:54:14 | Amun-Ra | never :> |
07:59:23 | FromDiscord | <Elegantbeef> You also do not specify the search path for loading libraries |
07:59:57 | FromDiscord | <Elegantbeef> Does it do binary directory + the system lib folder? |
08:00:37 | FromDiscord | <Elegantbeef> Wonder if you should have a `const searchPath {.strDefine:"dlutils.searchPath".} = ""` |
08:01:01 | FromDiscord | <Elegantbeef> That way you can do like `nim c -d:dlutils.searchPath:"$app/libs"` |
08:01:23 | FromDiscord | <Elegantbeef> Might defeat the purpose though I guess |
08:18:06 | * | jay-tuckey quit (Ping timeout: 268 seconds) |
08:27:01 | Amun-Ra | Elegantbeef: I test this on linux, linux uses paths defined in ld.so.conf, I'll test custom path |
08:31:50 | Amun-Ra | ah, dlopen already supports loading shared libraries from absolute paths |
08:32:46 | Amun-Ra | if path is relative it looks for shared library in: current directory, directory exec is located, LD_LIBRARY_PATH, ld.so |
08:50:52 | NimEventer | New question by Nate Ackerman: In nim is there a way to get a list of all procedures with a given name?, see https://stackoverflow.com/questions/77555562/in-nim-is-there-a-way-to-get-a-list-of-all-procedures-with-a-given-name |
09:03:49 | * | targz77 quit (Remote host closed the connection) |
09:17:26 | * | om3ga joined #nim |
09:44:24 | FromDiscord | <pmunch> In reply to @nnsee "not to hate on": Eh, I can see some benefit. Those times where you just want to store a couple small things, slightly too complex for just writing files, but not really complex enough to warrant running a proper database. |
09:48:58 | FromDiscord | <nnsee> i feel like the complexity barrier where simply serializing-deserializing json into a file doesn't make sense anymore is also the barrier where i start using sqlite |
09:53:59 | PMunch | Well if this was implemented in pure Nim like it seems they are doing that would mean it wouldn't really add any dependencies. |
09:54:20 | PMunch | I guess it all just depends on where you draw that complexity barrier though |
10:36:11 | FromDiscord | <Phil> In reply to @nnsee "i feel like the": In memory sqlite! Though honestly making a JSON file is way faster due to not needing to set up a schema |
11:10:00 | NimEventer | New Nimble package! whisper - Bindings for Whisper.cpp, see https://github.com/maleyva1/whisper |
12:21:24 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Next week someone will": I meaaan, it's possible |
13:03:14 | FromDiscord | <exelotl> Hmmm the fact that you can use `addr` to mutate a `let` is kind of an implementation detail, I wouldn't depend on it |
13:03:43 | FromDiscord | <ntzeno> In reply to @chronos.vitaqua "I meaaan, it's possible": please, no cursed stuff- |
13:04:40 | FromDiscord | <exelotl> For example if you do `let a = [1,2,3]` at the top-level then it gets marked as `const` in the C code so you can't change it |
13:06:19 | * | azimut joined #nim |
13:23:30 | om3ga | guys, what the heck is this: |
13:23:34 | om3ga | https://pastebin.pl/view/70bf3c8a |
13:24:02 | FromDiscord | <Chronos [She/Her]> In reply to @ntzeno "please, no cursed stuff-": :yeef: |
13:24:09 | FromDiscord | <Chronos [She/Her]> Also hi fellow transfem |
13:24:52 | FromDiscord | <Chronos [She/Her]> In reply to @om3ga "https://pastebin.pl/view/70bf3c8a": Something very odd, that's for sure↵How did this happen? Can you provide code? The platform you're on? |
13:25:01 | FromDiscord | <Chronos [She/Her]> Are you doing anything out of the ordinary? |
13:27:43 | om3ga | Chronos, this is that illegal instruction in Alpine Linux |
13:29:36 | om3ga | works everything fine when compiled in 64 bit |
13:30:34 | om3ga | Illegal instruction is with clang, while with gcc it reports overflow while parsing int from str |
13:31:40 | PMunch | Maybe clang tries to optimize something which causes that error when on certain platforms? |
13:32:38 | om3ga | maybe, I will try now debug with gcc, to find where and what overflows |
13:33:12 | FromDiscord | <pmunch> In reply to @NimEventer "New Nimble package! whisper": This looks pretty neat, might need to look into it for my audio-recording transcript thing |
13:34:22 | FromDiscord | <pmunch> Built a neat little script, my phone syncs audio-recording with Syncthing to my server. Then the server watches the folder and runs a local transcript service on it. These transcripts are then stored in Markdown with the audio clip as an attachment readable by my main Markdown client 🙂 |
13:35:52 | ehmry | PMunch: what do you use for transcription? |
13:40:10 | PMunch | vosk-transcriber apparently |
13:58:28 | om3ga | aha, here it is: parseutils.nim(421) integerOutOfRangeError |
13:58:46 | om3ga | parseUInt() |
14:10:30 | PMunch | Huh, this is pretty neat: https://en.wikipedia.org/wiki/XOR_linked_list |
14:11:35 | FromDiscord | <jviega> That's a decent idea for embedded environments, not sure I'd use it anywhere else |
14:11:50 | FromDiscord | <jviega> Usually memory is cheap and plentiful |
14:12:26 | PMunch | Of course, just found the idea fascinating |
14:12:33 | PMunch | But yeah, for embedded it might be useful |
14:12:43 | FromDiscord | <jviega> It's clever for sure |
14:13:24 | PMunch | I guess you could use it in an API design where you wanted to share a node but not allow traversal |
14:13:41 | PMunch | If you're only given one node then traversal is impossible |
14:14:08 | PMunch | Of course you could do that with a level of indirection as well |
14:14:17 | FromDiscord | <jviega> Yeah |
14:14:36 | FromDiscord | <jviega> Clear is usually better than clever 🙂 |
14:19:46 | PMunch | For sure |
14:20:06 | PMunch | But knowing the tricks can help you if you're ever in a pinch (like embedded) |
14:36:42 | FromDiscord | <spotlightkid> sent a long message, see https://paste.rs/GkFJJ |
14:55:28 | FromDiscord | <spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4MCs |
15:01:49 | om3ga | yeah, I solved issue. parseUInt probably is not 64 bit uint in i586 |
15:02:11 | om3ga | this is my mistake actually |
15:06:50 | * | edr joined #nim |
15:20:03 | * | PMunch quit (Quit: Leaving) |
15:39:22 | FromDiscord | <mratsim> In reply to @PMunch "Huh, this is pretty": This is an interview question |
15:41:50 | FromDiscord | <mratsim> In reply to @PMunch "Huh, this is pretty": similar vibes: https://muxup.com/2023q4/storing-data-in-pointers |
15:48:20 | FromDiscord | <nnsee> In reply to @mratsim "similar vibes: https://muxup.com/2023q4/storing-dat": that's probably where he got it from :p it's linked in the article |
16:21:09 | * | krux02 joined #nim |
16:52:43 | * | jmdaemon quit (Ping timeout: 256 seconds) |
16:57:43 | * | azimut quit (Ping timeout: 240 seconds) |
17:01:46 | * | azimut joined #nim |
17:05:42 | FromDiscord | <dlesnoff> In reply to @nnsee "and something like https://en.cppreference.com/w/cp": @nnsee Thanks again! 🙏 I was able to finish my PR for the Nim StdLib (not yet merged but all tests are passing :D) https://github.com/nim-lang/Nim/pull/20898 |
17:07:43 | FromDiscord | <nnsee> In reply to @jiezron "<@961485620075720734> Thanks again! 🙏": great! and no problem at all! |
17:21:00 | * | lucasta joined #nim |
18:01:43 | * | azimut quit (Ping timeout: 240 seconds) |
18:04:23 | * | azimut joined #nim |
18:15:23 | NimEventer | New thread by Abathargh: Avr_io - nim register bindings and utilities for AVR microcontrollers, see https://forum.nim-lang.org/t/10693 |
18:41:51 | * | derpydoo joined #nim |
18:46:33 | FromDiscord | <abisxir> Guys I see the sets module not that much handy, how do you get an element out of HashSet by its position inside HashSet? ↵let ↵ s = toHashSet([1, 2, 3])↵ a = s[0] |
18:47:40 | FromDiscord | <odexine> if you're trying to use it like that, i think you're using the wrong datatype |
18:48:26 | FromDiscord | <abisxir> But my use case is to sample a value out of it, I do not think so it is wrong, I mean for a set object |
18:49:30 | FromDiscord | <Phil> I don't understand your usecase.↵Generally sets are not for putting in datatypes.↵By their very nature they have no order.↵What you seem to be looking for would be an array or rather a seq |
18:50:08 | FromDiscord | <Phil> Which you can do the same operations on, just a bit less efficient |
18:50:32 | FromDiscord | <abisxir> Ok let me explain |
18:51:16 | FromDiscord | <Phil> (edit) "datatypes.↵By" => "datatypes and retrieving them.↵By" |
18:52:58 | FromDiscord | <abisxir> sent a code paste, see https://play.nim-lang.org/#ix=4MDI |
18:53:57 | FromDiscord | <abisxir> sample is not working here, so I write a simple function to provide it: |
18:55:21 | FromDiscord | <abisxir> func sample(a: HashSet[int]): int = a[rand(len(a) - 1)] |
18:56:18 | FromDiscord | <abisxir> What is the problem for this use case, think that the numbers are the id of tiles that I use to generate a map. |
19:11:43 | FromDiscord | <user2m> In reply to @nnsee "not to hate on": lol It's just a mock db with a simple query language that's. great for building quick MVPs. It's a little easier (not better) than using SQLite only because you can immediately see everything that's in the database rather than needing a separate ui to look inside a sql lite db |
19:37:45 | FromDiscord | <arathanis> is the current BKM to use `.isNil` or `== nil`? |
19:46:27 | FromDiscord | <dlesnoff> == nil should be enough now. See second commentary of accepted answer on this SO post: https://stackoverflow.com/a/32490139/13755536 |
19:46:38 | FromDiscord | <dlesnoff> What is a BKM btw? |
19:57:43 | FromDiscord | <Elegantbeef> What's the range of numbers, secondly for ints use `std/intsets`↵(@abisxir) |
19:58:50 | FromDiscord | <Elegantbeef> the std/rand `sample` only works for builtin sets, so you will need to make a sample for any other set type |
19:59:28 | FromDiscord | <Phil> I use isNil, I forgot when but sometimes the == nil approach gives me errors |
19:59:33 | FromDiscord | <Phil> isNil was more reliable that way |
20:00:00 | FromDiscord | <Elegantbeef> It will not give you errors but operator precedence exists so `a == b and c` might not be what you expect |
20:00:20 | FromDiscord | <Phil> In reply to @abisxir "I have two sets,": Make 2 sets, get the intersection set, turn the intersection set into a seq, access that with a random number.↵That seems to be the way to go |
20:00:39 | FromDiscord | <Elegantbeef> Lots of copying that way |
20:01:12 | FromDiscord | <Phil> Unless it's embedded or performance critical I don't particularly care |
20:01:35 | FromDiscord | <Elegantbeef> Given they said "tiles" I imagine this is game play code |
20:02:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ME3 |
20:02:51 | FromDiscord | <Elegantbeef> Not ideal as it has to iterate |
20:05:24 | FromDiscord | <Elegantbeef> If we knew the range of values and what was going on a better solution could be suggested 😄 |
20:14:18 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4ME6 |
20:14:32 | FromDiscord | <Elegantbeef> No |
20:16:08 | FromDiscord | <Elegantbeef> If you want to curry you need to use a bit of macros(or is it cumin) |
20:17:05 | FromDiscord | <Phil> Isn't this kinda equivalent to returning a proc? |
20:17:27 | FromDiscord | <Phil> Or is the entire magic behind currying that you don't need to write out the syntax that you return a proc? |
20:17:58 | FromDiscord | <Elegantbeef> It's currying |
20:17:59 | FromDiscord | <Elegantbeef> Indeed the point of currying is it's a general solution for a problem |
20:19:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ME9 |
20:19:33 | FromDiscord | <Elegantbeef> Or there abouts |
20:20:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4MEa |
20:20:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4MEb |
20:20:33 | FromDiscord | <Elegantbeef> But yea a macro would be a general solution to just axe off the first parameter(s) |
20:21:06 | FromDiscord | <Elegantbeef> Or if you did `curry(myProc, a = "hmm", c = 10, d = 30)` you could curry named positions aswell |
20:21:23 | FromDiscord | <Elegantbeef> This would be a relatively simple thing to write using micros, not that it's self explanatory |
20:21:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4MEc |
20:23:43 | FromDiscord | <Elegantbeef> Don't know if they're as flexible as what I'm describing, looked at hem all and they seem barebones |
20:23:55 | FromDiscord | <Phil> For a second I thought the bridge was down |
20:24:07 | FromDiscord | <Phil> Because that was way too long for you to punch out a quippy reply! |
20:24:18 | FromDiscord | <Elegantbeef> I was reading code! |
20:24:38 | FromDiscord | <Phil> Excuses |
20:36:36 | FromDiscord | <abisxir> In reply to @isofruit "Make 2 sets, get": Yep I did the same, but looks heavy instead of the index operator. |
20:37:06 | FromDiscord | <Phil> In reply to @abisxir "Yep I did the": I mean it definitely is heavier, depends on how often you run that code whether that heaviness matters or not |
20:37:27 | FromDiscord | <Phil> Beef provided a suggestion if you're using int-sets IIRC |
20:38:00 | FromDiscord | <abisxir> In reply to @Elegantbeef "What's the range of": It was just an example, the value can be a type of char or etc, but for integers you are right |
20:38:58 | FromDiscord | <nnsee> In reply to @user2m "lol It's just a": I suppose, although I should mention that looking inside SQLite files "immediately" is also very easy using `.dump` but yeah, I see what you mean |
20:39:13 | FromDiscord | <ElegantBeef> Now there are bridge issues |
20:39:26 | FromDiscord | <ElegantBeef> In reply to @abisxir "It was just an": Right but if it's a `char` or any small ordinal `set[T]` makes more sense |
20:39:38 | FromDiscord | <ElegantBeef> And there is a sample procedure for built in bitsets |
20:41:17 | FromDiscord | <abisxir> In reply to @elegantbeef "Right but if it's": Humm, let us consider it will be type Tile in the future 😉 |
20:41:29 | FromDiscord | <ElegantBeef> Which will be a enum... right? 😄 |
20:42:09 | FromDiscord | <Phil> Tell him its an enum or he'll be sad! |
20:42:15 | FromDiscord | <abisxir> No will be an object with x, y,z and entropy 😅 |
20:42:20 | FromDiscord | <Phil> Too late |
20:42:23 | FromDiscord | <ElegantBeef> Sounds like you could just use an integer |
20:42:31 | * | jmdaemon joined #nim |
20:42:32 | * | koltrast quit (Quit: ZNC - http://znc.in) |
20:42:33 | FromDiscord | <ElegantBeef> How many tiles are there? |
20:43:37 | FromDiscord | <abisxir> But my point was why it is not handy enough to avoid these kind of loops and so on. |
20:44:30 | FromDiscord | <ElegantBeef> Well the issue is that there just arent procedures that use the implementation details for `random` so you can make some using `std/importutils` and `{.all.}` or make a PR to the stdlib to add them |
20:44:43 | FromDiscord | <abisxir> In reply to @elegantbeef "How many tiles are": I am trying to make a 3d version of WFC. So like 100 100 10 |
20:45:07 | FromDiscord | <ElegantBeef> Chunk that into two and use 2 `set[uint16]` 😄 |
20:45:20 | FromDiscord | <ElegantBeef> Since this is a long lived single place `set` that'll be fine |
20:45:35 | FromDiscord | <ElegantBeef> I'm only partially joking |
20:45:46 | * | koltrast joined #nim |
20:46:02 | FromDiscord | <ElegantBeef> Don't quite get why you even have a set here |
20:46:16 | FromDiscord | <ElegantBeef> `ref array[worldSize, Tile]` should suffice |
20:46:48 | FromDiscord | <abisxir> You are right somehow I should consider an integer. |
20:48:15 | FromDiscord | <ElegantBeef> Atleast my shitty 2D WFC just used a set of possible tilekinds per tile, and removed kinds as the neighbouring tiles 'collapsed' |
20:48:34 | FromDiscord | <abisxir> Humm, it was my first try, here I want to save patterns for each side of a tile. I use a map of tile type to a set of possible tile types. |
20:49:10 | FromDiscord | <ElegantBeef> `array[Kind, set[Kind]]`? |
20:49:36 | FromDiscord | <arathanis> In reply to @jiezron "What is a BKM": Best Known Method. Sorry I am steeped in #BigCorpoInitialisms |
20:49:37 | FromDiscord | <ElegantBeef> https://github.com/beef331/nimtrest/blob/master/wavefunctioncollapse.nim#L58-L67 is how I did it for my shitty WFC |
20:49:48 | FromDiscord | <abisxir> Not array, Map |
20:50:18 | FromDiscord | <abisxir> In reply to @elegantbeef "https://github.com/beef331/nimtrest/blob/master/wav": Thanks, will check it ☺️ |
20:50:18 | FromDiscord | <ElegantBeef> Yea I don't know, maybe I'm being too naive |
20:50:56 | * | lucasta quit (Quit: Leaving) |
20:51:00 | FromDiscord | <ElegantBeef> Not like mine generated the most interesting anything https://media.discordapp.net/attachments/371759389889003532/1178800159266717736/image.png?ex=65777633&is=65650133&hm=97a00dbd1d407b3e76d1a41f0eaf096f8c177b1732469d01951bdd6002200ed4& |
20:51:14 | FromDiscord | <arathanis> So I know Nim is insensitive to both "\_" and "-" in identifiers, with the exception of the special identifier of `\_` . What is `_` used for? |
20:51:18 | FromDiscord | <arathanis> (edit) "`\_`" => "`_`" |
20:51:25 | FromDiscord | <ElegantBeef> Nim does not alloe `-` in identiferes |
20:51:29 | FromDiscord | <ElegantBeef> `_` is discard |
20:51:31 | FromDiscord | <ElegantBeef> allow |
20:51:41 | FromDiscord | <ElegantBeef> `a-b` is not an identifier it's `-(a, b)` |
20:51:49 | FromDiscord | <arathanis> ok my mistake, so its insensitive to underscores |
20:51:54 | FromDiscord | <arathanis> yeah that makes sense |
20:51:56 | FromDiscord | <abisxir> In reply to @elegantbeef "Not like mine generated": Humm, looks fine, as long as it works it is naive. |
20:52:01 | FromDiscord | <arathanis> trying to get back into the mindset after vacation |
20:52:11 | FromDiscord | <abisxir> (edit) "In reply to @elegantbeef "Not like mine generated": Humm, looks fine, as long as it works it is ... naive." added "not" |
20:52:16 | FromDiscord | <arathanis> so the `_` identifer is "I am capturing / passing something but I intend to ignore it"? |
20:52:24 | FromDiscord | <ElegantBeef> `_: T` just means "I do not care about the identifier and do not want to access it ever |
20:53:00 | FromDiscord | <ElegantBeef> In reply to @abisxir "Humm, looks fine, as": Well I'm saying it might be naive for your desired output/solution |
20:53:31 | FromDiscord | <ElegantBeef> Each tile just has a `set[Kind]` that gets reduced based off neighbour tiles changing |
20:53:46 | FromDiscord | <ElegantBeef> My solution requires iterating from one direction as it updates neighbour tiles |
20:54:16 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4MEq |
20:54:19 | FromDiscord | <ElegantBeef> Nope |
20:54:23 | FromDiscord | <ElegantBeef> `_` is not accessible |
20:54:33 | FromDiscord | <eszetera> https://tenor.com/view/discord-nitro-scam-scam-link-hack-gif-24773385 |
20:54:36 | FromDiscord | <ElegantBeef> an example is`proc doThing(_: typedesc int)` |
20:54:51 | FromDiscord | <ElegantBeef> or `var (_, a) = someProcThatReturnsATuple()` |
20:55:03 | FromDiscord | <ElegantBeef> or `for _ in 0..<10` |
20:55:04 | FromDiscord | <arathanis> Ah ok, that was going to be my next example with the new info |
20:56:00 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4MEr |
21:03:05 | FromDiscord | <ElegantBeef> What a silly template |
21:06:54 | FromDiscord | <arathanis> i like adding the expressiveness |
21:36:11 | * | azimut quit (Remote host closed the connection) |
21:36:51 | * | azimut joined #nim |
22:03:28 | * | azimut quit (Remote host closed the connection) |
22:03:50 | * | azimut joined #nim |
22:39:00 | FromDiscord | <whisperecean> Does cosmopolitan work nicely with Nim? |
22:59:31 | * | advesperacit quit () |
23:25:02 | * | lucasta joined #nim |
23:54:19 | * | nmz- quit (Ping timeout: 256 seconds) |
23:57:52 | * | nmz joined #nim |