00:08:18 | * | tiorock joined #nim |
00:08:18 | * | tiorock quit (Changing host) |
00:08:18 | * | tiorock joined #nim |
00:08:18 | * | rockcavera is now known as Guest84662 |
00:08:18 | * | tiorock is now known as rockcavera |
00:08:39 | * | rockcavera quit (Read error: Connection reset by peer) |
00:10:05 | * | rockcavera joined #nim |
00:10:48 | * | Guest84662 quit (Ping timeout: 240 seconds) |
00:24:20 | * | Jaxx0 joined #nim |
00:24:36 | * | Jaxx0 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
00:26:27 | * | wayne20 joined #nim |
00:26:39 | * | wayne20 quit (Remote host closed the connection) |
00:47:22 | * | arkurious quit (Quit: Leaving) |
01:07:27 | FromDiscord | <Varriount> Hrm.↵From a design level, anyone have idea why using `0`, `1`, and `2` for standard input, output, and error streams, and `-1` for an invalid stream, would be better than using `1`, `2`, `3`, and `0`, respectively? |
01:14:08 | FromGitter | <kaushalmodi> Varriount: https://en.wikipedia.org/wiki/File_descriptor |
01:15:08 | FromGitter | <kaushalmodi> Also https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html; search "_FILENO" |
01:34:58 | FromDiscord | <Rika> what tricks do yall know of to generate "cleaner" js? i forget what stuff i can do, no stack traces, etc |
01:36:19 | FromDiscord | <ElegantBeef> well `-d:danger` is the first major thing |
01:57:14 | * | SSR-t joined #nim |
01:57:33 | * | SSR-t quit (Remote host closed the connection) |
01:59:12 | FromDiscord | <Hi02Hi> the `do {...} while (false)` loops are so infuriating |
01:59:59 | FromDiscord | <Rika> In where? That is needed for creating a new scope in C I believe |
02:02:17 | FromDiscord | <Rika> Ah, it’s for a breakable block |
02:17:01 | * | Northstrider[m] quit (*.net *.split) |
02:17:04 | * | motersen_ quit (*.net *.split) |
02:17:04 | * | fantis quit (*.net *.split) |
02:17:04 | * | robertmeta quit (*.net *.split) |
02:17:04 | * | fowl quit (*.net *.split) |
02:17:04 | * | skelett quit (*.net *.split) |
02:17:04 | * | Yardanico quit (*.net *.split) |
02:17:04 | * | Araq quit (*.net *.split) |
02:17:04 | * | revere quit (*.net *.split) |
02:17:04 | * | Zevv quit (*.net *.split) |
02:17:04 | * | idxu quit (*.net *.split) |
02:17:04 | * | jken quit (*.net *.split) |
02:17:07 | * | vqrs quit (*.net *.split) |
02:17:08 | * | nickster quit (*.net *.split) |
02:17:23 | * | vqrs joined #nim |
02:17:29 | * | Araq joined #nim |
02:17:30 | * | nickster joined #nim |
02:17:43 | * | motersen_ joined #nim |
02:17:44 | * | fantis joined #nim |
02:18:04 | * | robertmeta joined #nim |
02:18:04 | * | fowl joined #nim |
02:18:04 | * | skelett joined #nim |
02:18:04 | * | Yardanico joined #nim |
02:21:30 | * | revere joined #nim |
02:21:30 | * | Zevv joined #nim |
02:21:30 | * | idxu joined #nim |
02:21:30 | * | jken joined #nim |
02:21:40 | * | Northstrider[m] joined #nim |
02:22:22 | * | johnnynitwits joined #nim |
02:24:12 | FromDiscord | <Rika> In reply to @ElegantBeef "well `-d:danger` is the": Well yes other than the obvious |
02:25:54 | * | threenp joined #nim |
02:26:34 | * | D_ quit (Remote host closed the connection) |
02:26:50 | * | D_ joined #nim |
02:43:48 | * | AntiComposite joined #nim |
02:43:49 | * | AntiComposite is now known as Guest75234 |
02:44:18 | * | Guest75234 quit (Remote host closed the connection) |
02:46:50 | * | omnigoat quit (Remote host closed the connection) |
03:01:11 | * | nortti^0 joined #nim |
03:01:47 | * | nortti^0 quit (Remote host closed the connection) |
03:03:28 | * | johnnynitwits quit (Ping timeout: 258 seconds) |
03:03:51 | * | threenp quit (Ping timeout: 258 seconds) |
03:20:03 | * | bjs17 joined #nim |
03:20:20 | * | bjs17 quit (Remote host closed the connection) |
03:31:08 | * | omnigoat joined #nim |
03:44:14 | * | spiderstew_ joined #nim |
03:44:37 | * | Q-Master quit (Quit: No Ping reply in 180 seconds.) |
03:45:44 | * | Q-Master joined #nim |
03:47:11 | * | spiderstew quit (Ping timeout: 258 seconds) |
04:20:45 | FromDiscord | <Varriount> kaushalmodi: I know what a file descriptor is - my question was more about why they are those values in the first place. |
04:20:57 | * | andreagus15 joined #nim |
04:21:40 | * | andreagus15 quit (Remote host closed the connection) |
04:27:40 | FromDiscord | <Rainbow Asteroids> prolly because they are |
04:27:43 | * | rockcavera quit (Remote host closed the connection) |
04:29:14 | * | dogamak221 joined #nim |
04:29:30 | * | dogamak221 quit (Remote host closed the connection) |
04:38:52 | * | Jon0 joined #nim |
04:39:09 | * | Jon0 quit (Remote host closed the connection) |
04:39:50 | leorize[m] | @Varriount: it's a convenience, POSIX APIs returns -1 to indicate an error, so by proxy through FD-creating APIs like `open()`, `-1` become the invalid FD |
04:51:38 | * | EmleyMoor2 joined #nim |
04:52:14 | * | EmleyMoor2 quit (Remote host closed the connection) |
05:07:52 | * | marianoaurelio[m joined #nim |
05:08:25 | * | marianoaurelio[m quit (Remote host closed the connection) |
05:16:37 | * | omnigoat quit (Remote host closed the connection) |
05:18:12 | * | surma quit (K-Lined) |
05:18:12 | * | ormiret quit (K-Lined) |
05:18:12 | * | euantorano quit (K-Lined) |
05:18:13 | * | hoek quit (K-Lined) |
05:18:13 | * | npgm quit (K-Lined) |
05:18:13 | * | d10n-work quit (K-Lined) |
05:18:13 | * | rayman22201 quit (K-Lined) |
05:18:13 | * | robertmeta quit (K-Lined) |
05:18:13 | * | fowl quit (K-Lined) |
05:18:13 | * | saem quit (K-Lined) |
05:18:13 | * | mids quit (K-Lined) |
05:18:13 | * | nikki93 quit (K-Lined) |
05:18:13 | * | zielmicha__ quit (K-Lined) |
05:24:09 | * | narimiran joined #nim |
05:34:20 | * | saem joined #nim |
05:39:39 | * | blackbeard420 quit (*.net *.split) |
05:39:40 | * | termer quit (*.net *.split) |
05:39:40 | * | Fish-Face quit (*.net *.split) |
05:39:40 | * | CcxWrk quit (*.net *.split) |
05:39:40 | * | void09 quit (*.net *.split) |
05:39:40 | * | hpyc9 quit (*.net *.split) |
05:39:48 | * | void09 joined #nim |
05:39:56 | * | blackbeard420 joined #nim |
05:40:20 | * | hpyc9 joined #nim |
05:40:54 | * | Fish-Face joined #nim |
05:41:58 | * | termer joined #nim |
06:07:23 | FromDiscord | <Varriount> @leorize Huh, that hasn't occurred to me. Of course, that also begs the question, "why -1 and errno" |
06:07:55 | FromDiscord | <Varriount> Or on Windows, GetLastError |
06:17:14 | FromDiscord | <Bung> is there any cross-platform inotify like lib ? |
06:29:46 | FromDiscord | <Bung> the `segfaults` module means when access nil I can get stacktrace info like other exception ? |
06:32:47 | * | perepujal joined #nim |
06:33:22 | * | perepujal quit (Remote host closed the connection) |
06:34:26 | FromDiscord | <haxscramper> No, you get stacktrace on nil access anyway, but `std/segfaults` turns it into `NilAccesDefect` that can be caught |
06:34:34 | FromDiscord | <haxscramper> So you get actual defect raised |
06:34:44 | FromDiscord | <haxscramper> Stacktrace is always available |
06:37:02 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pxw |
06:37:35 | FromDiscord | <haxscramper> Though `NilAccess` is a defect and if I remember correctly it cannot be caught with `--panics:on` (disabled by default) |
06:47:09 | FromDiscord | <Bung> oh, I may remenber wrong, it's in dll , when access nil only one line error message |
06:47:26 | leorize[m] | @Varriount I guess errno allows for a kind of deterred error handling, though it's worth noting that some operations can return a not -1 value and have errno set |
06:50:45 | leorize[m] | or it could simply because creating a local to store potential error codes on every syscall was too tiring in C :p |
06:51:10 | * | gmaggior joined #nim |
06:59:08 | leorize[m] | for Windows the MS wanted to use every single bit in a DWORD to describe a given error, which I think is one of the reasons for it to be placed behind a procedure |
07:00:10 | leorize[m] | the same rationale might have driven errno as well, but with modern standards enforcing positive errno values I doubt it was the true reason |
07:04:32 | FromDiscord | <Rainbow Asteroids> why are panics disabled by default? Y'all don't want to break nonsensical code? lol |
07:05:43 | leorize[m] | yep, it's meant to be enables by default but people were catching them left and right, so we gotta compromise |
07:05:49 | leorize[m] | enabled* |
07:07:04 | FromDiscord | <Rainbow Asteroids> maybe in new nimble projects, the switch should be enabled in the config by default or smth |
07:07:56 | leorize[m] | too risky, the issue was that some libraries needed this to function |
07:08:17 | leorize[m] | there will be plans to have it on by default alongside gc:orc |
07:08:31 | FromDiscord | <Rika> What did panics do again |
07:08:45 | leorize[m] | Defect quits your program |
07:18:13 | ForumUpdaterBot | New thread by Xigoi: What is the purpose of do {} while (false) in JavaScript output?, see https://forum.nim-lang.org/t/8105 |
07:25:40 | * | PMunch joined #nim |
07:33:19 | * | Tlanger quit (Quit: Leaving) |
07:39:33 | * | tai[m|gr] joined #nim |
07:40:10 | * | tai[m|gr] quit (Remote host closed the connection) |
07:50:06 | * | ZoomZoomZoom joined #nim |
08:05:56 | * | gmaggior quit (Quit: Leaving) |
08:06:13 | * | gmaggior joined #nim |
08:15:51 | * | gmaggior quit (Quit: Leaving) |
08:19:50 | * | johnnynitwits joined #nim |
08:19:52 | * | threenp joined #nim |
08:30:47 | * | omnigoat joined #nim |
08:44:57 | * | wasutton311 joined #nim |
08:45:08 | * | wasutton311 quit (Remote host closed the connection) |
08:48:11 | FromDiscord | <System64 ~ Flandre Scarlet> How can I read a value at a precise offset of a file please? |
08:51:25 | FromDiscord | <haxscramper> https://nim-lang.org/docs/streams.html#setPosition%2CStream%2Cint |
08:54:29 | * | PMunch quit (Remote host closed the connection) |
08:54:50 | * | PMunch joined #nim |
08:58:24 | * | ZoomZoomZoom quit (Ping timeout: 240 seconds) |
09:01:26 | FromDiscord | <System64 ~ Flandre Scarlet> Steams? Is it the same thing as JavaN |
09:01:27 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "JavaN" => "Java?" |
09:07:13 | FromDiscord | <haxscramper> Actually https://nim-lang.org/docs/io.html#setFilePos%2CFile%2Cint64%2CFileSeekPos might be berrer |
09:07:15 | FromDiscord | <haxscramper> (edit) "berrer" => "better" |
09:07:29 | FromDiscord | <haxscramper> `var file = open("test.txt"); file.setFilePos(12312312312312)` |
09:09:54 | FromDiscord | <System64 ~ Flandre Scarlet> I want to go to the Integer offset 44, I just have to put 44? |
09:11:49 | FromDiscord | <Rika> that goes to byte 44 yes |
09:12:50 | FromDiscord | <System64 ~ Flandre Scarlet> But the values I want to read are int16 (16-bits signed int), it uses 2 bytes, so how can I read it? |
09:14:02 | FromDiscord | <Rika> multiply by the byte size? |
09:14:42 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3py7 |
09:15:21 | FromDiscord | <Rika> can you copy the whole message |
09:15:49 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3py8 |
09:16:07 | FromDiscord | <Rika> is that literally it? |
09:16:16 | * | euantorano joined #nim |
09:16:23 | FromDiscord | <mlokis> its complaining about code generated by macro |
09:16:29 | FromDiscord | <Rika> which |
09:17:01 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3py9 |
09:17:22 | FromDiscord | <mlokis> this is a deep shit |
09:17:38 | FromDiscord | <haxscramper> `type mismatch: got 'array[0..1, tuple[speed: int, damage: int]]' for '[(speed: 1000, damage: 10), (speed: 10, damage: 0)]' but expected 'array[0..1, Bullet]'` |
09:17:59 | FromDiscord | <haxscramper> Are you sure this is the same code as generated by macro |
09:18:07 | FromDiscord | <mlokis> yes |
09:18:22 | FromDiscord | <haxscramper> Because your one is not valid and error is perfectly clear - you can't assign array of tuples to array of objects |
09:18:47 | FromDiscord | <mlokis> i ll try something maybe am just stupid |
09:19:00 | FromDiscord | <Davide> sent a code paste, see https://play.nim-lang.org/#ix=3pya |
09:19:03 | FromDiscord | <haxscramper> In macro `echo result.repr` |
09:19:11 | FromDiscord | <System64 ~ Flandre Scarlet> Ah there is readInt16 |
09:19:11 | FromDiscord | <Davide> (edit) "https://play.nim-lang.org/#ix=3pya" => "https://play.nim-lang.org/#ix=3pyb" |
09:19:19 | FromDiscord | <haxscramper> `expandMacros` is not sufficient when dealing with macro code that generates errors |
09:19:28 | FromDiscord | <haxscramper> Hopefully `nkError`will fix that |
09:19:31 | FromDiscord | <Davide> (edit) |
09:20:05 | FromDiscord | <haxscramper> In reply to @System64 "Ah there is readInt16": It will read int16 from current position, so seek must calculate it correctly regardless |
09:20:11 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3pyc |
09:20:23 | FromDiscord | <Rika> can you give the macro |
09:20:41 | FromDiscord | <haxscramper> yeah, full macro is preferrable |
09:20:46 | FromDiscord | <mlokis> macro is big but as you wish |
09:20:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @haxscramper "It will read int16": So I need to do +2 at each iteration? |
09:21:08 | FromDiscord | <haxscramper> `> inconsistent typing for reintroduced symbol ` first time seeing this error |
09:21:15 | FromDiscord | <Rika> In reply to @haxscramper "`> inconsistent typing for": same here lol |
09:21:35 | FromDiscord | <mlokis> https://media.discordapp.net/attachments/371759389889003532/852839972724801546/message.txt |
09:21:48 | FromDiscord | <mlokis> here its a bit of code |
09:22:21 | FromDiscord | <haxscramper> `/home/jail/prog.nim(3, 16) Error: undeclared identifier: 'error'` missing imports? |
09:22:58 | FromDiscord | <mlokis> oh sorry well then i have to give you reproducable version |
09:23:11 | FromDiscord | <mlokis> that will take little longer |
09:23:12 | FromDiscord | <haxscramper> yeah, I can't debug code that I can't run |
09:23:24 | FromDiscord | <System64 ~ Flandre Scarlet> oh that works! |
09:23:27 | FromDiscord | <mlokis> i thought you just want to see it |
09:23:29 | FromDiscord | <mlokis> sec |
09:23:42 | FromDiscord | <System64 ~ Flandre Scarlet> it returned 75 and HXD says the same thing! |
09:24:06 | FromDiscord | <haxscramper> In reply to @System64 "So I need to": `setFilePos(requiredIndex yourItemSize)` |
09:25:14 | FromDiscord | <mlokis> this should run https://media.discordapp.net/attachments/371759389889003532/852840894319034428/message.txt |
09:25:57 | FromDiscord | <System64 ~ Flandre Scarlet> > setFilePos(requiredIndex yourItemSize)↵Why? |
09:26:01 | FromDiscord | <haxscramper> In reply to @mlokis "": Also `std/macros.error` has optional (FFS who made it optional that gives you position of the node on error) |
09:27:01 | FromDiscord | <mlokis> yea i was kind of lazy to do that as i em only person who will use ithat macro |
09:27:11 | FromDiscord | <mlokis> (edit) "ithat" => "that" |
09:29:03 | * | Arrrrrrrr joined #nim |
09:30:14 | FromDiscord | <haxscramper> https://wandbox.org/permlink/Zkd6eXIPHQfsPsUb it works when I remove `expandMacros` |
09:30:34 | FromDiscord | <haxscramper> But I don't know why it doesn't work when I have expandMacros |
09:31:33 | FromDiscord | <haxscramper> If I replace `expandMacros` with `macro t(a: typed): untyped = a` it gives the same error |
09:33:20 | FromDiscord | <mlokis> i see well i guess a bug |
09:33:47 | FromDiscord | <System64 ~ Flandre Scarlet> And how to get the max offset in a file? |
09:34:22 | FromDiscord | <Rika> so the file size? |
09:35:01 | FromDiscord | <System64 ~ Flandre Scarlet> the max offset, I want to iterates the int16 of a file |
09:35:04 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "iterates" => "iterate" |
09:35:31 | FromDiscord | <Rika> what is max offset |
09:35:33 | FromDiscord | <Rika> to you |
09:36:10 | FromDiscord | <System64 ~ Flandre Scarlet> the end of the file |
09:36:55 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/852843830319382538/unknown.png |
09:38:13 | FromDiscord | <Rika> so the file size |
09:38:19 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
09:38:40 | FromDiscord | <Rika> https://nim-lang.org/docs/io.html#getFileSize%2CFile |
09:39:09 | FromDiscord | <System64 ~ Flandre Scarlet> ah but my file is a stream |
09:39:41 | FromDiscord | <mlokis> os should have information about file size |
09:40:00 | FromDiscord | <haxscramper> use `File/open/setFilePos/getfileSize` then |
09:40:07 | FromDiscord | <haxscramper> from `std/io` |
09:40:58 | FromDiscord | <Rika> i just sent that |
09:41:11 | FromDiscord | <Rika> theyre using a filestream |
09:42:40 | FromDiscord | <haxscramper> I mean streams don't have an API for that, so they should use `File` |
09:46:45 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pyi |
10:05:39 | * | uso_17 joined #nim |
10:05:48 | * | uso_17 quit (Remote host closed the connection) |
10:12:10 | * | asymmetric5 joined #nim |
10:12:12 | * | asymmetric5 quit (Remote host closed the connection) |
10:40:21 | * | buu___ joined #nim |
10:40:48 | * | buu___ quit (Remote host closed the connection) |
10:47:17 | * | Hi-Angel26 joined #nim |
10:47:36 | * | Hi-Angel26 quit (Remote host closed the connection) |
10:57:34 | * | SebastianM joined #nim |
10:59:25 | * | azed joined #nim |
11:03:29 | * | SebastianM quit (Quit: -a- Bye Bye) |
11:18:36 | * | IgorManishkin-t4 joined #nim |
11:18:42 | * | IgorManishkin-t4 quit (Remote host closed the connection) |
11:28:29 | * | John_Ivan joined #nim |
11:28:30 | * | John_Ivan quit (Remote host closed the connection) |
11:55:07 | * | Arrrrrrrr quit (Ping timeout: 272 seconds) |
11:56:47 | * | azed quit (Ping timeout: 255 seconds) |
11:57:48 | * | Arrrrrrrr joined #nim |
12:14:00 | * | arkurious joined #nim |
12:39:18 | * | azed joined #nim |
12:48:47 | * | rockcavera joined #nim |
12:50:04 | * | fantis quit (Remote host closed the connection) |
12:50:42 | * | fantis joined #nim |
12:52:06 | * | azed quit (Read error: Connection reset by peer) |
12:57:49 | * | jamesb[m] joined #nim |
12:58:31 | * | jamesb[m] quit (Remote host closed the connection) |
13:07:55 | * | omnigoat quit (Quit: The Lounge - https://thelounge.chat) |
13:12:03 | FromDiscord | <mlokis> i em not using nims |
13:12:12 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3pz9 |
13:14:40 | FromDiscord | <haxscramper> you are using macros which run in vm |
13:15:20 | FromDiscord | <haxscramper> Or accidentally generated code that has compile-time context, like assign to `const bullets` |
13:15:30 | FromDiscord | <haxscramper> (edit) "bullets`" => "Bullets`" |
13:16:13 | FromDiscord | <mlokis> yea i em assigning constant guess i ll just change that to let |
13:19:33 | * | tiorock joined #nim |
13:19:33 | * | rockcavera quit (Killed (datapacket.freenode.net (Nickname regained by services))) |
13:19:33 | * | tiorock is now known as rockcavera |
13:19:33 | * | rockcavera quit (Changing host) |
13:19:33 | * | rockcavera joined #nim |
13:24:12 | * | phantomcircuit10 joined #nim |
13:24:46 | * | phantomcircuit10 quit (Remote host closed the connection) |
13:30:38 | * | azed joined #nim |
13:47:43 | * | xet7 quit (Remote host closed the connection) |
13:48:49 | * | xet7 joined #nim |
13:56:56 | * | PMunch quit (Quit: Leaving) |
14:02:52 | * | lritter joined #nim |
14:28:35 | FromGitter | <BracketMaster> So this is probably an odd question |
14:28:42 | FromGitter | <BracketMaster> But I'd like to access my nim library from C |
14:28:51 | FromGitter | <BracketMaster> Is there a way to do this? |
14:30:12 | FromDiscord | <Rika> depends |
14:30:17 | Arrrrrrrr | @BracketMaster https://nim-lang.org/docs/manual.html#foreign-function-interface-exportc-pragma |
14:30:21 | FromDiscord | <Rika> dynamic library? should be simple |
14:33:10 | * | fowl joined #nim |
14:34:07 | FromGitter | <BracketMaster> Looks like enums can't be exported |
14:40:58 | FromDiscord | <haxscramper> When compiling to C code nim generates integers instead of enums, so you would need to reencode all values |
14:41:11 | FromDiscord | <haxscramper> Though writing codegen helper script would be easy if you do it in nim |
14:42:26 | * | tigrang_ joined #nim |
14:42:30 | * | tigrang_ quit (Remote host closed the connection) |
14:49:35 | * | azed quit (Quit: WeeChat 3.1) |
15:06:36 | * | NimBot joined #nim |
15:14:51 | * | ZoomZoomZoom joined #nim |
15:17:02 | * | Vladar joined #nim |
15:18:39 | * | omnigoat joined #nim |
15:24:54 | * | ammar2 joined #nim |
15:24:59 | FromDiscord | <Bung> `No stack traceback available↵16↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
15:25:05 | * | ammar2 left #nim ("Leaving") |
15:25:21 | FromDiscord | <Bung> how to get more usefull info when call dll function |
15:26:42 | * | giga84 joined #nim |
15:26:49 | giga84 | hi |
15:27:14 | giga84 | it's a legal question |
15:27:29 | giga84 | if a program or webapp is written in nimlang which uses javascript |
15:27:41 | giga84 | won't it violate java terms and conditions |
15:27:43 | giga84 | ? |
15:28:33 | Prestige | java isn't javascript |
15:28:34 | FromDiscord | <exelotl> no, javascript is a completely different language to java, there are no terms and conditions attached to using javascript |
15:28:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @giga84 "won't it violate java": JavaScript != Java |
15:30:01 | giga84 | hmm wikipedia says "Trademark |
15:30:02 | giga84 | "JavaScript" is a trademark of Oracle Corporation in the United States" |
15:30:33 | giga84 | how can u write a webapp without their permission |
15:30:48 | giga84 | in nimlang |
15:30:49 | Prestige | Can you link that? Doesn't sound right |
15:31:04 | giga84 | https://en.wikipedia.org/wiki/JavaScript#Trademark |
15:31:12 | FromDiscord | <System64 ~ Flandre Scarlet> Why??? https://media.discordapp.net/attachments/371759389889003532/852932986202357800/unknown.png |
15:33:47 | FromDiscord | <System64 ~ Flandre Scarlet> that's weird |
15:33:54 | Prestige | That's very interesting giga84 |
15:33:55 | FromDiscord | <Bung> array size should be const |
15:33:57 | Prestige | I had no idea |
15:35:02 | FromDiscord | <System64 ~ Flandre Scarlet> that's even worse now https://media.discordapp.net/attachments/371759389889003532/852933952847347732/unknown.png |
15:35:39 | Prestige | but anyway giga84 you can use JS freely afaik, but can't claim ownership of javascript |
15:36:23 | giga84 | so basically you can write an webapp with nim lang and sell it |
15:36:40 | giga84 | without owing royalties to oracle |
15:36:48 | * | ZoomZoomZoom quit (Ping timeout: 240 seconds) |
15:37:10 | FromDiscord | <exelotl> yes, same as how you can write an app in JS without owing royalties to oracle |
15:37:26 | FromDiscord | <System64 ~ Flandre Scarlet> I don't think you need to ow royalties for using a programming language |
15:38:34 | FromDiscord | <Bung> just dont use their trademark, they dont limit you use the language |
15:38:49 | giga84 | yes but your programming language converts nimlang code java script code |
15:39:10 | FromGitter | <tandy1000:matrix.org> im having trouble getting nimble to build documentation for my project |
15:39:13 | giga84 | hence by using you don't owe royalties |
15:39:21 | giga84 | ok thx |
15:41:10 | * | giga84 left #nim (#nim) |
15:41:20 | FromDiscord | <System64 ~ Flandre Scarlet> what can I do for my array? |
15:42:17 | FromGitter | <tandy1000:matrix.org> could someone take a look? https://gitlab.com/tandy1000/listenbrainz-nim |
15:42:44 | FromGitter | <tandy1000:matrix.org> its in the listenbrainz.nimble file, to generate the docs im just running `nimble doc listenbrainz.nimble` |
15:43:35 | Prestige | What's with the .const Flandre? |
15:44:11 | FromDiscord | <System64 ~ Flandre Scarlet> I try to make an array to store values |
15:45:40 | FromDiscord | <Bung> your `size` is asignment on runtime |
15:46:11 | FromDiscord | <Bung> you can't just `.const` it's not a type to convert |
15:46:24 | FromDiscord | <System64 ~ Flandre Scarlet> Ah I see↵And if I do a Seq? |
15:46:50 | FromDiscord | <Bung> indeed, if your size can't determine at compile type |
15:46:56 | FromDiscord | <Bung> time |
15:47:03 | FromDiscord | <System64 ~ Flandre Scarlet> I can't at compile time |
15:50:36 | * | ZoomZoomZoom joined #nim |
15:52:23 | ForumUpdaterBot | New thread by Federico3: NimConf 2021: Saturday, June 26th 2021, see https://forum.nim-lang.org/t/8106 |
15:52:45 | * | omnigoat quit (Quit: The Lounge - https://thelounge.chat) |
16:01:05 | * | arecaceae quit (Remote host closed the connection) |
16:01:53 | * | icebattle joined #nim |
16:04:48 | * | ZoomZoomZoom quit (Ping timeout: 240 seconds) |
16:06:47 | * | arecaceae joined #nim |
16:16:47 | * | ldlework says a prayer for our Discord members. |
16:20:40 | FromDiscord | <Zachary Carter> ? |
16:21:39 | ldlework | huh I guess it's not a total outage then |
16:22:32 | ldlework | ah they already fixed it too |
16:24:01 | Prestige | lol |
16:24:22 | Prestige | @Zachary Carter did you apply to papa as well? Was curious if anyone heard back from them |
16:25:09 | FromDiscord | <Bung> he is never show again |
16:27:46 | Prestige | 🤔 |
16:40:06 | FromDiscord | <gerwy> Hewwo |
16:46:04 | FromDiscord | <gerwy> i have a quick question↵because functions are just pointers, can i have like an array of functions↵so that when i can somehow call function using ↵functions[0] or something? |
16:49:26 | planetis[m] | @tandy1000 try mine: https://github.com/planetis-m/libfuzzer/blob/master/nakefile.nim |
16:52:53 | FromDiscord | <gerwy> self-promotion? |
16:57:24 | FromDiscord | <Lefl> No way |
16:57:34 | FromDiscord | <Lefl> You here? |
16:57:48 | FromDiscord | <Lefl> Does someone have any experience using nimpy? |
17:00:05 | FromDiscord | <demotomohiro> !eval [(proc (a: int) = echo a), proc (a: int) = echo a2][1](3) |
17:00:07 | NimBot | Compile failed: /usercode/in.nim(1, 50) Error: invalid token: (\29) |
17:01:31 | FromDiscord | <demotomohiro> It works on nim playground |
17:03:20 | FromDiscord | <haxscramper> In reply to @Life Sucks "i have a quick": yes, you can use `proc(a: int)` as a type anywhere |
17:03:28 | FromDiscord | <haxscramper> In `var/let/sequence/fields and so on |
17:03:51 | * | omnigoat joined #nim |
17:03:54 | FromDiscord | <demotomohiro> !eval let ary = [(proc (a: int) = echo a), proc (a: int) = echo a2]; ary[1](7) |
17:03:56 | NimBot | Compile failed: /usercode/in.nim(1, 60) Error: invalid token: (\29) |
17:04:09 | FromDiscord | <haxscramper> IRC bridge breaks some code |
17:04:34 | FromDiscord | <haxscramper> https://wandbox.org/permlink/qCnh9Gy19KZ94OI4 |
17:06:05 | * | narimiran quit (Ping timeout: 272 seconds) |
17:06:33 | Prestige | looks like it's missing a "\" |
17:06:50 | Prestige | I see `!eval let ary = [(proc (a: int) = echo a), proc (a: int) = echo a2]; ary[1](7)` |
17:07:00 | Prestige | see `echo a2]` |
17:07:35 | * | clemens3 quit (Ping timeout: 258 seconds) |
17:09:16 | FromDiscord | <demotomohiro> discord or irc brige change some charactors? |
17:10:09 | * | Guest48150 joined #nim |
17:10:48 | FromDiscord | <gerwy> In reply to @Lefl "You here?": LEeeeeeeeeefl<333 How are you :3 |
17:11:00 | FromDiscord | <Lefl> Good I think |
17:11:01 | FromDiscord | <gerwy> i recently started learning nim |
17:11:02 | FromDiscord | <demotomohiro> !eval let a=1; echo a2 |
17:11:03 | NimBot | Compile failed: /usercode/in.nim(1, 16) Error: invalid token: (\29) |
17:11:07 | FromDiscord | <Lefl> Feeling tired right now |
17:11:23 | FromDiscord | <Lefl> Also my brain starts melting when I try to use python libraries with nim |
17:11:35 | Prestige | !eval let a = 1; echo a |
17:11:37 | NimBot | 1 |
17:11:53 | * | Onionhammer6 quit (Read error: Connection reset by peer) |
17:11:55 | FromDiscord | <System64 ~ Flandre Scarlet> I have an array of values, how can I write that as a stream of values in a file please? |
17:12:12 | FromDiscord | <demotomohiro> "" in a2 is missing in irc log |
17:12:23 | * | Guest48150 quit (Remote host closed the connection) |
17:12:29 | Prestige | https://nim-by-example.github.io/files/ for files |
17:12:44 | FromDiscord | <gerwy> In reply to @demotomohiro "!eval let ary =": what if function is pretty big?↵can i declare it in array and then say what it should do later?↵like i normally do when there is a lot of code? |
17:12:59 | * | clemens3 joined #nim |
17:13:29 | * | Onionhammer6 joined #nim |
17:13:38 | FromDiscord | <gerwy> because i mostly want to do it because of performance, because i have enum of things and based on the value of that i want to do something every frame↵but using if's or case can be pretty slow so i thought about using array of functions |
17:14:05 | FromDiscord | <gerwy> Also i don't see you Lefl in godot discord anymore, what happend? |
17:14:26 | FromDiscord | <haxscramper> In reply to @Life Sucks "because i mostly want": Using `case` is faster than callbacks |
17:14:31 | FromDiscord | <haxscramper> Why do you think it is slow? |
17:14:33 | FromDiscord | <gerwy> why? |
17:14:38 | FromDiscord | <gerwy> In reply to @haxscramper "Why do you think": branches |
17:14:44 | FromDiscord | <Lefl> In reply to @Life Sucks "Also i don't see": Nothing, also people talked about politics all the time |
17:14:50 | FromDiscord | <haxscramper> https://github.com/status-im/nimbus-eth1/wiki/Interpreter-optimization-resources#nim-implementation-benchmark |
17:15:06 | FromDiscord | <gerwy> In reply to @Lefl "Nothing, also people talked": well technically, but it got a little better now |
17:15:10 | FromDiscord | <gerwy> In reply to @haxscramper "https://github.com/status-im/nimbus-eth1/wiki/Inter": sus |
17:15:10 | FromDiscord | <demotomohiro> @Life Sucks You dont need to put function definition in array. You can create an array of function with function names |
17:15:11 | FromDiscord | <haxscramper> In reply to @Life Sucks "branches": vs what? branches vs function call, pointer indirection etc. |
17:16:42 | FromDiscord | <haxscramper> computed goto with `case` results in the best performance for interpreter loops, but it all depends on your particular use case. |
17:17:06 | planetis[m] | @gerwy he asked for a build docs command, I just happen to have one working |
17:17:16 | planetis[m] | any problems with that? |
17:17:18 | FromDiscord | <Lefl> Does someone know how I would call a python function with a nim Object using nimpy?↵I know this is some kind of unholy alliance |
17:17:31 | FromDiscord | <System64 ~ Flandre Scarlet> I need a pointer to for the buffer? |
17:18:47 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) removed "to" |
17:21:08 | FromDiscord | <gerwy> sent a code paste, see https://play.nim-lang.org/#ix=3pAT |
17:21:35 | FromDiscord | <System64 ~ Flandre Scarlet> I don't want to write text but binary data |
17:23:16 | FromDiscord | <haxscramper> In reply to @Life Sucks "Idk i just thought": I don't think it would be faster in any language, especially considering you are guaranteed to have at least one layer of indirection when calling procedure (also environment access if you have a closure) |
17:24:41 | FromDiscord | <haxscramper> What are you writing btw? |
17:24:44 | FromDiscord | <Lefl> I'm pretty sure by quicker he meant quicker to write |
17:24:53 | FromDiscord | <Lefl> (edit) "I'm pretty sure by quicker he meant quicker to write ... " added "not quicker to run" |
17:25:11 | FromDiscord | <haxscramper> In reply to @Life Sucks "because i mostly want": `> i mostly want to do it because of performance, ` |
17:25:30 | FromDiscord | <Lefl> Oh nvm I just read his last message |
17:26:04 | FromDiscord | <gerwy> In reply to @haxscramper "What are you writing": Game :3 |
17:26:40 | Prestige | oh what are you using? |
17:26:58 | FromDiscord | <gerwy> And the code would be part of one "Minion" Ai so if there was a lot of them then the performence can drop a lot |
17:28:02 | FromDiscord | <haxscramper> using `array[Enum, proc()]` allows to switch behavior at runtime for example (and lots of things that are not possible with hardcoded `case`) |
17:28:15 | FromDiscord | <haxscramper> So you really need to bench things for your use case |
17:28:34 | FromDiscord | <gerwy> In reply to @Prestige "oh what are you": raylib |
17:29:06 | FromDiscord | <Lefl> I think I'll go back to the 2 program solution instead of trying this abominations |
17:29:08 | FromDiscord | <Lefl> (edit) "abominations" => "abomination" |
17:29:14 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pAU |
17:29:44 | FromDiscord | <haxscramper> Function call overhead might be diferent depending on the arguments (their number, size etc) I think |
17:29:47 | FromDiscord | <gerwy> In reply to @haxscramper "So you really need": Well im writing my minions now↵But you know its only a bones for my game i don't reallt have anything yet |
17:30:48 | FromDiscord | <gerwy> In reply to @Lefl "I think I'll go": Isn't there python interpreter in nim packages, you could try that right? |
17:31:26 | FromDiscord | <Lefl> There's nimpy, but I can't figure out how or if it's possible to pass an nim object to a python function |
17:33:52 | FromDiscord | <gerwy> hmm↵do you write code in nim or python?↵I know that there is a way to write python modules in nim so if you write it in python you could use that |
17:34:20 | FromDiscord | <Lefl> I'm trying to use a bluetooth LE library in nim |
17:34:46 | FromDiscord | <Lefl> Yeah maybe I could somehow use a C library, but I have no idea how that works |
17:35:41 | FromDiscord | <gerwy> i heard that c2nim turns C libraries to be usable for nim↵because raylib bindings used that |
17:36:01 | FromDiscord | <Lefl> hmm |
17:37:53 | FromDiscord | <gerwy> sent a code paste, see https://play.nim-lang.org/#ix=3pAY |
17:38:04 | FromDiscord | <gerwy> the game would be something like Stick War, the good ol' flash game |
17:38:11 | FromDiscord | <Lefl> Hmm I'll also have to find a C BLE library, everything is C++ |
17:39:22 | FromDiscord | <haxscramper> you can interop with C++ as well |
17:39:34 | FromDiscord | <haxscramper> and c2nim "supports" "part" of the C++ |
17:39:59 | FromDiscord | <demotomohiro> Nim can wrap C++ library, but you would need some C++ lang features |
17:40:31 | FromDiscord | <haxscramper> such as? Depending on which feature you need |
17:41:15 | FromDiscord | <demotomohiro> You would need to know some C++ lang feature |
17:41:16 | FromDiscord | <haxscramper> I.e. is there an explicit lack of features that prevent you from using C++ library (like it uses variadic generics for example) |
17:41:34 | FromDiscord | <haxscramper> In reply to @demotomohiro "*You would need ": ah, well |
17:42:59 | FromDiscord | <demotomohiro> Even if you can wrap c or c++ library for Nim, you would need to read a library documents or example code that are written for C/C++ programmer |
17:44:33 | * | sveit joined #nim |
17:45:05 | * | sveit quit (Remote host closed the connection) |
17:45:11 | FromDiscord | <demotomohiro> So, using c or c++ library with Nim without knowing C/C++ can be hard unless someone write a good document or example code for Nim programmer |
17:46:04 | FromDiscord | <gerwy> yeah, its better to know, at least C or C++↵they are similar so you probably need only one to know it well to use docs |
17:46:16 | FromDiscord | <haxscramper> huh |
17:46:30 | FromDiscord | <haxscramper> they are not similar, |
17:46:42 | FromDiscord | <haxscramper> Unless you write C in C++ at least |
17:46:43 | FromDiscord | <gerwy> but if you know C++ you can understand C |
17:47:22 | FromDiscord | <haxscramper> True, but it does not work other way around. And some C idioms are different from C++ still |
17:47:54 | FromDiscord | <gerwy> ah yes |
17:48:02 | FromDiscord | <gerwy> i mean like C++ -> C relation |
17:48:19 | FromDiscord | <gerwy> because i know C++, at least a little and i think i can understand C code if i see it |
17:50:41 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pB4 |
17:51:17 | * | Sorunome[m]1 joined #nim |
17:51:48 | * | Sorunome[m]1 quit (Remote host closed the connection) |
17:51:52 | FromDiscord | <haxscramper> just `write`, no? https://nim-lang.org/docs/streams.html#write%2CStream%2CT |
17:51:59 | FromDiscord | <haxscramper> or `write` bytes as string |
17:52:22 | FromDiscord | <System64 ~ Flandre Scarlet> Not as string |
17:53:23 | FromDiscord | <haxscramper> And what 'seq of bytes' is then? nim `string` uses `char` so it can be viewed as sequence of bytes |
17:53:58 | FromDiscord | <System64 ~ Flandre Scarlet> Oh I see |
17:55:00 | FromDiscord | <haxscramper> Or `seq[uint8]` |
17:55:10 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pB6 |
17:55:58 | FromDiscord | <demotomohiro> In reply to @haxscramper "just `write`, no? https://nim-lang.org/docs/streams": That write don't work for seq type as it implemented as `writeData(s, unsafeAddr(x), sizeof(x))`. |
17:56:52 | FromDiscord | <demotomohiro> This `write` should work: https://nim-lang.org/docs/streams.html#write,Stream,string |
17:58:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pB7 |
18:00:14 | FromDiscord | <haxscramper> Same results as if I wrote `var s = @[12]; echo cast[ptr array[sizeof(s), uint8]](addr s)[]` |
18:03:21 | FromDiscord | <demotomohiro> In reply to @haxscramper "Same results as if": It just echo internel pointer of seq as array of uint8. |
18:03:53 | FromDiscord | <Lefl> Oh boy oh boy oh boy |
18:04:04 | FromDiscord | <Lefl> My 2 program solution works pretty nice |
18:07:05 | FromDiscord | <gerwy> nicee |
18:08:46 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pBf |
18:09:48 | * | sparr_12 joined #nim |
18:10:12 | * | sparr_12 quit (Remote host closed the connection) |
18:16:23 | FromDiscord | <Bung> why you use writeLine ? you are not processing text |
18:17:09 | FromDiscord | <Zachary Carter> Should this work? Shouldn't the compiler complain about the thread func not being gc-safe? https://github.com/elijahr/lockfreequeues/blob/devel/examples/sipsic.nim |
18:18:43 | * | narimiran joined #nim |
18:23:59 | FromDiscord | <System64 ~ Flandre Scarlet> Even with something else it's messed up |
18:26:53 | FromDiscord | <Bung> I dont remenber stream api , have you tried write newSample.addr newSample.len , or just write newSample |
18:27:06 | FromDiscord | <System64 ~ Flandre Scarlet> I just write |
18:28:01 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pBm |
18:33:32 | FromDiscord | <Bung> I guess it's logic problem |
18:35:12 | FromDiscord | <Bung> also where `setPositionImpl` coming from ? `setPosition` right ? |
18:35:25 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
18:36:30 | FromDiscord | <Bung> write some debug echo you may find the problem, I dont see any other problem. |
18:37:21 | * | Martin[m]125 joined #nim |
18:37:32 | * | Martin[m]125 quit (Remote host closed the connection) |
18:37:46 | FromDiscord | <System64 ~ Flandre Scarlet> for index in newSample:↵ echo index↵I did that, it outputs RIFF WAVE etc... |
18:38:45 | FromDiscord | <Bung> some logic in your while loop may not as you expected I think |
18:41:16 | FromDiscord | <System64 ~ Flandre Scarlet> the first or the second? |
18:41:36 | FromDiscord | <Bung> both |
18:43:48 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
18:44:42 | FromDiscord | <System64 ~ Flandre Scarlet> I think the first works well |
18:50:27 | FromDiscord | <zetashift> @leorize I want to update Nim's neovim client and I have to start with getting rpc transport over pipe/socket working: https://github.com/jangko/nvim_client/blob/master/nvim_client/nvim_transport.nim can I use `nim-sys` for that? |
18:51:04 | FromDiscord | <zetashift> mhmhm maybe `asynctools` is a better option |
18:51:25 | FromDiscord | <Bung> @haxscramper your hnimast works? I can't make it work on 1.4.8 and devel |
18:51:29 | leorize[m] | the pipes layer is pretty mature but the api is a little low level |
18:52:46 | * | lidless joined #nim |
18:52:47 | * | lidless quit (Killed (Sigyn (Spam is off topic on freenode.))) |
18:54:11 | FromDiscord | <zetashift> In reply to @leorize "the pipes layer is": what would you recommend? I don't mind playing around but I might bug you with some questions 😛 |
18:55:40 | leorize[m] | it depends on what you need but seems to me that this code should be replaced with sys/exec, which doesn't exist atm |
18:55:49 | leorize[m] | so your next best choice is asynctools asyncproc |
18:56:47 | leorize[m] | actually this looks kinda weird |
18:57:36 | leorize[m] | sys/pipes should work if you don't mind the low level api |
18:57:59 | FromDiscord | <haxscramper> In reply to @Bung "<@!608382355454951435> your hnimast works?": define "can't make it work" |
18:58:08 | leorize[m] | looks like you won't, the api here is low level as hell :p |
18:58:14 | FromDiscord | <haxscramper> it passes CI tests for hnimast and haxdoc |
18:59:21 | FromDiscord | <Bung> /Users/bung/.nimble/pkgs/compiler-1.5.1/compiler/commands.nim(40, 33) Error: undeclared identifier: 'nativeStackTraceSupported' |
18:59:21 | FromDiscord | <haxscramper> and i"m using 1.4.8 locally as well |
18:59:46 | FromDiscord | <Bung> on 1.4.8 /Users/bung/.nimble/pkgs/nimble-0.13.1/nimblepkg/common.nim(70, 21) Error: cannot open file: ../../nimble.nimble |
19:00:04 | leorize[m] | @zetashift personal recommendation is sys/pipes because I wrote it :p |
19:00:15 | FromDiscord | <haxscramper> and what are you trying to do? Show the code that gives errors |
19:00:19 | leorize[m] | on a more serious note then it's because I consider my impl more correct |
19:00:36 | leorize[m] | regarding pipe collisions and the likes |
19:02:12 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=3pBz |
19:02:41 | FromDiscord | <Bung> I import os and hnimast/compiler_aux |
19:05:32 | FromDiscord | <Bung> https://github.com/bung87/slim I just init a package |
19:06:34 | FromDiscord | <haxscramper> Well, it works for me without any issues. I have a nim version 1.4.8 installed and compiler package 1.4.8 |
19:07:07 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pBA |
19:07:21 | FromDiscord | <haxscramper> Everything is parsed and working as expected |
19:11:20 | FromDiscord | <Lefl> Are there any resources on how to use nim instead of js for website development? |
19:11:27 | FromDiscord | <zetashift> In reply to @leorize "<@77574388035100672> personal recommendation is": Playing around with it now |
19:11:32 | FromDiscord | <zetashift> 😄 |
19:12:22 | FromDiscord | <Bung> @haxscramper hmm , weird , i change to `let x = staticRead(currentSourcePath.parentDir.parentDir / "nimble.nimble")` then I got `/Users/bung/.nimble/pkgs/nimble-0.13.1/nimblepkg/packageinfo.nim(7, 17) Error: undeclared identifier: 'SslError'` |
19:15:35 | * | rockcavera quit (Remote host closed the connection) |
19:15:35 | FromDiscord | <haxscramper> `-d:ssl` |
19:15:36 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/337 |
19:15:57 | FromDiscord | <haxscramper> You need to compile with `-d:ssl` when using nimble |
19:17:35 | FromDiscord | <Bung> yeah , works with ssl flag , Thanks! |
19:18:45 | FromDiscord | <haxscramper> I tested package parser on all packages that were available at march 2021, so it should be relatively robust, but I haven't handled all edge cases |
19:18:53 | FromDiscord | <haxscramper> So it might break at some places |
19:19:24 | FromDiscord | <haxscramper> Also use `parsePackageInfo` instead of `nims` version as there are some packages that use old format |
19:20:16 | FromDiscord | <Bung> `let x = staticRead("../../nimble.nimble")` in `nimblepkg/common.nim` it looks weird ? a relative path to static read |
19:20:52 | FromDiscord | <haxscramper> if you have `srcDir = "src"` it would break when package is installed |
19:21:00 | FromDiscord | <haxscramper> But this `srcDir` is broken AF |
19:22:15 | FromDiscord | <haxscramper> so you need `staticRead` + check whether it is `../nimble.nimble` or `../../nimble.nimble` |
19:24:36 | FromDiscord | <Bung> think it breaks because use it as package |
19:25:10 | FromDiscord | <Bung> it should move to bin main file I think |
19:25:35 | FromDiscord | <haxscramper> if you have binary package it would still download sources and compile them |
19:25:55 | FromDiscord | <haxscramper> but I"m not sure how files are moved in this case (e.g. whether `srcDir` is respected or not) |
19:27:47 | FromDiscord | <Bung> all files will move out from src, src doesn't exists after installing |
19:29:29 | FromDiscord | <Bung> the simple solution will define a prepublish task simple dump version to a single file |
19:30:27 | FromDiscord | <haxscramper> In reply to @Bung "`let x = staticRead("../../nimble.nimble")`": I think this approach is good enough, you just have to be aware of the `srcDIr` file movements |
19:33:16 | FromDiscord | <Bung> well, I still need change the common.nim to make it work |
19:35:18 | FromDiscord | <Bung> am wondering how nim version update to system.nim |
19:36:28 | FromDiscord | <Bung> oh it use defined flag so other program defines |
19:37:34 | FromDiscord | <haxscramper> just has integer value that is manually incremented https://github.com/nim-lang/Nim/blame/44e653a9314e1b8503f0fa4a8a34c3380b26fff3/lib/system.nim#L2114 |
19:37:56 | FromDiscord | <haxscramper> I mean we don't have releases that often so it become an issue |
19:38:53 | FromDiscord | <Bung> make sense, well. |
19:44:06 | FromDiscord | <System64 ~ Flandre Scarlet> Do you know what's the problem with my code please? |
19:58:09 | FromDiscord | <Bung> can you make a repo that I can directly run , then I can take a look |
19:59:36 | FromDiscord | <System64 ~ Flandre Scarlet> alright so I checked and NewSample contains the right sequence of data |
20:01:39 | FromDiscord | <Bung> okay |
20:02:32 | * | omnigoat quit (Quit: The Lounge - https://thelounge.chat) |
20:04:14 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pBS |
20:10:26 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pBU |
20:12:36 | * | cocreature5 joined #nim |
20:12:47 | * | cocreature5 quit (Remote host closed the connection) |
20:14:24 | * | Vladar quit (Quit: Leaving) |
20:16:07 | * | mapu joined #nim |
20:16:20 | * | mapu quit (K-Lined) |
20:18:38 | FromDiscord | <System64 ~ Flandre Scarlet> Alright I found how |
20:22:51 | FromDiscord | <Hi02Hi> In reply to @Lefl "Are there any resources": i found https://github.com/doccaico/playthings/tree/main/nim/conway-js and https://github.com/dom96/snake |
20:23:08 | FromDiscord | <Lefl> Oh thank you |
20:23:33 | FromDiscord | <Hi02Hi> (edit) "https://github.com/doccaico/playthings/tree/main/nim/conway-js" => "https://github.com/doccaico/playthings/tree/main/nim" |
20:34:33 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pC3 |
20:36:48 | * | narimiran quit (Ping timeout: 240 seconds) |
20:37:51 | FromDiscord | <Bung> your newFileStrm size is determined |
20:38:14 | FromDiscord | <Bung> you can't just setPosition to any position |
20:39:14 | FromDiscord | <zetashift> In reply to @leorize "the pipes layer is": So how would I connect a pipe given a certain address(like `"\\\\.\\pipe\\nvim-7072-0"`)? |
20:39:43 | FromDiscord | <System64 ~ Flandre Scarlet> var newFileStrm = newFileStream("sample2.wav", fmWrite)↵I init my stream there |
20:40:06 | leorize[m] | @zetashift you can't because I haven't implemented named pipes yet |
20:40:25 | FromDiscord | <zetashift> ah I didn't see the issue of named pipes so I thought maybe I was looking wrong |
20:41:27 | leorize[m] | named pipes are sorta complicated, which is why I haven't give them a proper API |
20:41:31 | leorize[m] | but I'll see what I can do for you |
20:43:33 | FromDiscord | <zetashift> It's okay! I'll try and get a tcp connection with neovim working in the meantime |
20:43:40 | leorize[m] | ok it's not that complicated, I just have to build the file system layer |
20:43:49 | leorize[m] | alternatively you can just use stdlib's openFile |
20:46:55 | FromDiscord | <System64 ~ Flandre Scarlet> Why OutOfRange? It's a Seq and I add elements in https://media.discordapp.net/attachments/371759389889003532/853012441121947668/unknown.png |
20:47:25 | FromDiscord | <System64 ~ Flandre Scarlet> Why OutOfRange? It's a Seq and I add elements to it https://media.discordapp.net/attachments/371759389889003532/853012563087065148/unknown.png |
20:48:13 | FromDiscord | <ElegantBeef> It's len is probably less than 42 |
20:48:31 | FromDiscord | <System64 ~ Flandre Scarlet> I crash at the line 58 |
20:48:51 | FromDiscord | <ElegantBeef> index is outside of 0-255 |
20:48:59 | FromDiscord | <ElegantBeef> so cannot convert to a char |
20:49:38 | FromDiscord | <System64 ~ Flandre Scarlet> it's a signed 8-bits array |
20:49:54 | FromDiscord | <ElegantBeef> so it's less than 0 eh? |
20:49:59 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
20:50:27 | FromDiscord | <ElegantBeef> !eval let a = (-1i8).char |
20:50:29 | NimBot | Compile failed: /usercode/in.nim(1, 15) Error: -1 can't be converted to char |
20:50:57 | FromDiscord | <ElegantBeef> It's ambiguous what that should be, convert to int16 add 127 then convert to char |
20:51:02 | FromDiscord | <System64 ~ Flandre Scarlet> I need to put the data of this Seq in my file↵'cause the Wav is signed |
20:51:25 | FromDiscord | <ElegantBeef> Atleast that's what i'd do, no clue what's "proper" |
20:52:09 | FromDiscord | <System64 ~ Flandre Scarlet> I want to convert a signed 16-bits wav to signed 8-bits wav |
20:52:20 | FromDiscord | <ElegantBeef> So then why do you need char? |
20:53:03 | FromDiscord | <System64 ~ Flandre Scarlet> To put it in my data stream |
20:53:24 | FromDiscord | <ElegantBeef> That makes no sense |
20:53:43 | FromDiscord | <System64 ~ Flandre Scarlet> I use that : newFileStrm.writeLine(str) |
20:53:58 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/streams.html#write%2CStream%2CT |
20:54:00 | FromDiscord | <Bung> all things you write in the end are chars |
20:54:30 | FromDiscord | <Bung> so could just turns your input data to chars first ? |
20:54:52 | FromDiscord | <zetashift> In reply to @leorize "alternatively you can just": ah thanks, I think I need to gain some more knowledge about these low level OS specifics, I thought this weekend adventure would be a bit easier 😛 |
20:54:55 | FromDiscord | <ElegantBeef> Or just write the value to the file |
20:55:18 | FromDiscord | <ElegantBeef> But you can if you must `cast[char](index)` though it's pointless when you can just write the data |
20:56:34 | FromDiscord | <Bung> the only concern is do you know how you ints turns to chars properly |
21:00:36 | FromDiscord | <System64 ~ Flandre Scarlet> The new file is messed up if I do newFileStrm.write(newSample) |
21:01:49 | FromDiscord | <ElegantBeef> Well what is supposed to be written when you go to write `-1`? |
21:02:07 | FromDiscord | <System64 ~ Flandre Scarlet> hex value |
21:02:37 | FromDiscord | <System64 ~ Flandre Scarlet> I mean, like what you see in HxD |
21:02:47 | FromDiscord | <ElegantBeef> So you mean the binary value of `-1` so what it did |
21:03:27 | FromDiscord | <System64 ~ Flandre Scarlet> I want to write the binary value of -1 |
21:03:34 | FromDiscord | <ElegantBeef> Which is what `stream.write` should write |
21:04:35 | FromDiscord | <System64 ~ Flandre Scarlet> ah maybe it writes the memory adress of the seq? |
21:04:45 | FromDiscord | <ElegantBeef> yes |
21:05:21 | FromDiscord | <ElegantBeef> If you're writting a seq do `writeData(seq[0].addr, seq.len)` |
21:05:23 | FromDiscord | <ElegantBeef> (edit) "writting" => "writing" |
21:06:08 | FromDiscord | <System64 ~ Flandre Scarlet> aaaah let me try that |
21:12:01 | FromDiscord | <System64 ~ Flandre Scarlet> I'm not far |
21:12:07 | FromDiscord | <System64 ~ Flandre Scarlet> some bugs left |
21:13:29 | * | rockcavera joined #nim |
21:20:03 | * | lritter quit (Ping timeout: 272 seconds) |
21:21:44 | FromDiscord | <System64 ~ Flandre Scarlet> alright I see something weird |
21:22:04 | FromDiscord | <Lefl> Ok I found a downside of indentation based syntax |
21:23:14 | FromDiscord | <Lefl> I mean it's bearable |
21:23:15 | FromDiscord | <Lefl> sent a code paste, see https://play.nim-lang.org/#ix=3pCi |
21:23:34 | FromDiscord | <Lefl> (edit) "https://play.nim-lang.org/#ix=3pCi" => "https://play.nim-lang.org/#ix=3pCj" |
21:25:38 | FromDiscord | <ElegantBeef> What's the issue? |
21:26:18 | FromDiscord | <Lefl> It loogs ugly |
21:26:23 | FromDiscord | <ElegantBeef> Well let's fix ut |
21:26:25 | FromDiscord | <ElegantBeef> (edit) "ut" => "it" |
21:30:01 | FromDiscord | <ElegantBeef> This is marginally better https://play.nim-lang.org/#ix=3pCm |
21:30:05 | FromDiscord | <ElegantBeef> But we can do it even better |
21:31:47 | FromDiscord | <Lefl> Hmm |
21:34:18 | FromDiscord | <ElegantBeef> Now we're cooking with gasoline https://play.nim-lang.org/#ix=3pCr |
21:36:13 | FromDiscord | <Lefl> Oh boy that's sexy |
21:36:14 | FromDiscord | <Lefl> thanks |
21:36:28 | FromDiscord | <ElegantBeef> No problem, embrace the block call style |
21:36:39 | FromDiscord | <Lefl> what does the {.inject.} pragma do? |
21:36:48 | FromDiscord | <ElegantBeef> in templates it doesnt add gensym to the name |
21:36:55 | FromDiscord | <ElegantBeef> so you can use `it` inside the blocks to access that value |
21:37:23 | FromDiscord | <Lefl> What's gensym? |
21:37:41 | FromDiscord | <ElegantBeef> ensured unique name so without it that `it` is actually `itgensym0` |
21:37:51 | FromDiscord | <ElegantBeef> And i dont think can be accessed anyway |
21:38:16 | FromDiscord | <Lefl> Ok |
21:38:23 | FromDiscord | <ElegantBeef> Templates are hygenic which means unless otherwise specified like with the inject they dont emit symbols that are accessible |
21:38:45 | FromDiscord | <ElegantBeef> I could've also put `{.dirty.}` on the template but that'd have emitted `pp` and `ep` into the scope which is certainly not desired |
21:41:02 | FromDiscord | <Lefl> Is it possible to change the "do" to something like "fail"? |
21:41:17 | FromDiscord | <Lefl> I have no real idea how the templating works, I should get into that |
21:43:43 | FromDiscord | <System64 ~ Flandre Scarlet> newFileStrm.writeData(array8bits[0].addr, array8bits.len)↵Is it possible to write that in little endian mode? |
21:44:23 | FromDiscord | <Lefl> Uh it doesn't execute the `makeGetRequest` proc |
21:48:02 | FromDiscord | <ElegantBeef> It does so https://play.nim-lang.org/#ix=3pCu and no the `do` isnt apart of templates it's in nim's language and available for all procedures |
21:48:23 | FromDiscord | <ElegantBeef> You could write a macro for that but seems like a lot of work for very little benefit |
21:50:19 | FromDiscord | <Lefl> Hmm weird |
21:50:32 | FromDiscord | <ElegantBeef> To show that block param passing https://play.nim-lang.org/#ix=3pCv |
21:51:03 | FromDiscord | <ElegantBeef> Can be useful to eliminate pre calculating variables 😄 |
21:52:17 | FromDiscord | <Lefl> I'm a big dummy |
21:52:27 | FromDiscord | <Lefl> I forgot to call the success procedure 😄 |
21:52:55 | FromDiscord | <Lefl> Hmm wait no |
21:54:35 | FromDiscord | <Lefl> nvm it did work |
21:55:04 | FromDiscord | <Lefl> Thanks |
21:55:16 | * | TheOnlyJoey|BNC joined #nim |
21:55:48 | * | TheOnlyJoey|BNC quit (Remote host closed the connection) |
22:01:33 | FromDiscord | <System64 ~ Flandre Scarlet> Why?? https://media.discordapp.net/attachments/371759389889003532/853031221142880276/unknown.png |
22:03:56 | FromDiscord | <exelotl> @System64 ~ Flandre Scarlet in Nim `/` always returns a floating point value. You want `a div 256` instead. |
22:08:09 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright |
22:11:45 | FromDiscord | <Hi02Hi> isn't it impossible for b > 255? |
22:12:40 | FromDiscord | <Hi02Hi> uint16.high = 2^16 - 1 = 65535↵65535 div 256 = 255 |
22:13:00 | FromDiscord | <Hi02Hi> (edit) "uint16.high = 2^16 - 1 = 65535↵65535 div 256 = 255 ... " added "(.996...)" |
22:13:11 | FromDiscord | <Hi02Hi> (edit) removed "(.996...)" |
22:15:39 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah truc |
22:19:45 | FromDiscord | <matf> 👋 curious how much use the Exception / Tagging effect tracking system gets used. Would love to know pain points, or is it enthusiastic thumbs up to keep using/exploring? |
22:20:30 | * | pombreda19 joined #nim |
22:20:52 | * | pombreda19 quit (Remote host closed the connection) |
22:24:31 | * | ZoomZoomZoom joined #nim |
22:26:35 | FromDiscord | <Alea> anyone have hints here? https://media.discordapp.net/attachments/371759389889003532/853037522934169620/unknown.png |
22:27:07 | FromDiscord | <Alea> openarray is meant for taking unknown length arrays and seqs right? |
22:27:37 | FromDiscord | <Lefl> Does someone know how I can concatenate a cstring and a string? |
22:29:47 | FromDiscord | <konsumlamm> In reply to @matf "👋 curious how much": fwiw, i've rarely, if ever, seen it being used by anyone (though that doesn't need to be representative) |
22:30:07 | FromDiscord | <konsumlamm> In reply to @Lefl "Does someone know how": convert one to the other and then concatenate as normal? |
22:31:29 | FromDiscord | <konsumlamm> In reply to @Alea "openarray is meant for": i think the conversion doesn't happen through `ref`, i.e. `ref array[0..9, float]` doesn't get coerced to `ref openArray[float]` |
22:32:00 | FromDiscord | <konsumlamm> that's because `openArray`s aren't first class, but that may change in the future |
22:32:50 | FromDiscord | <Alea> I've ditched the ref for now in favor of just returning the array, but now I'm wondering if there some openarray equivalent for returns? |
22:33:02 | FromDiscord | <Alea> is returning an unknown length array allowed? |
22:33:13 | FromDiscord | <Alea> or do I have to use a seq for that |
22:37:40 | leorize[m] | you need a seq, but what are you trying to do? |
22:44:17 | FromDiscord | <Hi02Hi> arrays sizes must be known at compile time |
22:50:57 | FromDiscord | <Zachary Carter> https://www.twitch.tv/hahahaitsfunny streaming some gamedev stuff |
22:57:24 | * | Brion_8 joined #nim |
22:57:24 | * | Brion_8 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
23:26:40 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
23:28:36 | FromDiscord | <Zachary Carter> working on asset loading system if anyone is interested↵involves concurrency & multi threading |
23:36:24 | * | ZoomZoomZoom quit (Ping timeout: 240 seconds) |
23:38:46 | * | ZoomZoomZoom joined #nim |
23:48:10 | * | mrkirby1539 joined #nim |
23:48:50 | * | mrkirby1539 quit (Remote host closed the connection) |