00:00:41 | FromDiscord | <Yepoleb> what frustrates you about database servers? |
00:01:58 | FromDiscord | <albassort> I've never been able to set one up |
00:02:01 | FromDiscord | <albassort> i haven't tried |
00:02:14 | FromDiscord | <albassort> I'll have like a 20 page manufesto in 10 minutes when i get dbeaver working |
00:04:13 | FromDiscord | <Yepoleb> are you sure you need a database server and sqlite or json files is not enough? |
00:04:46 | FromDiscord | <albassort> No what im doing its best to have a database |
00:04:50 | FromDiscord | <albassort> sqlite is probably enough |
00:04:55 | FromDiscord | <albassort> but i wanna try portgres |
00:04:59 | FromDiscord | <Yepoleb> mariadb and postgres are pretty similar to set up |
00:06:01 | FromDiscord | <Yepoleb> In reply to @albassort "but i wanna try": postgres is the best choice when you need a database server |
00:07:09 | FromDiscord | <albassort> the last time i tried to setup maraidb i literally broke down crying |
00:07:14 | FromDiscord | <albassort> but i was like 15 |
00:08:00 | FromDiscord | <Yepoleb> are you using linux? |
00:08:09 | FromDiscord | <albassort> yea |
00:08:17 | FromDiscord | <albassort> i was using the old termianl |
00:08:23 | FromDiscord | <albassort> (edit) "termianl" => "terminal mariadb" |
00:08:57 | FromDiscord | <albassort> ah so i got it working |
00:09:04 | FromDiscord | <ShalokShalom> Postgres is great |
00:09:40 | FromDiscord | <Yepoleb> there's a lot of bad information about mariadb setup out there |
00:10:05 | FromDiscord | <ShalokShalom> Postgres can do graphs as well |
00:10:09 | FromDiscord | <ShalokShalom> Its pretty flexible. |
00:10:13 | FromDiscord | <albassort> so far on the nim page |
00:10:19 | FromDiscord | <albassort> it looks just like sql |
00:10:20 | FromDiscord | <albassort> :think: |
00:10:45 | FromDiscord | <ShalokShalom> What looks like SQL? |
00:10:56 | FromDiscord | <ShalokShalom> Postgres is using SQL as query language |
00:11:00 | FromDiscord | <ShalokShalom> If you mean that |
00:11:31 | FromDiscord | <albassort> yea |
00:29:05 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
00:30:04 | FromDiscord | <jos> https://media.discordapp.net/attachments/371759389889003532/1045496559556644874/image.png |
00:30:16 | FromDiscord | <jos> why does the second method have that warning but the first one doesn't? |
00:30:24 | FromDiscord | <jos> i don't really understand even after googling |
00:39:00 | FromDiscord | <Elegantbeef> Lock levels you can just ignore |
00:39:38 | FromDiscord | <jos> i can't find any docs on them except this |
00:39:41 | FromDiscord | <jos> http://web.mit.edu/nim-lang_v0.16.0/.nim-0.16.0.amd64_ubuntu1404/doc/manual/locking.txt |
00:39:46 | FromDiscord | <jos> is there something better to read |
01:04:37 | * | neceve_ joined #nim |
01:06:15 | * | neceve quit (Ping timeout: 268 seconds) |
01:07:37 | FromDiscord | <albassort> is there a hispter sexy database language |
01:07:40 | FromDiscord | <albassort> like nim |
01:17:19 | FromDiscord | <Rika> Graph database languages |
01:18:02 | FromDiscord | <albassort> nosql |
01:18:40 | FromDiscord | <Rika> Those are not very hipster |
01:19:31 | FromDiscord | <albassort> I think nosql was the database I was told to use at work? |
01:19:39 | FromDiscord | <albassort> :think: |
01:19:43 | FromDiscord | <albassort> (edit) ":think:" => "<:sad_think:899608203736780821>" |
01:25:47 | FromDiscord | <exelotl> isn't nosql the whole category of databases that don't use SQL? 🤔 |
01:33:18 | FromDiscord | <.tochka> yessql |
01:34:31 | FromDiscord | <albassort> https://github.com/sebastienros/yessql |
01:35:31 | FromDiscord | <.tochka> ...maybesql? |
01:39:19 | FromDiscord | <voidwalker> I need to store a sequence of strings, with no duplicates allowed, so that I can assign each unique string to an int, for fast lookups. I am using seq[string], with the index being the int to refference it. (like a dictionary). Is there anything else better suited for this ? |
01:42:42 | FromDiscord | <Yepoleb> In reply to @albassort "is there a hispter": There are libraries to generate sql from code |
01:42:59 | FromDiscord | <albassort> ngl i kinda hate sql |
01:43:05 | FromDiscord | <albassort> but idk if thats because i haven't practiced it enough |
01:43:17 | FromDiscord | <albassort> i don't really wanna write sql in my nim code |
01:43:37 | FromDiscord | <.tochka> In reply to @voidwalker "I need to store": should be good enough, tho be wary that you cant change that sequence or otherwise index references will be invalid |
01:44:20 | FromDiscord | <voidwalker> no need to change it, just needs to be a dictionary. |
01:44:44 | FromDiscord | <exelotl> tbh my takeaway after years of avoiding SQL is that you just gotta bite the bullet and write the SQL |
01:45:16 | FromDiscord | <voidwalker> I was thinking maybe some structure that has an .add that returns the index where the position of the added element, or if it exists, that position |
01:45:43 | FromDiscord | <.tochka> you can add it over seq |
01:46:00 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gNf |
01:46:03 | FromDiscord | <voidwalker> basically anything to reduce the number of lines of this code : D |
01:46:34 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4gNf" => "https://play.nim-lang.org/#ix=4gNg" |
01:47:34 | FromDiscord | <voidwalker> so I could have `let pathId = t.filePaths.add("whatever")` |
01:47:44 | FromDiscord | <Yepoleb> Is that the next step after reducing the number of letters in variable names? 😛 |
01:48:13 | FromDiscord | <voidwalker> haha, d and l actually come from the bencode lib I am using, and I was glad, cause the previous one had dictVal, listVal.. ugh |
01:48:21 | FromDiscord | <.tochka> sent a code paste, see https://play.nim-lang.org/#ix=4gNh |
01:48:24 | FromDiscord | <.tochka> fuck |
01:49:08 | FromDiscord | <voidwalker> yeah I guess I could implement it, I thought maybe this was common enough that it exists in some data structure |
01:49:15 | FromDiscord | <.tochka> sent a code paste, see https://play.nim-lang.org/#ix=4gNi |
01:49:23 | FromDiscord | <voidwalker> I'd still have one extra line to define the func headers though :\ |
01:50:13 | FromDiscord | <.tochka> In reply to @voidwalker "yeah I guess I": not that common i would say |
01:50:22 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gNj |
01:50:41 | FromDiscord | <.tochka> i can only assume python background from that |
01:51:04 | FromDiscord | <voidwalker> haha no, pascal background.. too many lines, too much verbosity |
01:51:24 | FromDiscord | <voidwalker> I am taking my revenge now |
01:51:47 | FromDiscord | <Yepoleb> Hashsets are the most efficient data structure for deduplication |
01:52:23 | FromDiscord | <.tochka> searching will certainly be faster with hashset |
01:52:30 | FromDiscord | <.tochka> indexing is faster this way doe |
01:53:36 | FromDiscord | <voidwalker> well I need a fast (free) lookup I guess. To avoid storing duplicate string in memory |
01:54:43 | FromDiscord | <.tochka> are you adding things constantly or only once |
01:54:51 | FromDiscord | <voidwalker> just once |
01:55:19 | FromDiscord | <.tochka> your way is fine then, unless data set is really big |
01:55:26 | FromDiscord | <voidwalker> trying to store the filepaths/filename/filezie of a .torrent file contents |
01:55:30 | FromDiscord | <.tochka> could also store hash along side string data for faster search |
01:56:32 | FromDiscord | <albassort> does postrgres optimize duplicate strings in databases? |
01:56:57 | FromDiscord | <voidwalker> ah, now that I think of it, I think the filepath info in torrents is stored in lexicographic order, that would mean there is no search needed, just lookup last element. |
02:03:23 | FromDiscord | <Yepoleb> if you want few lines, add the strings to a hashset and convert it to a seq with toSeq later |
02:04:38 | FromDiscord | <.tochka> smart |
02:05:29 | FromDiscord | <Yepoleb> or use sequtils deduplicate if it's already in a seq |
02:06:11 | FromDiscord | <voidwalker> so the string will be the key to the hashset ? |
02:06:58 | FromDiscord | <Yepoleb> it's a hashset, not a hashtable, so it does not expose the keys |
02:08:00 | FromDiscord | <voidwalker> ah, never used that one, let me see |
02:08:57 | FromDiscord | <voidwalker> ` A generic hash set.` great docs : D |
02:10:13 | FromDiscord | <voidwalker> Guess I missed that class in CS |
02:11:32 | FromDiscord | <Yepoleb> apparently you can get the string value back from a hashset using a key, but it does not seem documented what the key type should be |
02:12:07 | FromDiscord | <Yepoleb> a set is a collection of items where you can not have duplicates |
02:12:41 | FromDiscord | <Yepoleb> internally it's a hashtable with the key being the hash of the value |
02:13:23 | FromDiscord | <voidwalker> so I'd need to use that key instead of the uint index I am using now, to store the "pointer" to the value ? |
02:13:33 | FromDiscord | <voidwalker> how big is that hash ? |
02:13:41 | FromDiscord | <.tochka> string itself would be the key |
02:13:43 | FromDiscord | <Yepoleb> 64 bits most likely |
02:15:15 | FromDiscord | <Yepoleb> `type Hash = int` |
02:16:28 | FromDiscord | <Yepoleb> oh sorry for the confusion, apparently the hashset value pairs are hcode: key |
02:17:00 | FromDiscord | <Yepoleb> so the key is the value and hcode is the key 🤔 |
02:17:36 | FromDiscord | <Elegantbeef> Yea you hash check if it's in the table and `myVal == myHashTableVal` |
02:18:00 | FromDiscord | <Yepoleb> anyway, don't worry about that |
02:18:19 | FromDiscord | <Yepoleb> just create a hashset, incl all your values and then convert it to a seq with toSeq |
02:18:37 | FromDiscord | <Yepoleb> or use toHashSet if your values are already in an array |
02:21:46 | FromDiscord | <albassort> how do i instantiate a type in postgress to then insert it into a table |
02:21:54 | FromDiscord | <albassort> in postgres |
02:22:25 | FromDiscord | <albassort> for example, by table as an array of a custom type as a parameter |
02:22:27 | FromDiscord | <Yepoleb> using the postgres cli? |
02:22:32 | FromDiscord | <albassort> no in nim |
02:24:18 | FromDiscord | <Yepoleb> you can't use custom types in postgres |
02:24:56 | FromDiscord | <Yepoleb> you need to break the type down into base types |
02:25:11 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gNq |
02:25:38 | FromDiscord | <Yepoleb> oh, i did not know that was possible |
02:25:47 | FromDiscord | <albassort> this compiles and is fine |
02:25:58 | FromDiscord | <albassort> but, i dont know how i'd make the first one |
02:26:03 | FromDiscord | <albassort> to then put it in the second one |
02:26:56 | FromDiscord | <Yepoleb> https://til.hashrocket.com/posts/3693c7fc13-creating-custom-types-in-postgresql |
02:27:35 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gNs |
02:29:04 | FromDiscord | <albassort> thats hideous and makes me anxious |
02:29:07 | FromDiscord | <albassort> hate the lack of saftey |
02:29:16 | FromDiscord | <albassort> mom pick me up im scare |
02:30:19 | FromDiscord | <Yepoleb> you don't have to use composite types if they don't vibe with you |
02:30:37 | FromDiscord | <Yepoleb> you can use foreign keys instead |
02:30:44 | FromDiscord | <albassort> what da hell is that |
02:30:58 | FromDiscord | <albassort> i mean i can obviously just throw a json in there and be free but eh |
02:31:21 | FromDiscord | <Rika> PostgreSQL has indexable JSON |
02:31:26 | FromDiscord | <albassort> yes |
02:31:37 | FromDiscord | <albassort> but isn't that kinda like cheating |
02:31:50 | FromDiscord | <Yepoleb> a foreign key just references a key in another table |
02:32:09 | FromDiscord | <albassort> i guess i could also do that |
02:32:29 | FromDiscord | <albassort> actually thats pretty much what im doing already |
02:32:33 | FromDiscord | <albassort> that makes more sense tbh |
02:32:45 | FromDiscord | <albassort> I'll just make it an array of keys then |
02:33:13 | FromDiscord | <albassort> is there a type for id |
02:33:28 | FromDiscord | <albassort> actually I'll just do that in my code |
02:33:54 | FromDiscord | <Yepoleb> back when databases didn't have arrays we just created another table with the array values and a column with the id of the object they belong to |
02:34:38 | FromDiscord | <albassort> is it bad practice to make a key with rand(0 .. max(uint64)) |
02:34:43 | FromDiscord | <Rika> In reply to @albassort "but isn't that kinda": If it were then they wouldn’t have it implemented no |
02:34:47 | FromDiscord | <Rika> There’s a use for it |
02:34:52 | FromDiscord | <Rika> If it fits it fits |
02:35:27 | FromDiscord | <Rika> In reply to @albassort "is it bad practice": No, people make primary keys with UUIDs all the time and it has a similar idea |
02:35:35 | FromDiscord | <Rika> I’d recommend the UUID instead though |
02:35:47 | FromDiscord | <albassort> yea but isn't that slower |
02:35:53 | FromDiscord | <albassort> because i gotta insert it then get the key |
02:36:13 | FromDiscord | <Rika> ? |
02:36:18 | FromDiscord | <albassort> hmm |
02:36:20 | FromDiscord | <Rika> Slower in what way |
02:36:36 | FromDiscord | <Rika> What do you think you’re doing lol |
02:36:45 | FromDiscord | <albassort> in one version I generate they as im inserting the data, in the other version in grabbing the uuid after i insert it |
02:36:57 | FromDiscord | <albassort> (edit) "they" => "the key" |
02:37:24 | FromDiscord | <Rika> You know you can also locally generate UUIDs |
02:37:42 | FromDiscord | <albassort> oh wait yea there is UUID Somewhere in the stdlib |
02:38:03 | FromDiscord | <ringabout> `std/oids` ^ |
02:38:09 | FromDiscord | <Yepoleb> you probably don't need uuids for non distributed data and an auto increment primary key is good enough |
02:38:10 | FromDiscord | <.tochka> big hashes are good enough :D |
02:38:41 | FromDiscord | <albassort> In reply to @Yepoleb "you probably don't need": yea but who knows, stuff can go wrong |
02:38:54 | FromDiscord | <Yepoleb> 🤨 |
02:39:01 | FromDiscord | <Rika> In reply to @Yepoleb "you probably don't need": Eh personally if I needed to expose that ID to the public, might as well already make it a UUID |
02:39:10 | FromDiscord | <Rika> In reply to @albassort "yea but who knows,": What? |
02:39:20 | FromDiscord | <Rika> Like what? |
02:39:33 | FromDiscord | <albassort> I'll figure a way ok |
02:39:36 | FromDiscord | <albassort> and oids is cooler |
02:39:40 | FromDiscord | <Rika> Okay… |
02:39:49 | FromDiscord | <Rika> Ultimately it’s your program |
02:40:51 | FromDiscord | <albassort> something I've learned when working with dbs is, if you can possibly mess something up while coding half asleep, do have some saftey measure against it because it can be annoying to undo |
02:41:21 | FromDiscord | <Yepoleb> In reply to @Rika "Eh personally if I": i've found out it's best practice to separate public ids and primary keys, so i would still add an integer primary key in addition |
02:41:28 | FromDiscord | <Rika> …like migrations, have migrations |
02:41:56 | FromDiscord | <Rika> In reply to @Yepoleb "i've found out it's": Yeah but it’s best practice, does it look like I follow good practices 😉 |
02:42:32 | FromDiscord | <Yepoleb> but my database knowledge is pretty old at this point |
02:43:10 | FromDiscord | <Rika> You’re effectively halving your ID space by storing two of them!!! You lose out on one bit worth of IDs!!! That’s so wasteful |
02:43:15 | FromDiscord | <Rika> (I am joking) |
02:43:27 | FromDiscord | <Yepoleb> 🤔 |
02:43:35 | FromDiscord | <ringabout> Why is vcc (~20s) much slower than mingw (~2s) on Windows in compilation time for a hello world program in Nim? |
02:43:54 | FromDiscord | <Rika> Sounds strange |
02:44:02 | FromDiscord | <Rika> Purge caches perhaps? |
02:44:11 | FromDiscord | <ringabout> (edit) "time" => "speed" |
02:44:24 | FromDiscord | <Yepoleb> the microsoft telemetry server is overloaded 😉 |
02:45:13 | FromDiscord | <Rika> LOL |
02:45:51 | FromDiscord | <ringabout> 5s~10s regression from 1.4.8 to 1.6.6 |
02:47:17 | FromDiscord | <Yepoleb> are you doing a simple `nim c helloworld.nim`? |
02:48:10 | FromDiscord | <ringabout> Yeah |
02:49:18 | FromDiscord | <Yepoleb> i'd try to narrow down which specific command is taking longer than expected with verbose logging |
02:50:05 | rockcavera | ringabout, the vcc compiler is slower by nature, but the da linker is even slower. |
02:50:42 | rockcavera | vcc has always been slower than gcc on windows |
02:51:27 | FromDiscord | <ringabout> I see, thanks |
02:51:28 | FromDiscord | <Yepoleb> but isn't 20 seconds a bit excessive? |
02:52:05 | rockcavera | yes |
02:52:10 | FromDiscord | <Yepoleb> it can't just be 10 times slower |
02:52:36 | rockcavera | gcc 12.2.0 here is a little slow too, especially the linker |
02:53:43 | rockcavera | 27741 lines; 3.410s; 30.312MiB peakmem; simple echo "hello" |
02:53:46 | rockcavera | with gcc |
02:54:11 | rockcavera | with clang: 27741 lines; 4.772s; 30.312MiB peakmem; |
02:55:11 | rockcavera | vcc with devel I can't test it because it's broken |
02:55:24 | FromDiscord | <ringabout> In reply to @rockcavera "vcc with devel I": You can try refc |
02:55:41 | rockcavera | I'll try |
02:55:50 | rockcavera | debug or release? |
02:55:55 | FromDiscord | <ringabout> debug |
02:56:43 | rockcavera | nim c --mm:refc --cc:vcc -f test => 28980 lines; 8.120s; 30.289MiB peakmem; |
02:57:14 | FromDiscord | <ringabout> Yeah, It seems that a partial build uses 7.2s and a full build uses 20s. |
02:57:17 | rockcavera | nim c --mm:refc --cc:gcc -f test => 28980 lines; 6.155s; 30.293MiB peakmem; |
02:57:48 | rockcavera | nim c --mm:refc --cc:clang -f test => 28980 lines; 2.103s; 30.281MiB peakmem; |
02:58:03 | rockcavera | clang did best here |
02:58:15 | * | Guest8331 joined #nim |
02:58:20 | * | Guest8331 quit (Client Quit) |
03:00:09 | FromDiscord | <ringabout> Why my full build compilation uses so much time `20.966s; 30.242MiB peakmem`? I'm using a 12700H Processor. |
03:00:38 | rockcavera | I locked the processor frequency to not use turbo boost |
03:01:25 | rockcavera | ringabout, are you compiling a simple echo? |
03:01:34 | FromDiscord | <ringabout> Yes |
03:01:36 | FromDiscord | <ringabout> `` nim c --cc:vcc --mm:refc -f test5` |
03:01:40 | FromDiscord | <ringabout> (edit) "`` nim" => "`nim" |
03:01:53 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4gNC |
03:02:18 | rockcavera | do you know which version of your vcc compiler? the cl.exe? |
03:02:35 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4gND |
03:02:49 | rockcavera | Microsoft (R) C/C++ Optimizing Compiler Versão 19.33.31630 para x64 |
03:05:07 | FromDiscord | <ringabout> Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31933 |
03:06:37 | rockcavera | I will update microsoft compiler and test again |
03:07:34 | FromDiscord | <Yepoleb> Why not first figure out if everything is equally slow or it's just a single step |
03:11:20 | FromDiscord | <ringabout> Let me restart my computer. |
03:13:40 | rockcavera | Microsoft (R) C/C++ Optimizing Compiler Versão 19.34.31933 para x64 |
03:13:55 | rockcavera | now it's the same version |
03:14:39 | FromDiscord | <albassort> last question |
03:14:40 | rockcavera | nim c --mm:refc --cc:vcc -f test => 28980 lines; 7.084s; 30.289MiB peakmem; |
03:14:56 | rockcavera | are the problem is not the version |
03:15:00 | FromDiscord | <albassort> how do i insert an array into a database |
03:15:06 | FromDiscord | <albassort> do i need to format it? |
03:15:15 | FromDiscord | <albassort> like { "abc", "xyz"} |
03:17:34 | FromDiscord | <albassort> (like how you'd do in normal sql) |
03:17:37 | FromDiscord | <ringabout> In reply to @rockcavera "are the problem is": Yeah, thank you! Not like i'm going to use vcc anyway. After fixing the vcc regression on the devel, I'm going to set up a vcc CI in case of regressions again. |
03:17:46 | FromDiscord | <ringabout> (edit) "In reply to @rockcavera "are the problem is": Yeah, thank you! Not like i'm going to use vcc anyway. After fixing the vcc regression on the devel, I'm going to set up a ... vcc" added "simple" |
03:21:20 | * | arkurious quit (Quit: Leaving) |
03:22:05 | FromDiscord | <demotomohiro> IIRC, when Nim calls cl.exe, Nim runs vccexe.exe and it finds the path to vcvarsall and call it to setup environment variable to run cl.exe.↵That happens everytime Nim compiles .c files.↵That can slow down compile time when `--cc:vcc`? |
03:22:58 | FromDiscord | <ringabout> Probably cl.exe is not in my envs. |
03:24:34 | FromDiscord | <Yepoleb> In reply to @albassort "how do i insert": You probably need to generate an sql statement with the right amount of placeholders in the array |
03:25:10 | FromDiscord | <albassort> thats my breaking point where i just use json |
03:25:39 | rockcavera | demotomohiro, probably. As the search process can be time-consuming |
03:27:47 | rockcavera | ringabout, just remembered. My microsoft compiler is on the ssd and my gcc and clang compiler are on the hd. So my comparison might not be fair. |
03:28:55 | FromDiscord | <sOkam!> Is there a way to exit a template (like a return) but not exit the function where the template is called? |
03:29:31 | FromDiscord | <Elegantbeef> put a block in |
03:29:33 | FromDiscord | <ringabout> In reply to @rockcavera "<@658563905425244160>, just remembered. My": I see. |
03:29:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gNF |
03:29:55 | FromDiscord | <Rika> In reply to @Elegantbeef "put a block in": What he implies is basically wrap the whole template body in a block and break that |
03:30:00 | FromDiscord | <sOkam!> oh handy, ty |
03:30:03 | FromDiscord | <Rika> Use the break like return |
03:30:17 | FromDiscord | <sOkam!> can you use break without block? |
03:31:18 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gNG |
03:32:00 | FromDiscord | <huantian> No you need a block |
03:36:02 | rockcavera | i moved gcc to ssd and there was no difference in compile time |
03:37:11 | NimEventer | New post on r/nim by AetopiaMC: Any form of wildcard string pattern matching?, see https://reddit.com/r/nim/comments/z42tlw/any_form_of_wildcard_string_pattern_matching/ |
04:37:07 | * | jkl quit (Quit: Gone.) |
04:43:01 | * | jkl joined #nim |
04:45:16 | * | jkl quit (Client Quit) |
04:46:10 | * | jkl joined #nim |
04:46:36 | FromDiscord | <albassort> can i iterate over a hashet |
04:46:38 | FromDiscord | <albassort> (edit) "hashet" => "hashset" |
04:47:34 | FromDiscord | <ChocolettePalette> Technically you can |
04:48:20 | FromDiscord | <albassort> is it slow or something |
04:48:33 | FromDiscord | <albassort> i see it here in the docs |
04:49:38 | FromDiscord | <Elegantbeef> It's slower than not 😄 |
04:50:42 | FromDiscord | <albassort> so, if i add a non-unique item to a set, it wont be added |
04:50:49 | FromDiscord | <albassort> and thats faster than checking, right |
04:51:18 | FromDiscord | <Elegantbeef> Well it's faster than iterating a specific sized array |
04:51:35 | FromDiscord | <albassort> yea |
04:51:38 | FromDiscord | <albassort> alright |
04:51:52 | FromDiscord | <Elegantbeef> Checking if a value is in a hashset is `O(1)` but `O(N)` can be faster if it's smaller |
05:19:25 | FromDiscord | <sOkam!> Can you guide me in understanding the difference, in practical terms, between using a method and a proc?↵I've read the documentation like ten mill times, and I still don't understand what they do↵Are they implied behavior, based on the previous {.base.} method, or what exactly do they do exactly? |
05:19:45 | FromDiscord | <sOkam!> (edit) removed "exactly" |
05:19:56 | FromDiscord | <Elegantbeef> What method to call is reasoned at runtime, what procedure to call is reasoned at compile time |
05:20:31 | FromDiscord | <Elegantbeef> A base method introduces the behaviour that can be overridden based off the type |
05:20:44 | FromDiscord | <Elegantbeef> Methods are just procedures which are dispatched at runtime |
05:20:46 | FromDiscord | <sOkam!> dinamic vs static dispatch, yeah. but... what does that do in the practical world of applying that idea? |
05:21:03 | FromDiscord | <Elegantbeef> Base tells the compiler which symbol is overloadable |
05:21:13 | FromDiscord | <Elegantbeef> Without methods it doesnt know which symbol is overloaded |
05:21:18 | FromDiscord | <Elegantbeef> without base i mean |
05:21:25 | FromDiscord | <sOkam!> what does that mean? |
05:21:30 | FromDiscord | <Elegantbeef> For all it knows you're introducing a new method |
05:21:51 | FromDiscord | <Elegantbeef> which symbol is overridden\ |
05:22:18 | FromDiscord | <Elegantbeef> Base is pretty much just "Hey for a call to this method unroll it into runtime dispatch, thanks" |
05:22:34 | FromDiscord | <sOkam!> i still don't understand what that means in practical terms |
05:22:41 | FromDiscord | <voidwalker> speaking of hashsets.. is there really no library that deals with turning data into dictionaries (symbol compressing), in a generic way ? Like turning a seq[string] into a deduplicated seq[string], and storing the indices of the corresponding string ? Could this be achieved with a macro maybe, or a dedicated data type |
05:22:46 | FromDiscord | <Elegantbeef> What's your actual question? |
05:23:33 | FromDiscord | <Elegantbeef> There is no reason that a procedure or data type couldnt do that |
05:23:46 | FromDiscord | <Elegantbeef> I dont really know what you mean by "storing the indices of the corresponding string" |
05:23:51 | FromDiscord | <sOkam!> In reply to @Elegantbeef "What's your actual question?": understanding methods, without namedropping and assumptions of pre-existing knowledge, basically. aka ELI5 version of the explanation, because it seems that I have some big knowledge gaps on all of this |
05:23:56 | FromDiscord | <Elegantbeef> Do you mean deduplicating without copying? |
05:24:24 | FromDiscord | <Elegantbeef> Methods allow you to override behaviour of a procedure call based off type, this allows you to design systems that later are expanded |
05:24:38 | FromDiscord | <Elegantbeef> I personally use OOP + Methods for my GUI |
05:24:45 | FromDiscord | <sOkam!> whats different between doing that with a proc, then? |
05:24:55 | FromDiscord | <sOkam!> since procs can take the base type |
05:25:00 | FromDiscord | <Elegantbeef> Procedures are statically dispatched so you cannot override the behaviourr |
05:25:20 | FromDiscord | <Elegantbeef> You'd need to dispatch inside a base procedure to your type with a `if x of MySubType` |
05:25:38 | FromDiscord | <Elegantbeef> Methods convert to the subtype when needed and call the corresponding method |
05:25:43 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/tree/master/src/truss3D/guicomponents look at these components |
05:25:53 | FromDiscord | <Elegantbeef> I can add new ones without having to change anything before me |
05:26:07 | FromDiscord | <sOkam!> yeah, i have a methods example in the code im trying to understand too. that doesn't mean i understand it (which is why i asked) |
05:26:10 | FromDiscord | <voidwalker> @ElegantBeef I have some data that is potentially very repetitive. I want to store it as a dictionary based structure, so so instead of @["aaa", "bbb", "bbb", "bbb", "ccc"] I'd have just @[0,1,1,1,2] corresponding to @["aaa", "bbb", "ccc"] |
05:26:15 | FromDiscord | <Elegantbeef> I make a new component add a `update` and `draw` method and go to town |
05:26:38 | FromDiscord | <sOkam!> couldn't you just create a proc that takes the new object ttype instead? |
05:26:40 | FromDiscord | <sOkam!> why methods? |
05:26:46 | FromDiscord | <sOkam!> why not just overloading a proc? |
05:26:57 | FromDiscord | <Elegantbeef> Cause you want to change the logic based off runtime data and want to store different types inside the same container |
05:27:23 | FromDiscord | <Elegantbeef> OOP allows you to store heterogenous types together, which means you need some type of runtime information to call your specific type |
05:27:28 | FromDiscord | <Elegantbeef> Which is what methods do |
05:27:35 | FromDiscord | <sOkam!> but if the logic is defined by the type, is that not exacly like overloading a proc with the higher type? |
05:27:46 | FromDiscord | <Elegantbeef> They use runtime type information to convert to the correct type and call the corresponding procedure |
05:27:57 | FromDiscord | <Elegantbeef> No cause you cannot use proc dispatch on inheriting types like methods |
05:28:19 | FromDiscord | <sOkam!> i don't know what proc dispatch is |
05:28:38 | FromDiscord | <Elegantbeef> Shit |
05:28:40 | FromDiscord | <sOkam!> i understand the "compile time" vs "runtime"... but i don't understand what dispatch is even knowing that |
05:28:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gNY |
05:28:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gNZ |
05:28:53 | FromDiscord | <Elegantbeef> dispatch is literally just choosing a procedure |
05:29:07 | FromDiscord | <Elegantbeef> runtime dispatch is using information at runtime to chose the procedure |
05:29:27 | FromDiscord | <Elegantbeef> static dispatch is using static information to make a choice |
05:29:37 | FromDiscord | <Elegantbeef> Run the code i provided and you will see the reason you cannot use procs |
05:30:01 | FromDiscord | <Elegantbeef> Whoops `x.doThing()` |
05:30:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gO0 |
05:30:43 | FromDiscord | <Elegantbeef> This does what one expects |
05:30:44 | FromDiscord | <Elegantbeef> Which is what a method is for |
05:30:55 | FromDiscord | <Elegantbeef> Methods in Nim presently are not too far off the above, |
05:35:06 | FromDiscord | <sOkam!> so it thinks that the type is the base in all cases? |
05:38:59 | FromDiscord | <Elegantbeef> Well yea |
05:39:01 | FromDiscord | <sOkam!> well, this is handy. i sure was doing the type checking inside procs up till now↵tysm for the simplified example. now it makes sense↵I really thought that the first example would have done the correct thing 😔 |
05:39:03 | FromDiscord | <Elegantbeef> Cause that's what type they are |
05:39:20 | FromDiscord | <Elegantbeef> You cannot have a collection of a type that isnt homogenous |
05:39:35 | FromDiscord | <sOkam!> how do you define a base method correctly?↵or rather, what exactly is a base method in this context? |
05:39:40 | FromDiscord | <Elegantbeef> So all of them get converted to A |
05:39:56 | FromDiscord | <sOkam!> In reply to @Elegantbeef "You cannot have a": i see |
05:39:58 | FromDiscord | <Elegantbeef> `method doThing(a: A) {.base.} = echo "Unimplemented"` |
05:40:17 | FromDiscord | <Elegantbeef> Or assert false or whatever as the body |
05:40:26 | FromDiscord | <Elegantbeef> If you want a default behaviour you could implement it there |
05:40:36 | FromDiscord | <sOkam!> can you use discard on the base? |
05:40:58 | FromDiscord | <sOkam!> the lsp seems to be complaining, and then the compiler is throwing warnings that baseless methods are deprecated |
05:41:08 | FromDiscord | <Elegantbeef> You can use discard |
05:41:17 | FromDiscord | <Elegantbeef> Yes there is a bug with methods and nimsuggest presently |
05:41:37 | FromDiscord | <Elegantbeef> Generally though you want some type of information that something is implemented ime |
05:41:46 | FromDiscord | <Elegantbeef> unimplemented rather |
05:44:07 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gO2 |
05:44:08 | FromDiscord | <sOkam!> any clue why? |
05:44:24 | FromDiscord | <Elegantbeef> The compiler or nimsuggest? |
05:44:29 | FromDiscord | <sOkam!> compiler |
05:44:50 | FromDiscord | <Elegantbeef> Full code? |
05:45:03 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gO3 |
05:45:12 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Full code?": its from nico |
05:45:19 | FromDiscord | <sOkam!> nico's platformer example |
05:45:22 | * | vicecea quit (Remote host closed the connection) |
05:45:26 | FromDiscord | <Elegantbeef> is `Obj` the base type? |
05:45:37 | FromDiscord | <sOkam!> https://github.com/ftsf/nico/blob/main/examples/platformer.nim |
05:45:46 | FromDiscord | <sOkam!> yep, unless im misunderstanding |
05:46:41 | FromDiscord | <Elegantbeef> Seems to be a bug |
05:47:22 | FromDiscord | <Elegantbeef> Oh actually it's not |
05:48:15 | FromDiscord | <Elegantbeef> Methods only dispatch on the first parameter |
05:48:16 | FromDiscord | <Elegantbeef> so `a, b: Floater` is defining a new method |
05:48:39 | FromDiscord | <sOkam!> oh |
05:49:01 | FromDiscord | <Elegantbeef> Multi methods existed but are now deprecated and behind a flag |
05:50:10 | FromDiscord | <sOkam!> what should i do to fix it? |
05:50:26 | FromDiscord | <sOkam!> im not understanding how to deal with the issue, i believe |
05:50:36 | FromDiscord | <Elegantbeef> Change them to procs |
05:50:53 | FromDiscord | <sOkam!> but isn't that going to break the behavior, like you explained? |
05:51:18 | FromDiscord | <Elegantbeef> Well just leave them is all i can say |
05:51:48 | FromDiscord | <sOkam!> i mean, that's not an option. the idea is to fix the issues to be able to use the code, not get it deprected and eventually broken |
05:51:49 | FromDiscord | <Elegantbeef> The methods should not be called properly without multimethods enabled |
05:53:01 | FromDiscord | <Elegantbeef> Well you're not supposed to be able to have a `collide(Bullet, Crate)` and a `collide(Crate, Bullet)` |
05:53:12 | FromDiscord | <Elegantbeef> You should have a `collide(Bullet, Obj)` |
05:53:53 | FromDiscord | <sOkam!> but won't they all resolve to obj if i do it with procs? |
05:54:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gO5 |
05:54:16 | FromDiscord | <Elegantbeef> You can still use methods |
05:54:21 | FromDiscord | <Elegantbeef> But only for the first parameter |
05:55:17 | FromDiscord | <sOkam!> `floor.collide(player)` feels wrong 😔 |
05:55:41 | FromDiscord | <Elegantbeef> I'd argue this code is written relatively odd |
05:55:45 | FromDiscord | <sOkam!> `player.collide(floor)` is what makes sense, imo |
05:56:00 | FromDiscord | <Elegantbeef> You can write it that way |
05:56:06 | FromDiscord | <sOkam!> In reply to @Elegantbeef "I'd argue this code": it is, agreed. im just trying to figure out how to un-odd it, basically |
05:56:27 | FromDiscord | <Elegantbeef> Well i'd give each entity a collider then just check the collision and with that collider store entity type |
05:56:50 | FromDiscord | <sOkam!> In reply to @Elegantbeef "You can write it": but if obj is the first type, then you cannot have a base like the second, because the second is always going to resolve to obj |
05:57:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gO6 |
05:57:26 | FromDiscord | <Elegantbeef> Yes but you can manually check what the second is |
05:57:30 | FromDiscord | <Elegantbeef> like i've shown |
05:57:46 | FromDiscord | <Elegantbeef> Impbox is using multi methods here afaict |
05:57:47 | * | mahlon quit (Remote host closed the connection) |
05:57:47 | FromDiscord | <sOkam!> i guess, yeah |
05:58:18 | FromDiscord | <Elegantbeef> Does this run properly without the multimethods flag? |
05:58:31 | FromDiscord | <Elegantbeef> I forsee falling through things or missing collisions |
05:59:09 | FromDiscord | <sOkam!> i don't think it does |
05:59:35 | FromDiscord | <sOkam!> some things look broken to me, behavior that should be there its not there. but i dont understand the example well, to be honest, so cannot really tell |
05:59:36 | FromDiscord | <Elegantbeef> Compile with `--multimethods:on` and see if it behaves the same |
06:00:04 | FromDiscord | <Elegantbeef> Cause this is very much multi methods given the example matches it to a tee https://nim-lang.org/docs/manual.html#methods-multiminusmethods |
06:00:50 | FromDiscord | <Elegantbeef> In Nim methods only the first parameter is used for dynamic dispatch, this makes the code much easier to reason |
06:00:50 | FromDiscord | <Elegantbeef> You do not need to reason all parameters to figure out what's going on |
06:01:37 | FromDiscord | <sOkam!> oh damn, it changed immensely |
06:01:44 | FromDiscord | <sOkam!> now there is even a gameover screen 🙈 |
06:02:47 | FromDiscord | <Elegantbeef> Yep it relies on multimethods which have been deprecated |
06:02:47 | FromDiscord | <Elegantbeef> So to work properly it needs to be redesigned |
06:05:16 | FromDiscord | <sOkam!> is there a better way to check for collision types, that doesn't involve having a separate function just to find the type? 🤔 |
06:06:24 | FromDiscord | <Elegantbeef> I gave you a few different methods |
06:06:38 | FromDiscord | <Elegantbeef> manually dispatch based off the second parameters type |
06:06:57 | FromDiscord | <Elegantbeef> Use colliders and store the type of the entity so it's type agnostic |
06:07:07 | FromDiscord | <Elegantbeef> leave multimethods on even though it's deprecated |
06:07:24 | FromDiscord | <sOkam!> why were they deprecated, btw? |
06:07:32 | FromDiscord | <Elegantbeef> They make code hard to reason |
06:07:45 | FromDiscord | <sOkam!> i see |
06:07:53 | FromDiscord | <ringabout> https://nitter.snopyta.org/elucian_moise |
06:07:58 | FromDiscord | <sOkam!> i'd agree with that, so will try a different approach |
06:08:02 | FromDiscord | <Elegantbeef> Like you have `collide(a, b)` but you go through like 30 different procedures |
06:08:16 | FromDiscord | <ringabout> (edit) "https://nitter.snopyta.org/elucian_moise" => "https://nitter.snopyta.org/elucian_moise/status/1595513051846959113#m" |
06:09:22 | FromDiscord | <Elegantbeef> > You can define constants using "const" or "let" keywords. |
06:10:26 | FromDiscord | <Elegantbeef> Someone with a twitter count should correct that 😄 |
06:11:21 | FromDiscord | <ringabout> Yeah, I cannot access Twitter either. |
06:11:38 | pbotfullerton | Is there a reason why c2nim and nimterop don't run C header files through the compiler's preprocessor before reading them to simplify parsing? I think it's fair to assume that if you're interfacing with C you have a C compiler available |
06:11:52 | FromDiscord | <Elegantbeef> c2nim is simple |
06:11:56 | FromDiscord | <Elegantbeef> That's why |
06:12:01 | FromDiscord | <Elegantbeef> futhark does what you want |
06:12:17 | FromDiscord | <Elegantbeef> Personally i use `gcc -E` then run c2nim on that after removing the noise |
06:12:38 | pbotfullerton | Yeah exactly that |
06:12:53 | FromDiscord | <haxscramper> because macros might need to be wrapped |
06:13:05 | FromDiscord | <haxscramper> because running preprocessor would require working compilation configuration |
06:13:25 | FromDiscord | <Elegantbeef> In many cases you can just use `gcc -E` though |
06:13:40 | FromDiscord | <haxscramper> because macros sometimes can generate huge amount of garbage boilerplate |
06:14:02 | FromDiscord | <Elegantbeef> The entire API also can be written in macros |
06:14:05 | FromDiscord | <haxscramper> In reply to @Elegantbeef "In many cases you": there might be missing `#include` files |
06:14:58 | FromDiscord | <haxscramper> and most importantly, running preprocessor results in a full translation unit instead of a single file |
06:15:17 | FromDiscord | <haxscramper> so you can have like 30 wrappers for `std::vector` because other headers included it |
06:15:40 | FromDiscord | <Elegantbeef> All 2 people using c2nim on C++ are really shaking in their boots 😄 |
06:15:46 | FromDiscord | <Elegantbeef> Cmon hax you walked into that joke |
06:16:18 | FromDiscord | <haxscramper> c2nim does not have this problem |
06:17:05 | FromDiscord | <haxscramper> In reply to @Elegantbeef "*Cmon hax you walked": now I only need to understand what the joke is |
06:17:24 | FromDiscord | <Elegantbeef> Implying people would use C2nim with C++ |
06:18:31 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/8020 |
06:19:12 | FromDiscord | <haxscramper> btw, `gcc -E` is "That's a bad advice, better learn how c2nim actually works..." |
06:19:32 | FromDiscord | <haxscramper> so instead you just re-write all C defines in `#def` directives |
06:19:45 | FromDiscord | <haxscramper> oh, don't forget to edit your header definitions or search them for any replacements |
06:19:51 | FromDiscord | <haxscramper> (edit) "replacements" => "macro calls" |
06:19:52 | FromDiscord | <Elegantbeef> Yea i had a wasm runtime that wrote the entire api using macros so i dont know what to do that in that case |
06:19:54 | FromDiscord | <haxscramper> easy, right |
06:20:48 | FromDiscord | <Elegantbeef> https://github.com/wasmerio/wasmer/blob/master/lib/c-api/tests/wasm-c-api/include/wasm.h#L76-L90 |
06:21:52 | FromDiscord | <Elegantbeef> https://github.com/wasmerio/wasmer/blob/master/lib/c-api/tests/wasm-c-api/include/wasm.h#L338-L365↵The shit is bonkers, i have no idea what the 'proper way' is for c2nim here |
06:24:11 | FromDiscord | <Elegantbeef> Unironically the best and my most favourable results have been `gcc -E` -\> `c2nim` |
06:26:06 | FromDiscord | <haxscramper> oh it's easy |
06:26:16 | FromDiscord | <haxscramper> and then get |
06:26:17 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gOb |
06:26:22 | FromDiscord | <haxscramper> /tmp/a.cpp(15, 1) Error: ↵Exception: c2nim exited with 1↵[tty 3], line 1: c2nim a.cpp |
06:26:30 | FromDiscord | <haxscramper> what else can it possibly be? |
06:26:37 | FromDiscord | <haxscramper> just learn how c2nim actually works |
06:26:41 | FromDiscord | <haxscramper> it's easy |
06:27:28 | FromDiscord | <Elegantbeef> clearly you meant `a.h` and that'll solve it! |
06:27:28 | FromDiscord | <Elegantbeef> 😛 |
06:28:19 | FromDiscord | <haxscramper> or build c2nim from source |
06:28:27 | FromDiscord | <haxscramper> and then it does not even crash! |
06:28:37 | FromDiscord | <haxscramper> you get this wonderful piece of high-quality wrapper |
06:28:44 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gOc |
06:30:25 | FromDiscord | <Elegantbeef> Anyway this is enough commentary for me 😄 |
06:31:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gOd |
06:31:19 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4gOe |
06:31:24 | FromDiscord | <Elegantbeef> Hax save your sanity i gave up on that runtime for other reasons 😄 |
06:31:43 | FromDiscord | <haxscramper> wtf is `own` I don't know, but you should be able to figure out, just "learn how c2nim works" it's easy right |
06:32:31 | FromDiscord | <Elegantbeef> Funnily iirc futhark also had issues with `own` |
06:32:33 | FromDiscord | <haxscramper> as in "admitting difficulty of writing truly automated C++ wrapper generator" -- pffft that's for idiots, |
06:32:39 | FromDiscord | <haxscramper> just learn how c2nim works |
06:32:56 | FromDiscord | <Elegantbeef> libclang actually also gives incorrect information with that macro |
06:33:19 | FromDiscord | <Elegantbeef> https://github.com/PMunch/futhark/issues/44 |
06:33:34 | FromDiscord | <haxscramper> well that just proves that c2nim >= futhark |
06:36:54 | FromDiscord | <ieltan> I looked into how they wrap wasmer in other languages and tbh it looks like quite the gargantuan effort |
06:37:10 | FromDiscord | <Elegantbeef> It very much is |
06:37:38 | FromDiscord | <Elegantbeef> I much preferred wrapping wasm3, and it also had all the functionality i needed, wasmer didnt even let you query functions in a wasm module from the C-api |
06:37:51 | FromDiscord | <Elegantbeef> In wasmer's case i could probably have use nbindgen but no clue |
06:37:53 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/8451 can't get enough of this thread |
06:38:05 | FromDiscord | <haxscramper> "c2nim is conceptually the best" way my ass |
06:38:07 | FromDiscord | <ieltan> I think I saw an issue not long ago about wrapping wasmer in Nim |
06:38:11 | FromDiscord | <ieltan> Lemme fetch it |
06:38:52 | FromDiscord | <Elegantbeef> I mean i honestly prefer the c2nim result, but less human intervention would be ideal |
06:38:57 | FromDiscord | <ieltan> https://github.com/wasmerio/wasmer/issues/2120 |
06:38:57 | FromDiscord | <Elegantbeef> I've said it multiple times the futhark files are way too noisey for me to like |
06:39:24 | FromDiscord | <Elegantbeef> Yea the recent post is now using my wasm3 bindings afaik |
06:39:30 | FromDiscord | <Elegantbeef> It's a 200 loc binding file, it's so simple |
06:39:47 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasm3/blob/master/src/wasm3/wasm3c.nim |
06:39:59 | FromDiscord | <Elegantbeef> Like it's crazy simple compared to the wasmer code |
06:40:10 | FromDiscord | <ieltan> Ye I've seen it 😉 |
06:40:20 | FromDiscord | <Elegantbeef> Ah |
06:40:44 | FromDiscord | <Elegantbeef> The wamer code was made by rust programmers who really just wanted it to be over, i dont blame them but ugh is it ever a thing |
06:41:13 | FromDiscord | <ieltan> They're are rebuilding the world, can't blame them lol |
06:41:46 | FromDiscord | <ieltan> Well, so the saying goes |
06:43:30 | FromDiscord | <Elegantbeef> Goes how |
06:43:45 | * | kenran joined #nim |
06:44:31 | * | kenran quit (Remote host closed the connection) |
06:46:04 | FromDiscord | <ieltan> It goes on how rustacians have a duty to do everything in rust to perfection |
06:46:13 | FromDiscord | <Elegantbeef> Ah |
06:46:35 | FromDiscord | <Elegantbeef> Is their JIT escape memory safe? 😛 |
06:47:25 | FromDiscord | <ieltan> Surely not without 'some' amounts of `unsafe` |
06:47:53 | FromDiscord | <ieltan> But it's still safe to say that `unsafe` is safe |
06:47:54 | FromDiscord | <ieltan> 😅 |
06:48:22 | FromDiscord | <Elegantbeef> Hey if JIT compiled code can escape the sandbox, but it's memory safe... it's fine right? |
06:48:51 | FromDiscord | <Elegantbeef> I'm not saying their sandbox can be escaped, i'm just implying that JIT makes it harder to sandbox well |
06:49:51 | FromDiscord | <ieltan> Hmm that's actually something I wonder too |
06:51:35 | * | neceve_ quit (Quit: ZNC - https://znc.in) |
06:51:52 | FromDiscord | <ieltan> My take is that any code escaping the sandbox could be considered arbitrary attack vectors, you can't guarantee 'memory safety' at this point. |
06:53:27 | * | neceve joined #nim |
06:59:17 | FromDiscord | <ChocolettePalette> a comment on SAFE doubly linked list realization in rust |
06:59:32 | FromDiscord | <ieltan> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1045592641858965534): My take is that any code escaping the sandbox could be considered attack vectors (exploited by malware) , you can't guarantee 'memory safety' at this point. |
07:00:56 | FromDiscord | <sOkam!> What happens if a base method is empty and you call it?↵https://github.com/ftsf/nico/blob/bdbe4f48ca8d2d58458e76897cf883a255479cf2/examples/platformer.nim#L352-L353↵What is this line remapping to instead? |
07:01:25 | FromDiscord | <sOkam!> _(btw, already noticing why they got deprecated, i cannot even untangle this because its so hard to reason about)_ |
07:01:31 | FromDiscord | <Elegantbeef> Nothing happens if it doesnt call it |
07:01:53 | FromDiscord | <sOkam!> yeah, but that thing is just inverting the order |
07:02:13 | FromDiscord | <sOkam!> but there is no other reversed collision check, afaik (unless im misunderstanding) |
07:06:50 | * | neceve quit (Quit: ZNC - https://znc.in) |
07:10:08 | * | neceve joined #nim |
07:30:23 | NimEventer | New thread by halloleo: How to create a mutable object prefrably without ref, see https://forum.nim-lang.org/t/9651 |
07:31:13 | * | PMunch joined #nim |
07:31:20 | * | rockcavera quit (Remote host closed the connection) |
07:57:48 | * | dtomato4 quit (Ping timeout: 264 seconds) |
08:13:45 | * | dtomato4 joined #nim |
08:41:55 | * | wallabra_ joined #nim |
08:44:03 | * | wallabra quit (Ping timeout: 265 seconds) |
08:44:07 | * | wallabra_ is now known as wallabra |
09:42:20 | FromDiscord | <dlesnoff> In reply to @Elegantbeef "Personally it's Sentinel -\>": You go first for Sentinel, then Option and finally Exception but prefer Exception ?↵What is Sentinel ? |
09:48:07 | PMunch | Like returning `null` or some other special value indicating error |
09:48:44 | PMunch | For example `find` returns the position of a substring in the string, or -1 if no match is found |
09:48:52 | PMunch | -1 there is a sentinel value |
10:18:25 | FromDiscord | <Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4gOS |
10:18:37 | FromDiscord | <Jessa> (edit) "https://play.nim-lang.org/#ix=4gOS" => "https://play.nim-lang.org/#ix=4gOT" |
10:24:31 | PMunch | `export module` |
10:24:34 | PMunch | In file1 |
10:24:53 | PMunch | And your small example wouldn't work because you don't export sayHello ;) |
10:27:11 | * | vicecea joined #nim |
10:33:48 | * | jmdaemon quit (Ping timeout: 264 seconds) |
10:38:48 | FromDiscord | <Jessa> ah i see |
10:39:06 | FromDiscord | <Jessa> > And your small example wouldn't work because you don't export sayHello ;)↵right, yeah, but you get the point x3 |
10:41:17 | FromDiscord | <Jessa> thanks thoughhh |
10:41:52 | * | neceve quit (Quit: ZNC - https://znc.in) |
10:45:45 | * | dtomato4 quit (Quit: The Lounge - https://thelounge.chat) |
10:46:18 | * | dnh joined #nim |
10:46:24 | * | dtomato4 joined #nim |
10:48:13 | * | neceve joined #nim |
10:52:03 | * | neceve quit (Client Quit) |
10:57:56 | * | neceve joined #nim |
11:01:30 | FromDiscord | <haywireSSC> how do I do implicit type conversion? |
11:17:08 | FromDiscord | <ali> Is there a recommended linter for Nim (mostly interested in style) |
11:31:11 | FromDiscord | <Rika> There’s pretty much only one and an extended version of that single one |
11:34:52 | PMunch | @haywireSSC, write a `converter` |
11:42:09 | FromDiscord | <ChocolettePalette> Is it good or bad or not good and not bad?↵(@Rika) |
11:42:46 | FromDiscord | <Rika> I’d say they’re both pretty bad, the extended version is good that it extends but still relies on the pretty bad original so |
11:43:03 | FromDiscord | <ChocolettePalette> Ah! |
12:10:27 | * | jjido joined #nim |
12:12:22 | * | jjido quit (Client Quit) |
12:15:44 | NimEventer | New thread by nimian: Best way for ipc between a rust app and Nim app?, see https://forum.nim-lang.org/t/9652 |
12:21:44 | NimEventer | New thread by sls1005: `cast` broken?, see https://forum.nim-lang.org/t/9653 |
12:37:21 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=4gPl |
12:38:41 | FromDiscord | <hmmm> error messages too confusing, truncate and simplify, assegnee: @ElegantBeef 🥳 |
12:46:00 | PMunch | You used a macro which expanded to that block, and you try to pass it to something which needs a string, but that block returns a seq[string] |
12:52:34 | FromDiscord | <hmmm> hmm I don't know about that, but creating a new var and moving the computation there fixed it apparently 🥤 |
12:54:30 | * | jjido joined #nim |
13:12:42 | FromDiscord | <vestel> Why do all macro arguments turns into NimNode? |
13:12:50 | FromDiscord | <vestel> How can I pass object as macro argument? |
13:16:00 | FromDiscord | <ChocolettePalette> Macros operates on code at compile time |
13:20:30 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4gPA |
13:20:50 | FromDiscord | <vestel> sent a code paste, see https://play.nim-lang.org/#ix=4gPB |
13:26:23 | FromDiscord | <Jessa> making a REPL interpreter for windows in nim https://media.discordapp.net/attachments/371759389889003532/1045691921965776916/nim_repl.mp4 |
13:26:47 | FromDiscord | <ChocolettePalette> Why? |
13:27:07 | FromDiscord | <Jessa> because i couldn't find any module that did it while also being windows compatible |
13:27:26 | FromDiscord | <Jessa> termios' repl is linux only |
13:28:17 | FromDiscord | <yrashk> Is there a way to change compiler's `buildDll` setting for a project? |
13:34:48 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
14:20:55 | * | rockcavera joined #nim |
14:32:30 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gQ4 |
14:33:56 | FromDiscord | <Rika> Not really |
14:37:18 | FromDiscord | <sOkam!> kk |
14:41:31 | * | kenran joined #nim |
14:42:18 | * | kenran quit (Remote host closed the connection) |
14:43:07 | * | arkurious joined #nim |
14:53:15 | * | PMunch quit (Quit: Leaving) |
15:08:00 | * | neceve quit (Quit: ZNC - https://znc.in) |
15:09:55 | * | neceve joined #nim |
15:23:11 | FromDiscord | <Mr_Miagi> Hey Guys |
15:23:36 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQp |
15:32:18 | * | qwr quit (Quit: tuumauuendus...) |
15:36:19 | FromDiscord | <Mr_Miagi> 😢 |
15:38:07 | * | qwr joined #nim |
15:45:18 | FromDiscord | <Phil> I mean, it should, but I'd honestly recommend using `std/strformat` for readability |
15:45:50 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQw |
15:45:55 | FromDiscord | <Phil> Or rather, it would equaty to `http://user:password@hostName:httpPort/?query=somestuff |
15:46:00 | FromDiscord | <Phil> (edit) "`http://user:password@hostName:httpPort/?query=somestuff" => "`http://user:password@hostName:httpPort/?query=somestuff`" |
15:46:41 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQx |
15:46:42 | FromDiscord | <Phil> (edit) "equaty" => "equate" |
15:46:42 | FromDiscord | <Mr_Miagi> it doesnt take user/password |
15:46:47 | FromDiscord | <Mr_Miagi> just uses hostname |
15:47:11 | FromDiscord | <Phil> I can't really tell you what db_clickhouse is |
15:47:31 | FromDiscord | <Phil> If that's somehow std/db_postgres or the like then your open method is missing a parameter |
15:47:41 | FromDiscord | <Mr_Miagi> so im modifying https://github.com/leonardoce/nim-clickhouse/blob/master/src/db_clickhouse.nim to take username/password |
15:47:48 | FromDiscord | <Mr_Miagi> yes its a db |
15:48:00 | FromDiscord | <Mr_Miagi> what param am i missing |
15:49:03 | FromDiscord | <enthus1ast> looks like uri could fit |
15:50:07 | FromDiscord | <Mr_Miagi> where |
15:50:41 | FromDiscord | <Phil> In reply to @Mr_Miagi "what param am i": That'd be the case if you were using db_sqlite, which I'm not entirely sure. But the open method there takes 4 string parameters (as does any std/db\_\ module) |
15:50:55 | FromDiscord | <Phil> (edit) "In reply to @Mr_Miagi "what param am i": That'd be the case if you were using db_sqlite, which I'm not entirely sure. But the open method there takes 4 string parameters (as does ... any" added "it in" |
15:51:10 | FromDiscord | <Phil> (edit) "db_sqlite," => "db_sqlite/postgres etc.," |
15:51:21 | FromDiscord | <jos> is there a nice way to specify the type of a seq literal |
15:51:22 | FromDiscord | <jos> i.e. |
15:51:30 | FromDiscord | <enthus1ast> imho he wants to patch this https://github.com/leonardoce/nim-clickhouse/blob/21b67967617e885d51fbd8439365796847033e89/src/db_clickhouse.nim#L112↵to also take username and password @Phil |
15:51:39 | FromDiscord | <jos> @[1, 2, 3] but i want 1, 2, 3 to be interpreted as u8's |
15:51:42 | FromDiscord | <Mr_Miagi> In reply to @enthus1ast "imho he wants to": yes thats exactly what i need to do |
15:51:53 | FromDiscord | <Phil> Ahhh, that module brings its own open method |
15:52:23 | FromDiscord | <jos> or my actual case is more like |
15:52:28 | FromDiscord | <enthus1ast> so instead of manually generating the string, use a uri object fill it , and let it generate a string for oyu |
15:52:30 | FromDiscord | <enthus1ast> xou |
15:52:31 | FromDiscord | <enthus1ast> .,. |
15:52:34 | FromDiscord | <enthus1ast> you |
15:52:39 | FromDiscord | <jos> @[ExprCall(), ExprCall(), ExprCall()], but i want my seq to be of the subtype Expression |
15:52:53 | FromDiscord | <Phil> In reply to @jos "@[1, 2, 3] but": Best I can do you is `let x: seq[uint8] = @[1,2,3]` |
15:53:01 | FromDiscord | <Phil> assuming uint8 is actually a type, I didn't try |
15:53:04 | FromDiscord | <jos> what if it's a literal being passed in-place? |
15:53:08 | FromDiscord | <Phil> But you get the gist, define via type annotation |
15:53:15 | FromDiscord | <enthus1ast> 1'u8 |
15:53:17 | FromDiscord | <Mr_Miagi> In reply to @enthus1ast "so instead of manually": hmm can you show me an example what you mean? |
15:53:24 | FromDiscord | <jos> https://media.discordapp.net/attachments/371759389889003532/1045728921452298260/image.png |
15:53:30 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/uri.html |
15:53:40 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/uri.html#Uri |
15:53:43 | FromDiscord | <jos> i can't figure out how to make it more concise than that |
15:53:57 | FromDiscord | <enthus1ast> set all the stuff (user password etc) then stringify it |
15:54:32 | FromDiscord | <Mr_Miagi> hmm |
15:54:47 | FromDiscord | <Phil> For conciseness I believe I'm the wrong person to ask for advice.↵I'd have pulled the expression you're casting into its own line |
15:55:45 | FromDiscord | <jos> ah |
15:55:56 | FromDiscord | <enthus1ast> since this is what you wanna do.↵When you add username to the old code, you must manually add "username\:password@host" etc, if you specify them |
15:56:48 | FromDiscord | <Mr_Miagi> In reply to @enthus1ast "since this is what": hmm so i did try that so would i add the uri to the old code or my script |
15:58:38 | FromDiscord | <enthus1ast> when you want to preserve the old behavior, add username and password as optional (or empty) parameters, in open, store them in the DbConn object then in "createQueryUrl" fill a uri object and stringify it |
15:58:44 | FromDiscord | <jos> what about any crates to generate a `==`operator that has deep value equality? |
15:58:47 | FromDiscord | <jos> libs 🙂 |
16:04:00 | FromDiscord | <Mr_Miagi> In reply to @enthus1ast "when you want to": hmm still not certain how to do that |
16:04:03 | FromDiscord | <Mr_Miagi> sorry still new 😦 |
16:05:11 | FromDiscord | <enthus1ast> `proc open(hostName: string, httpPort:int = 8123, username = "", password = ""): DbConn =` |
16:06:34 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQB |
16:06:55 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4gQC |
16:08:19 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4gQD |
16:08:57 | FromDiscord | <enthus1ast> but if you do not care about backwards compatibility you can change the order of course |
16:09:16 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQF |
16:11:24 | FromDiscord | <Mr_Miagi> is that correct @enthus1ast |
16:11:39 | FromDiscord | <enthus1ast> yes |
16:11:56 | FromDiscord | <enthus1ast> yes |
16:11:57 | FromDiscord | <enthus1ast> \:) |
16:12:13 | FromDiscord | <enthus1ast> its ugly and also wrong |
16:12:24 | FromDiscord | <Mr_Miagi> lol |
16:12:40 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQG |
16:12:51 | FromDiscord | <enthus1ast> yeah |
16:13:00 | FromDiscord | <enthus1ast> the query is missing |
16:13:53 | FromDiscord | <Mr_Miagi> sent a code paste, see https://play.nim-lang.org/#ix=4gQH |
16:14:06 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/uri.html#Uri |
16:14:15 | FromDiscord | <enthus1ast> its called port |
16:16:40 | FromDiscord | <Mr_Miagi> hmm i see let me play a bit |
16:19:18 | FromDiscord | <Mr_Miagi> thanks!! |
16:24:04 | FromDiscord | <enthus1ast> another thing to consider is, that the uri already have fields for all the data, maybe you could just create the uri object in open and just store this in DbConn |
16:24:05 | FromDiscord | <yrashk> I wonder if it is possible to write a macro with an emit pragma that can be used at a top level? |
16:24:18 | FromDiscord | <enthus1ast> but i guess then you must change some other code as well |
16:24:29 | FromDiscord | <enthus1ast> but when it works its good \:) |
16:33:58 | * | pro joined #nim |
16:34:04 | * | pro left #nim (#nim) |
16:58:32 | * | jjido joined #nim |
17:11:14 | * | attah quit (Read error: Connection reset by peer) |
17:13:27 | NimEventer | New thread by RodSteward: Import C and Nim keyword collisions, see https://forum.nim-lang.org/t/9654 |
17:14:42 | * | attah joined #nim |
17:21:01 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
17:34:59 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:19:58 | * | dnh joined #nim |
18:28:39 | FromDiscord | <hmmm> guyz what's the easy way to insert scripting in a gui program? I want something like cligen that uses my procs and works automagically 😦 |
18:29:13 | FromDiscord | <yrashk> I am still trying to figure out a local development strategy. Let's say I have a nimble package `a` in development (on the filesystem) and a package `b` in development as well. I want to always rebuild `b` against the very latest version (whatever's on disk). Currently I just `nimble uninstall pkgname -i` and `nimble install` in `a` every time I change `a`. But this is rather tedious. I couldn't figure out what `nimble develop` does. Any s |
18:29:30 | FromDiscord | <jan0809> hey guys, is there a nice libusb wrapper |
18:29:48 | FromDiscord | <hmmm> what's libusb |
18:30:23 | FromDiscord | <jan0809> this https://libusb.info/ |
18:31:17 | * | junaid_ joined #nim |
18:32:35 | FromDiscord | <hmmm> yea it's useful, jan you make it |
18:33:46 | FromDiscord | <hmmm> there is something in the package list https://media.discordapp.net/attachments/371759389889003532/1045769278135222433/Screenshot_2022-11-25_193323.jpg |
18:34:51 | Amun-Ra | yrashk: do you have your own git server? |
18:35:02 | FromDiscord | <yrashk> In reply to @Amun-Ra "<@145563987772309504>: do you have": no |
18:35:33 | Amun-Ra | bc nimble supports require "url" |
18:36:00 | Amun-Ra | although I don't have a clue whether it recheck it every time you build |
18:36:23 | FromDiscord | <jan0809> In reply to @hmmm "there is something in": i c, but which one is the thing to go with |
18:37:45 | Amun-Ra | yrashk: I recommend setting up your own gitea, btw |
18:37:49 | FromDiscord | <yrashk> this is just such a common case. I am developing a library, and I want to test it in a separate project (how would it work for any other external package depending on it) |
18:38:18 | FromDiscord | <yrashk> This doesn't make sense. I don't want to commit every change in package `a` and setup a git server. It doesn't make any more sense than `nimble uninstall/install` |
18:38:29 | FromDiscord | <yrashk> same amount of ceremony |
18:38:45 | Amun-Ra | so always nimble install package you depend on after changes |
18:39:11 | FromDiscord | <yrashk> that's what I do but it's tedious and just makes it much harder to iterate. |
18:39:46 | FromDiscord | <yrashk> In Rust, for example (or Node.js, or Ruby, or whatever else) you can override package's location (`path = ...` or something to that tune) |
18:39:56 | FromDiscord | <yrashk> is there really no alternative with Nim/Nimble? |
18:40:00 | Amun-Ra | hmm |
18:40:06 | Amun-Ra | let's me check that |
18:41:06 | * | junaid_ quit (Quit: leaving) |
18:41:31 | * | junaid_ joined #nim |
18:43:43 | Amun-Ra | sadly requires does not work with local path nor file:// uri |
18:44:05 | FromDiscord | <vindaar> \again |
18:44:08 | FromDiscord | <vindaar> sent a long message, see http://ix.io/4gRf |
18:44:18 | FromDiscord | <yrashk> I figured it out:↵↵nimble develop -a:PATH/TO/DEP |
18:44:23 | Amun-Ra | requires "file:///tmp/testlib" results with "Error: 'hg' not in PATH." hmm |
18:44:37 | Amun-Ra | yrashk: ah, nice |
18:44:46 | FromDiscord | <yrashk> I am on v0.14 and the above command worked for me, now it's always in sync with the dependency |
18:56:29 | FromDiscord | <vindaar> but this has to be run from the package that depends on the one you are currently developing, no? |
18:56:57 | FromDiscord | <vindaar> so developing FOO, in BAR that uses FOO you call `nimble develop --path:X` ? |
18:58:34 | * | junaid_ quit (Remote host closed the connection) |
18:59:25 | FromDiscord | <yrashk> yes. |
19:04:43 | FromDiscord | <yrashk> Is std/httpclient known not to work from within NimScript? causes a segfault for me |
19:13:50 | NimEventer | New thread by bet3lgeuse: Choosing Nim out of a crowded market for systems programming languages , see https://forum.nim-lang.org/t/9655 |
19:32:19 | FromDiscord | <guttural666> web noob here, I want to get some information out of a website that doesn't offer an API or anything, was thinking about doing the equivalent of curl in nim, then regexing my way to the target data like a complete caveman, any advice on how to do this better maybe? 😄 |
19:37:06 | FromDiscord | <hotdog> In reply to @guttural666 "web noob here, I": Parse the html and use something like https://github.com/GULPF/nimquery |
19:37:15 | FromDiscord | <hotdog> Depending on what the data is |
19:38:11 | FromDiscord | <guttural666> In reply to @hotdog "Parse the html and": thanks gonna bookmark this for further reference |
19:38:32 | FromDiscord | <guttural666> but there's not really any way around parsing et al right |
19:39:08 | FromDiscord | <hotdog> In reply to @guttural666 "but there's not really": Depends on the source really |
19:39:30 | FromDiscord | <hotdog> What is it you’re trying to get? |
19:39:37 | FromDiscord | <guttural666> https://www.metal-archives.com/bands/Werwolf/3540355723 |
19:39:52 | FromDiscord | <guttural666> album names for a band for example |
19:49:22 | FromDiscord | <hotdog> In reply to @guttural666 "album names for a": Looks like on that site there is a separate endpoint that returns the album html: https://www.metal-archives.com/band/discography/id/3540355723/tab/all |
19:49:55 | FromDiscord | <hotdog> So yeah if it was me I would parse that and query with nimquery |
19:50:20 | FromDiscord | <hotdog> The html structure is pretty simple |
19:50:38 | FromDiscord | <Yepoleb> regex is fine for very simple stuff, but it quickly becomes unreliable if you try to parse more values |
19:51:01 | FromDiscord | <guttural666> In reply to @hotdog "Looks like on that": yep, that's what I found out as well, investigating rn |
20:06:26 | FromDiscord | <! Nilts> How would i compile a program on windows with an icon n the output exe |
20:10:20 | FromDiscord | <hotdog> In reply to @not logged in "How would i compile": Haven't used it myself, but maybe try this - https://nimble.directory/pkg/rcedit |
20:31:26 | FromDiscord | <guttural666> curl is available on Windows I suppose? |
20:33:30 | FromDiscord | <Kermithos> In reply to @guttural666 "curl is available on": yeah but you could also use std/httpclient which is written in nim |
20:34:54 | FromDiscord | <guttural666> In reply to @Kermithos "yeah but you could": yeeees, now we're talking, was lookig for something clean like this, not this utter hackery hahaha https://media.discordapp.net/attachments/371759389889003532/1045799762823217202/image.png |
20:35:33 | FromDiscord | <guttural666> a nim crown for you, thanks for the hint |
20:35:56 | FromDiscord | <Kermithos> yeah that looks really ugly 😄 |
20:36:07 | FromDiscord | <guttural666> total crutch haha |
20:36:14 | FromDiscord | <Kermithos> if you really want to use curl there is also https://github.com/Araq/libcurl |
20:36:38 | FromDiscord | <Kermithos> but httpclient is way easier |
20:37:37 | FromDiscord | <guttural666> just want to dump the html, search for what I need and go on 🙂 looking into httpclient rn |
20:53:47 | FromDiscord | <guttural666> how do I manually compile src/Medl.nim to Medl |
20:54:01 | FromDiscord | <guttural666> have just used nimble build all the time until now |
20:54:33 | FromDiscord | <guttural666> tried this, but this compiles to the src dir↵nim c src/Medl.nim |
20:57:10 | FromDiscord | <Kermithos> --outdir:DIR↵set the path where the output file will be written |
20:57:16 | FromDiscord | <Kermithos> https://nim-lang.org/docs/nimc.html |
20:57:20 | FromDiscord | <guttural666> thank you! |
20:58:08 | FromDiscord | <guttural666> can I just specify the current dir from which I am running nim |
20:58:45 | FromDiscord | <guttural666> ($PWD) seems to work in fish |
20:59:19 | FromDiscord | <Kermithos> `nim c src/Medl.nim --outdir:./` ? |
21:00:16 | FromDiscord | <guttural666> hm |
21:00:18 | FromDiscord | <guttural666> https://media.discordapp.net/attachments/371759389889003532/1045806151931023450/image.png |
21:01:21 | FromDiscord | <Kermithos> oh yea, I think `--outdir:./` should be after `nim c` not at the end |
21:01:46 | FromDiscord | <guttural666> okay this works nim c --outdir:$PWD src/Medl.nim |
21:02:16 | FromDiscord | <guttural666> exactly options whould be after the command |
21:02:24 | FromDiscord | <guttural666> thanks! |
21:03:39 | * | leehbi joined #nim |
21:03:43 | * | leehbi quit (Remote host closed the connection) |
21:10:55 | * | Ziw joined #nim |
21:12:15 | * | Ziw quit (Quit: WeeChat 2.8) |
21:12:38 | * | Ziw joined #nim |
21:14:40 | * | leehbi joined #nim |
21:15:25 | * | leehbi quit (Remote host closed the connection) |
21:18:42 | FromDiscord | <yrashk> Is it possible to have a block in a `.nimble` file that would be evaluated when dependencies are available? |
21:57:45 | FromDiscord | <demotomohiro> The .nimble file is interpreted using NimScript. So I think you can import modules and call macros. |
22:01:08 | * | sagax joined #nim |
22:02:20 | Ziw | hi |
22:03:54 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Is there any way to read each byte of a file as it is coming in? Like a file stream sort of |
22:05:20 | * | Jjp137 quit (Quit: Leaving) |
22:08:54 | FromDiscord | <Elegantbeef> What's wrong with file stream or the io file api? |
22:09:40 | * | Jjp137 joined #nim |
22:09:49 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Nothing, i just have never heard of it. This is what im asking |
22:10:11 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How do i use it? |
22:10:39 | FromDiscord | <Elegantbeef> Well there is the `io` module which is imported by default https://nim-lang.org/docs/io.html and the steams module which you need to import https://nim-lang.org/docs/streams.html |
22:13:34 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Is there like an iterator to iterate throught the bytes? |
22:13:35 | FromDiscord | <Elegantbeef> You can easily make it |
22:13:42 | FromDiscord | <yrashk> In reply to @demotomohiro "The .nimble file is": I tried. Doesn't work. |
22:14:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gS6 |
22:14:17 | FromDiscord | <yrashk> Is it possible to tell what binary we're building in `config.nims` (there's more than one in the `.nimble` file) |
22:14:32 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4gS7 |
22:17:52 | FromDiscord | <demotomohiro> @yrashk `projectPath` or `projectName` procs? https://nim-lang.org/docs/nimscript.html#projectPath |
22:18:01 | * | jmdaemon joined #nim |
22:22:33 | FromDiscord | <voidwalker> I was asking about this yesterday: https://en.wikipedia.org/wiki/Dictionary_coder - storing strings and other large symbols as indexes of a dictionary. Any library that handles something like this ? |
22:34:01 | FromDiscord | <yrashk> In reply to @demotomohiro "<@145563987772309504> `projectPath` or `projectName": It is _almost_ useful. It gives me the binary name but without the extension. I have @["lib.so","bin"] and it gives me `lib` for the first one.↵↵But it still builds lib.so, of course. |
22:40:31 | FromDiscord | <guttural666> anybody know whats going on? I'm using httpclient to get the content of a website (what I would do with curl), but the output (top right) does not contain all the data that I would expect (comparing it with the html data I get when saving the whole site with Firefox on the lower right) https://media.discordapp.net/attachments/371759389889003532/1045831375363768392/image.png |
22:44:21 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:45:04 | * | jjido joined #nim |
22:46:22 | FromDiscord | <Elegantbeef> The actual request that gets the information is `https://www.metal-archives.com/search/ajax-band-search/?field=name&query=werwolf&sEcho=1&iColumns=3&sColumns=&iDisplayStart=0&iDisplayLength=200&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2` |
22:47:06 | FromDiscord | <guttural666> did I miss something in the firefox inspection tool? |
22:47:12 | FromDiscord | <Elegantbeef> The search site uses the query information for a specific get |
22:47:15 | FromDiscord | <Elegantbeef> Yes |
22:47:42 | FromDiscord | <Elegantbeef> This is what that url you're using fetches |
22:47:43 | FromDiscord | <Elegantbeef> Which is exactly what you get |
22:48:11 | FromDiscord | <Elegantbeef> This is what that url i showed provides |
22:48:34 | FromDiscord | <Elegantbeef> Which i think is what you want? |
22:49:22 | FromDiscord | <Elegantbeef> `https://www.metal-archives.com/search/ajax-band-search/?field=name&query=werwolf` seems to also get what you want |
22:49:42 | FromDiscord | <guttural666> testing |
22:49:44 | FromDiscord | <Elegantbeef> something something be kind and dont bombard their site with spam |
22:51:25 | FromDiscord | <guttural666> yeah, this looks perfect https://media.discordapp.net/attachments/371759389889003532/1045834119386501211/image.png |
22:51:58 | FromDiscord | <guttural666> not sure how you found that out tho, I am lookig at the firefox website inspection thing |
22:52:12 | FromDiscord | <Elegantbeef> I was looking at it too |
22:52:20 | FromDiscord | <Elegantbeef> Send a request with the network tab open |
22:52:37 | FromDiscord | <Elegantbeef> You see multiple requests, click on them to view their body. Find the first one that works carry on |
22:57:52 | FromDiscord | <guttural666> where do you get those urls from? looking at the table id="search results" rn https://media.discordapp.net/attachments/371759389889003532/1045835742259187742/image.png |
22:58:20 | FromDiscord | <guttural666> network tab opkay |
23:02:50 | FromDiscord | <guttural666> omg, there it is, haha https://media.discordapp.net/attachments/371759389889003532/1045836993445249065/image.png |
23:03:10 | FromDiscord | <guttural666> learning so much every day, thanks so much! |
23:23:23 | * | pbsds7 joined #nim |
23:24:03 | * | pbsds quit (Ping timeout: 256 seconds) |
23:24:03 | * | pbsds7 is now known as pbsds |
23:28:32 | FromDiscord | <@thatrandomperson5-6310e3b26da03> My project’s toHex used to give this `42494D4730313061BA10BA10BA232323242424252525222222212121BA01020304050102030405EF` and now gives this `42494D4730313061EFBFBD10EFBFBD10EFBFBD232323242424252525222222212121EFBFBD0102030402030405EFBFBD`which breaks everything. How would i fix |
23:32:36 | FromDiscord | <voidwalker> if s.toHex == "badvalue": return "goodValue" else: return s.toHex ? : D |
23:57:04 | * | disso_peach quit (Read error: Connection reset by peer) |