00:00:03 | FromDiscord | <dom96> just add a `: bool` to the template and it works |
00:00:59 | nrds | <Prestige99> hm I need to find a better way to replicate why it isn't working in my actual code base |
00:09:26 | FromDiscord | <impbox [ftsf]> In reply to @retkid "hey so i need": Web sockets? |
00:09:36 | FromDiscord | <tandy> there is websockets in standard js↵(@retkid) |
00:09:52 | FromDiscord | <tandy> https://github.com/nim-lang/standardjs/blob/master/websockets.nim |
00:09:54 | FromDiscord | <impbox [ftsf]> Are you wanting to run the js in a browser? |
00:10:06 | FromDiscord | <retkid> i was about to just program it in JS |
00:10:23 | FromDiscord | <retkid> In reply to @tandy "there is websockets in": thank you |
00:10:31 | FromDiscord | <tandy> or here↵https://github.com/juancarlospaco/nodejs/blob/main/src/nodejs/jswebsockets.nim |
00:10:31 | FromDiscord | <retkid> In reply to @impbox "Web sockets?": net is native and doesn't work in JS |
00:10:40 | FromDiscord | <retkid> In reply to @tandy "or here https://github.com/juancarlospaco/nodejs/bl": didn't like this one |
00:10:50 | FromDiscord | <tandy> you should do github search before doing that \:)↵(@retkid) |
00:11:08 | FromDiscord | <impbox [ftsf]> Well if you're running the js via node you can probably use native sockets |
00:11:13 | FromDiscord | <retkid> In reply to @tandy "you should do github": I had but standardJS is about like 2 bacons away from client |
00:11:26 | FromDiscord | <retkid> In reply to @impbox "Well if you're running": compile errors tho |
00:11:28 | FromDiscord | <impbox [ftsf]> But in a browser you'd need to use web sockets or something else, webrtc perhaps |
00:11:44 | FromDiscord | <tandy> huh↵(@retkid) |
00:11:45 | FromDiscord | <impbox [ftsf]> I don't mean using that library |
00:12:26 | FromDiscord | <retkid> "JS web server nim" isn't gonna bring up standardJS |
00:12:56 | FromDiscord | <retkid> i looked for JSLIB Nim but nothing really came up either |
00:13:02 | FromDiscord | <tandy> language\:nim websockets will |
00:13:36 | FromDiscord | <retkid> i guess i just suck at github searching |
00:18:06 | FromDiscord | <dom96> you can easily use whatever JS libraries you need from Nim. Even the websockets wrapper is less than 60 LOC |
00:20:09 | FromDiscord | <dom96> so just get comfortable writing wrappers and you won't have any problems |
00:30:02 | FromDiscord | <salt rock lamp> i'm so confused, if i have `calc.nims` and `calc.nim` in the same directory, and i write `nim r calc.nim`, it looks like it is trying to run `calc.nims` instead... why is that? |
00:30:25 | FromDiscord | <Elegantbeef> It'll use calc.nims as the config |
00:30:49 | FromDiscord | <salt rock lamp> huh! |
00:30:55 | FromDiscord | <salt rock lamp> well that explains it |
00:31:10 | FromDiscord | <Elegantbeef> Are you doing some nimscript interop or something? |
00:31:13 | FromDiscord | <salt rock lamp> that's kind of confusing but i guess i can see why that's useful |
00:31:18 | FromDiscord | <salt rock lamp> no, i was just experimenting |
00:31:41 | FromDiscord | <salt rock lamp> i copied the same file and put a shebang at the top |
00:32:31 | FromDiscord | <salt rock lamp> would `#!/usr/bin/env nim r --hints:off` work? |
00:33:14 | FromDiscord | <salt rock lamp> hah it does |
00:33:16 | FromDiscord | <salt rock lamp> nice |
01:05:09 | NimEventer | New post on r/nim by insomniac_lemon: Godot for beginner projects? alternatives?, see https://reddit.com/r/nim/comments/qodqyc/godot_for_beginner_projects_alternatives/ |
01:41:31 | FromDiscord | <impbox [ftsf]> It should probably need calc.cfg.nims or something |
01:52:44 | * | krux02 quit (Remote host closed the connection) |
02:57:11 | * | neurocyte0132889 quit (Ping timeout: 245 seconds) |
03:00:50 | * | arkurious quit (Quit: Leaving) |
03:18:19 | FromDiscord | <Goat> I don't know why I made this https://media.discordapp.net/attachments/371759389889003532/906744345548439582/unknown.png |
03:18:22 | FromDiscord | <Goat> https://media.discordapp.net/attachments/371759389889003532/906744359381250088/unknown.png |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
06:45:21 | * | stkrdknmibalz quit (Ping timeout: 268 seconds) |
07:28:39 | FromDiscord | <retkid> is there any way to like |
07:28:56 | FromDiscord | <retkid> Marshel from nim into JS |
07:29:18 | FromDiscord | <Elegantbeef> What do you mean |
07:30:00 | FromDiscord | <retkid> is Marshel using a standardized thing that I can just use Marshel in JS cast it into an array |
07:30:28 | FromDiscord | <Elegantbeef> I dont follow |
07:30:38 | nrds | <Prestige99> I'm setting up CI for my game engine that uses chipmunk 7.0.3, but getting an error when running the tests `could not import: cpBodySetVelocityUpdateFunc` - That's the name of a c function that the chipmunk wrapper has wrapped; I thought it first maybe the chipmunk version in CI was outdated, but it seems correct. Any thoughts on what would cause this? |
07:31:02 | FromDiscord | <retkid> In reply to @Elegantbeef "I dont follow": ok so |
07:31:39 | FromDiscord | <retkid> You have a sequence in Nim, that you use marshal to save it to a Json |
07:32:05 | FromDiscord | <retkid> can I then read that Json and cast it to an array |
07:32:16 | FromDiscord | <retkid> (edit) "can I then read that Json and cast it to an array ... " added "or dict or something" |
07:32:27 | FromDiscord | <retkid> (edit) "can I then read that Json ... and" added "in JS" |
07:33:49 | FromDiscord | <Elegantbeef> is this native Nim -\> Js or Nim Js -\> Js? |
07:34:26 | FromDiscord | <retkid> Nim JS? |
07:34:28 | FromDiscord | <retkid> thats a thing |
07:34:40 | FromDiscord | <retkid> nah its just Nim -> JS |
07:34:45 | FromDiscord | <Elegantbeef> You can compile nim to JS yes |
07:34:49 | FromDiscord | <retkid> oh that |
07:34:51 | FromDiscord | <retkid> no |
07:35:14 | FromDiscord | <retkid> hand written JS |
07:35:25 | nrds | <Prestige99> Regarding my above question, it is outdated |
07:35:40 | FromDiscord | <Elegantbeef> Is it interoping Nim's JS or native Nim? |
07:36:12 | FromDiscord | <retkid> native Nim |
07:36:25 | FromDiscord | <Elegantbeef> Ok so then the best thing to do is to convert to json directly and send that |
07:36:36 | FromDiscord | <Elegantbeef> the marshal module doesnt serve much of a purpose anyway |
07:36:52 | FromDiscord | <retkid> do i use Jsonify for that one? |
07:37:03 | FromDiscord | <Elegantbeef> You can use any Json library you want |
07:37:06 | FromDiscord | <retkid> that is a pain ;-; |
07:37:29 | FromDiscord | <retkid> actually |
07:37:32 | FromDiscord | <Elegantbeef> It's like 3 seconds to change |
07:37:39 | FromDiscord | <retkid> well, i have a whole database |
07:37:44 | FromDiscord | <retkid> that used Marshal |
07:37:46 | FromDiscord | <retkid> because im stupid |
07:38:14 | FromDiscord | <retkid> I can use my monkey brain to figure this out tho |
07:38:39 | FromDiscord | <Elegantbeef> Marhsal is a weird module that imo exists for 0 reason |
07:38:46 | FromDiscord | <Elegantbeef> It doesnt do anything any Json library cant do |
08:42:55 | FromDiscord | <evoalg> I figured out how to sort a seq[(int, int)] by the 2nd element, descending ... https://play.nim-lang.org/#ix=3EgH ... I'm wondering if there's a lambda way of doing it, or is this the right approach? |
08:46:03 | FromDiscord | <Elegantbeef> I dont like lambdas but this should work https://play.nim-lang.org/#ix=3EgJ |
08:48:33 | FromDiscord | <evoalg> Oh thank you! ... I didn't realize you could drop a proc right in there - that's so cool ... is this the way you would do it, or is it just how to make it work on one line type-of-thing? |
08:49:06 | FromDiscord | <Elegantbeef> I dont like lambdas so i'd probably just keep the way you did it just, but use cmp like i did |
08:49:47 | FromDiscord | <evoalg> gotcha thank you! |
08:51:44 | FromDiscord | <evoalg> You don't like lambdas because of readability right? |
08:52:34 | FromDiscord | <Elegantbeef> I also dont like that they limit reuse |
08:52:53 | FromDiscord | <Elegantbeef> For a slightly more readable version you can also do https://play.nim-lang.org/#ix=3EgM |
08:53:02 | FromDiscord | <Elegantbeef> Using `sugar`'s `=>` |
08:53:49 | FromDiscord | <evoalg> Ohhh thank you for the different options ... and thank you for the explanation - makes sense |
08:55:15 | FromDiscord | <Elegantbeef> For one offs i guess they make sense, and i've been using anonymous procedures for my game i'm working on though using the `do` notation for it https://github.com/beef331/mindthegap3D/blob/master/src/core/worlds.nim#L41-L50 |
08:56:06 | FromDiscord | <Elegantbeef> But i think this is one of the cleaner solutions for my problem of asset loading after opengl has been init'd |
08:57:43 | NimEventer | New Nimble package! aossoa - Use a Structure of Arrays like an Array of Structures, see https://github.com/guibar64/aossoa |
08:59:09 | FromDiscord | <evoalg> What sort of game is it? What does the player have to do? |
08:59:39 | FromDiscord | <Elegantbeef> If i stick with it, it's just this but in 3D https://streamable.com/pj725f |
09:00:50 | FromDiscord | <evoalg> 3D sounds scary hard (to me) |
09:01:08 | FromDiscord | <Elegantbeef> Eh it's still mostly a 2D game |
09:01:20 | FromDiscord | <Elegantbeef> The 3Dness is mostly in rendering |
09:01:47 | FromDiscord | <evoalg> cool |
09:01:48 | FromDiscord | <Rika> In reply to @NimEventer "New Nimble package! aossoa": Cool package this SoA one |
09:02:03 | FromDiscord | <Elegantbeef> Doesnt lqdev's datarray already do this? |
09:02:25 | FromDiscord | <Rika> I don’t remember it probably does |
09:02:37 | FromDiscord | <Rika> Not that I have any use for such things yet |
09:03:16 | FromDiscord | <Rika> In reply to @Elegantbeef "For one offs i": Honestly with regards to the do notation I feel like one of the function building syntaxes has to go |
09:03:31 | FromDiscord | <Rika> Feels redundant for no reason |
09:04:03 | FromDiscord | <Rika> Personally think the do function syntax should go but that’s because I have no idea what benefits that gives over anonymous proc syntax |
09:04:05 | FromDiscord | <Elegantbeef> I dont think i use any of the other variants ever so meh |
09:05:46 | FromDiscord | <Elegantbeef> Though the `do` syntax is a bit obscure, and i had quite a bit of trouble understanding it the first time i seen it |
09:06:47 | FromDiscord | <Elegantbeef> I dont even need it in this case |
09:06:52 | FromDiscord | <Elegantbeef> Since it's a `proc()` |
09:07:34 | FromDiscord | <Rika> I mean that do syntax is fine |
09:07:42 | FromDiscord | <Rika> I meant that do proc building syntax is not |
09:07:47 | FromDiscord | <Rika> There is a reason for do |
09:07:51 | FromDiscord | <Rika> Not for do () |
09:09:00 | FromDiscord | <Elegantbeef> Anyway i need to go to sleep now before i forget about DST 😀 |
09:09:19 | FromDiscord | <Elegantbeef> Fuck DST |
09:22:09 | FromDiscord | <ynfle (ynfle)> @evoalg there is also `sortedByIt`, but it doesn't seem to support `Descending` |
09:39:19 | FromDiscord | <Rika> Yeah because you use comparison operators there instead of cmp function |
09:44:11 | FromDiscord | <ynfle (ynfle)> I don't get it? You don't pass in operators to `sortedByIt` |
09:48:33 | FromDiscord | <evoalg> yea no descending is `sortedByIt`'s big downfall (for me) |
09:55:02 | FromDiscord | <impbox [ftsf]> sortedByIt(-it.whatever) |
09:57:27 | * | krux02 joined #nim |
09:58:32 | FromDiscord | <evoalg> In reply to @impbox "sortedByIt(-it.whatever)": gosh that works! |
10:00:22 | FromDiscord | <impbox [ftsf]> of course, you're just sorting by the negative of the value, which is the same as a descending sort |
10:01:41 | FromDiscord | <evoalg> Thank! ... it's not in-place sort, but it's still cool |
10:06:37 | FromDiscord | <evoalg> why can I do `var x = @[50, 40, 30, 20, 10].sorted` but I can't do `var x = @[50, 40, 30, 20, 10].sort` ? |
10:06:57 | FromDiscord | <impbox [ftsf]> because sort doesn't return a value |
10:07:13 | FromDiscord | <evoalg> of course - thank you! |
10:07:19 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3Eh9 |
10:07:31 | FromDiscord | <impbox [ftsf]> the error message should give you a hint |
10:08:36 | FromDiscord | <evoalg> the error message says `'@[50, 40, 30, 20, 10]' is immutable, not 'var'` so it's confusing |
10:08:56 | FromDiscord | <impbox [ftsf]> yep `@[50, 40, 30, 20, 10]` is a seq literal |
10:09:25 | FromDiscord | <impbox [ftsf]> you're telling it to sort the seq literal rather than x |
10:09:53 | FromDiscord | <evoalg> gotcha ok, that makes sense |
10:10:41 | FromDiscord | <impbox [ftsf]> whereas `sorted` doesn't require a var argument |
10:11:00 | FromDiscord | <impbox [ftsf]> because it takes the argument and returns a new seq |
10:11:57 | FromDiscord | <evoalg> that's kind of nice, if it's to remain sorted ... also makes sense - thank you! |
11:02:32 | * | Vladar joined #nim |
11:22:19 | Amun-Ra | that works exactly like in python |
11:46:27 | * | xet7 quit (Remote host closed the connection) |
11:47:30 | * | xet7 joined #nim |
11:48:53 | * | xet7 quit (Remote host closed the connection) |
11:49:21 | * | xet7 joined #nim |
12:02:14 | * | elph quit (Quit: Connection closed for inactivity) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
13:04:14 | FromDiscord | <tandy> bruihhhhh im dumb↵(@elmaco) |
13:28:25 | FromDiscord | <ratapenado> Btw why do Nimrod was renamed Nim ? |
14:01:34 | * | arkurious joined #nim |
14:23:24 | FromDiscord | <ynfle (ynfle)> Nimrod has a negative connotation in English |
14:46:58 | FromDiscord | <ratapenado> Oh ? What kind ? |
14:48:51 | FromDiscord | <Rika> stupid |
14:50:56 | FromDiscord | <IsaacPaul> yea pretty much, I'm sure it also has sarcastic roots since Nimrod was the name of a skilled hunter. |
14:54:36 | * | neurocyte0132889 joined #nim |
14:54:36 | * | neurocyte0132889 quit (Changing host) |
14:54:36 | * | neurocyte0132889 joined #nim |
14:57:11 | * | neurocyte0132889 quit (Client Quit) |
15:01:01 | * | neurocyte0132889 joined #nim |
15:01:01 | * | neurocyte0132889 quit (Changing host) |
15:01:02 | * | neurocyte0132889 joined #nim |
15:04:05 | * | neurocyte0132889 quit (Client Quit) |
15:05:39 | * | neurocyte0132889 joined #nim |
15:05:39 | * | neurocyte0132889 quit (Changing host) |
15:05:39 | * | neurocyte0132889 joined #nim |
15:25:28 | * | CyberTailor joined #nim |
15:34:19 | madprops | what am I doing wrong: toSeq(walkFiles(rpath)) |
15:34:27 | madprops | I just want a list of file names |
15:34:53 | madprops | iterate over them |
15:35:02 | madprops | but it retuns an empty list |
15:37:21 | madprops | oh maybe I needed walkdir |
15:49:53 | CyberTailor | is it possible to install nimble packages that have deps without downloading package.json? |
15:51:00 | FromDiscord | <DMI-1407> is there a demo or tutorial or som project that shows how to create a gui that works on win and linux (e.g. ubuntu) ? |
15:51:14 | FromDiscord | <DMI-1407> (edit) "som" => "some sort of" |
15:51:53 | FromDiscord | <DMI-1407> (without doing everything from scratch in an canvas like webgl or so......) |
15:52:29 | FromDiscord | <dom96> CyberTailor: as long as all those deps are specified using urls it will work |
15:58:46 | CyberTailor | dom96: i mean, without nimble using network |
16:03:32 | FromDiscord | <dom96> then no, what are you trying to do? Why avoiding the network? |
16:05:51 | CyberTailor | because of sandbox |
16:06:58 | CyberTailor | if i do "nimble install --nimbleDir:/opt/nimble", it finds dependencies |
16:07:29 | CyberTailor | but then tries to write to /opt/nimble and gets access denied by sandbox |
16:08:16 | CyberTailor | so it has to read deps from /opt/nimble and install to /var/tmp/portage/dev-nim/example/image/opt/nimble |
16:12:12 | CyberTailor | is there something like "install without checking dependencies"? |
16:12:26 | FromDiscord | <tandy> is there a way to have an int as +/- infinity? |
16:12:46 | FromDiscord | <tandy> `high(BiggestInt)` |
16:14:41 | FromDiscord | <Rika> no, ints do not have infinity |
16:37:46 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
16:40:53 | * | neurocyte0132889 joined #nim |
16:40:53 | * | neurocyte0132889 quit (Changing host) |
16:40:53 | * | neurocyte0132889 joined #nim |
16:46:51 | CyberTailor | i'll just try sed'ding out all "require" lines :P |
17:11:39 | * | anjovi quit (Ping timeout: 276 seconds) |
17:20:15 | madprops | is the a tool to extract tags from html like <title> ? |
17:20:22 | madprops | there* |
17:20:33 | madprops | from an html string |
17:20:46 | madprops | like what cheerio is to node |
17:21:21 | madprops | ah i see there's htmlparser |
17:21:47 | * | rb quit (Quit: ZNC - https://znc.in) |
17:22:46 | madprops | but it seems it only reads from a file |
17:23:37 | * | rwb joined #nim |
17:24:55 | madprops | ah nvm |
17:26:39 | NimEventer | New thread by Carterza: Did you know that Nim has had enum-indexed arrays since 0.18? Poll Inside!, see https://forum.nim-lang.org/t/8600 |
17:29:12 | madprops | why is the nim docs using "func" instead of "proc" ? |
17:30:03 | FromDiscord | <IsaacPaul> It's basically proc with extra macros: {.noSideEffect, locks: 0.} |
17:32:40 | NimEventer | New thread by Arnetheduck: Nlvm update - llvm 13.0.0, see https://forum.nim-lang.org/t/8601 |
17:32:59 | madprops | so when do I want to use func? |
17:34:11 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3EjY |
17:34:26 | nixfreak_nim[m] | When you don't have any side-effects |
17:34:39 | FromDiscord | <IsaacPaul> a is unchanged, b is unchanged in the provided example |
17:35:05 | FromDiscord | <IsaacPaul> Honestly, I'm surprised that it doesn't figure it out at compile time. |
17:35:37 | FromDiscord | <IsaacPaul> maybe It's more difficult than I'm imagining lol |
17:38:00 | FromDiscord | <Rika> In reply to @IsaacPaul "Honestly, I'm surprised that": wdym> |
17:38:48 | FromDiscord | <Rika> proc -> used when you explicitly want side effects↵func -> used when you explicitly dont want side effects |
17:39:28 | madprops | what do you mean by side effects? |
17:39:48 | madprops | like changing global state? |
17:39:52 | FromDiscord | <Rika> yes |
17:40:30 | madprops | haven't seen that distinction in other languages |
17:40:40 | madprops | but i guess it makes sense |
17:40:49 | madprops | does it warn you if you don't use it properly? |
17:40:58 | madprops | gonna try it myself |
17:41:01 | FromDiscord | <Rika> it fails to compile |
17:41:10 | FromDiscord | <Rika> only if you use func |
17:41:58 | FromDiscord | <dom96> !eval var global = "foo"; func bad() = global.add("hello"); bad() |
17:42:00 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: 'bad' can have side effects |
17:42:31 | madprops | cool |
17:42:54 | FromDiscord | <Rika> explicit var parameters are not counted as side effects, which is a departure from the mathematical meaning |
17:42:56 | FromDiscord | <Rika> afaik |
17:43:47 | * | rwb is now known as rb |
17:43:54 | FromDiscord | <Rika> so if you want "real" no-side-effect guarantees, dont use var params and use strict functions (i forgot the actual name, someone else please send the real name or so) |
18:09:01 | * | CyberTailor quit (Quit: Konversation terminated!) |
18:18:56 | FromDiscord | <exelotl> it is `{.experimental:"strictFuncs".}` iirc |
18:23:12 | nixfreak_nim[m] | so only use let and make sure its immutable right? |
18:26:54 | FromDiscord | <IsaacPaul> In reply to @Rika "proc -> used when": ah I misunderstood it's use. |
18:45:40 | FromDiscord | <reilly> Does the standard library have something for splitting a seq into a seq of x equally-sized seqs? (+/- 1 for odd lengths) |
18:53:33 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3Ekq |
19:13:31 | FromDiscord | <brainproxy> seems to have to do with stdout being in non-blocking mode... not sure actually |
19:20:39 | FromDiscord | <ynfle (ynfle)> side effects include file IO and stdout, stderr & stdin. |
19:21:13 | FromDiscord | <ynfle (ynfle)> @reilly, I tried finding something but couldn't find it |
20:08:05 | FromDiscord | <Goat> Are there any good guides on setting up a docker image for nim development? |
20:09:31 | nixfreak_nim[m] | I'm looking for examples of jsffi in Nim |
20:10:08 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsfetch.nim is probably a good reference |
20:10:41 | FromDiscord | <dom96> https://github.com/search?l=Nim&q=import+jsffi&type=Code 🙂 |
20:11:47 | FromDiscord | <Elegantbeef> Hey the first two are just cause nimscripter 😀 |
20:12:30 | FromDiscord | <Elegantbeef> Hmm does this mean github search inst useless anymore in a repo? |
20:16:21 | nixfreak_nim[m] | probably a really dumb question, but since I'm new at this here it goes: If you want to use an external javascript library would you have to download the source of that library in order to use jssfi ? or how does that work? |
20:17:32 | FromDiscord | <Elegantbeef> As long as the JS is accessible from the generated nim file it doesnt matter |
20:17:59 | FromDiscord | <Elegantbeef> When you do interop it doesnt know if procedures exist and will not know until runtime |
20:21:28 | nixfreak_nim[m] | Do you know of a really simple example of an external js library maybe a couple of functions then using nim to import those functions? |
20:21:56 | nixfreak_nim[m] | I guess I'm just not understanding how this works |
20:24:15 | FromDiscord | <Elegantbeef> This emits JS functions and wraps them in a single file, might be more clear |
20:24:16 | FromDiscord | <Elegantbeef> https://github.com/beef331/mrapi/blob/master/src/mrapi.nim |
20:24:34 | FromDiscord | <Elegantbeef> Though i wouldnt suggest using it, i couldnt be arsed to properly wrap the API since it suuuucks 😀 |
20:26:21 | FromDiscord | <Goat> From the manual https://media.discordapp.net/attachments/371759389889003532/907003058477752340/unknown.png |
20:29:02 | nixfreak_nim[m] | Oh there we go , thanks Goat and ElegantBeef |
20:31:03 | FromDiscord | <Goat> If you're compiling for node you can use the `require("lib")` for using it's libraries I'm pretty sure |
20:31:30 | FromDiscord | <brainproxy> sent a long message, see http://ix.io/3EkV |
20:32:02 | FromDiscord | <Elegantbeef> You probably want to flush |
20:34:19 | FromDiscord | <brainproxy> even if I called `setStdIoUnbuffered()`? |
20:34:41 | FromDiscord | <Elegantbeef> Probably not in that case |
20:49:16 | nixfreak_nim[m] | so whats the difference between just using {.importc.} too https://nim-lang.org/docs/jsffi.html |
20:54:17 | FromDiscord | <Yardanico> importjs supports advanced syntax like importcpp |
20:54:23 | FromDiscord | <Yardanico> and it just makes a little more sense when reading the code :) |
20:54:35 | FromDiscord | <Yardanico> but yes, for simple js functions you can use importc, although why not always use importjs |
20:55:03 | nixfreak_nim[m] | I'm just going off the sample in the nim backend docs |
21:11:53 | FromDiscord | <dom96> In reply to @brainproxy "learning more about the": that sounds like you or some library you're using has turned your stdout fd to be non-blocking |
21:17:15 | FromDiscord | <brainproxy> In reply to @dom96 "that sounds like you": is there a way to check? a way to change it back to blocking? |
21:22:25 | FromDiscord | <dom96> yeah, try something like this: https://stackoverflow.com/questions/23865898/when-non-blocking-i-o-is-turned-on-for-stdout-is-it-correct-for-the-os-to-turn |
21:22:49 | FromDiscord | <dom96> (you can just `emit` it) |
21:49:01 | FromDiscord | <brainproxy> In reply to @dom96 "(you can just `emit`": not sure what you mean |
21:51:20 | FromDiscord | <dom96> I mean you can just copy and paste the C code (mostly) and use https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma |
21:55:29 | FromDiscord | <dom96> really loving the subtle iterative improvements we're seeing in the Nim docs, that green "Note" ❤️ |
22:06:16 | * | Vladar quit (Quit: Leaving) |
22:17:28 | FromDiscord | <Zoom> Do you really need seqs and not just slices? There will be copying even if you're not going to grow the chunks.↵(@reilly) |
22:19:22 | FromDiscord | <Elegantbeef> This is Nim people use strutils 😛 |
22:22:15 | FromDiscord | <Zoom> Mkay, if this is not a concern, here's it\: https://play.nim-lang.org/#ix=3Elm |
22:22:44 | FromDiscord | <Yardanico> but there's a proc in sequtils |
22:23:05 | FromDiscord | <Yardanico> https://nim-lang.org/docs/sequtils.html#distribute%2Cseq%5BT%5D%2CPositive |
22:24:05 | FromDiscord | <Zoom> 🤦 uncommon naming strikes again |
22:24:34 | FromDiscord | <Elegantbeef> Well it's also an uncommon need 😛 |
22:25:54 | FromDiscord | <Zoom> If it is, why the hell it's in std 😆 |
22:27:04 | FromDiscord | <Elegantbeef> It has an odd growth pattern |
22:27:14 | FromDiscord | <Elegantbeef> Much like a wart |
22:31:01 | FromDiscord | <impbox [ftsf]> Yeah i thought i wanted distribute but it wasn't what i wanted |
22:31:15 | FromDiscord | <impbox [ftsf]> I want split seq into chunks of size X |
22:31:46 | FromDiscord | <impbox [ftsf]> where distribute is split seq into X chunks |
22:32:36 | FromDiscord | <impbox [ftsf]> Wasn't hard to write though |
22:48:39 | FromDiscord | <tandy> dam↵(@Rika) |
23:06:25 | nrds | <Prestige99> How do I unmarshal json that starts with an array? If I try naming that array in the nim type declaration, it says that key was non found |
23:08:19 | nrds | <Prestige99> e.g. https://play.nim-lang.org/#ix=3ElA |
23:10:59 | nrds | <Prestige99> I suppose I can just add a key |
23:13:37 | FromDiscord | <Elegantbeef> If you dont mind manual labour https://play.nim-lang.org/#ix=3ElB |
23:13:46 | NimEventer | New post on r/nim by aj_breidenbach: I made a thing for hosting and sharing videos, see https://reddit.com/r/nim/comments/qp0e7l/i_made_a_thing_for_hosting_and_sharing_videos/ |
23:34:18 | * | xet7 quit (Ping timeout: 260 seconds) |
23:40:45 | FromDiscord | <exelotl> uuuh so I changed my entity flags to a set |
23:41:10 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3ElG |
23:41:24 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3ElH |
23:41:26 | FromDiscord | <exelotl> which feels like a downgrade :( |
23:41:59 | FromDiscord | <exelotl> is there a better way? |
23:42:04 | FromDiscord | <Elegantbeef> `import std/setutils` `self.flags[Hidden] = hidden` |
23:42:19 | FromDiscord | <exelotl> omg |
23:42:26 | FromDiscord | <exelotl> you absolute beast |
23:42:41 | FromDiscord | <Elegantbeef> I didnt make that though 😛 |
23:42:52 | FromDiscord | <exelotl> oh 😅 |
23:44:05 | FromDiscord | <exelotl> seems like I need to look more into setutils |
23:44:27 | FromDiscord | <Elegantbeef> we've got `fullSet` `complement` and that iirc |
23:46:04 | * | xet7 joined #nim |