<< 11-06-2021 >>

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:27FromDiscord<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:08FromGitter<kaushalmodi> Varriount: https://en.wikipedia.org/wiki/File_descriptor
01:15:08FromGitter<kaushalmodi> Also https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html; search "_FILENO"
01:34:58FromDiscord<Rika> what tricks do yall know of to generate "cleaner" js? i forget what stuff i can do, no stack traces, etc
01:36:19FromDiscord<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:12FromDiscord<Hi02Hi> the `do {...} while (false)` loops are so infuriating
01:59:59FromDiscord<Rika> In where? That is needed for creating a new scope in C I believe
02:02:17FromDiscord<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:12FromDiscord<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:45FromDiscord<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:40FromDiscord<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:50leorize[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:23FromDiscord<Varriount> @leorize Huh, that hasn't occurred to me. Of course, that also begs the question, "why -1 and errno"
06:07:55FromDiscord<Varriount> Or on Windows, GetLastError
06:17:14FromDiscord<Bung> is there any cross-platform inotify like lib ?
06:29:46FromDiscord<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:26FromDiscord<haxscramper> No, you get stacktrace on nil access anyway, but `std/segfaults` turns it into `NilAccesDefect` that can be caught
06:34:34FromDiscord<haxscramper> So you get actual defect raised
06:34:44FromDiscord<haxscramper> Stacktrace is always available
06:37:02FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pxw
06:37:35FromDiscord<haxscramper> Though `NilAccess` is a defect and if I remember correctly it cannot be caught with `--panics:on` (disabled by default)
06:47:09FromDiscord<Bung> oh, I may remenber wrong, it's in dll , when access nil only one line error message
06:47:26leorize[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:45leorize[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:08leorize[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:10leorize[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:32FromDiscord<Rainbow Asteroids> why are panics disabled by default? Y'all don't want to break nonsensical code? lol
07:05:43leorize[m]yep, it's meant to be enables by default but people were catching them left and right, so we gotta compromise
07:07:04FromDiscord<Rainbow Asteroids> maybe in new nimble projects, the switch should be enabled in the config by default or smth
07:07:56leorize[m]too risky, the issue was that some libraries needed this to function
07:08:17leorize[m]there will be plans to have it on by default alongside gc:orc
07:08:31FromDiscord<Rika> What did panics do again
07:08:45leorize[m]Defect quits your program
07:18:13ForumUpdaterBotNew 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:11FromDiscord<System64 ~ Flandre Scarlet> How can I read a value at a precise offset of a file please?
08:51:25FromDiscord<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:26FromDiscord<System64 ~ Flandre Scarlet> Steams? Is it the same thing as JavaN
09:01:27FromDiscord<System64 ~ Flandre Scarlet> (edit) "JavaN" => "Java?"
09:07:13FromDiscord<haxscramper> Actually https://nim-lang.org/docs/io.html#setFilePos%2CFile%2Cint64%2CFileSeekPos might be berrer
09:07:15FromDiscord<haxscramper> (edit) "berrer" => "better"
09:07:29FromDiscord<haxscramper> `var file = open("test.txt"); file.setFilePos(12312312312312)`
09:09:54FromDiscord<System64 ~ Flandre Scarlet> I want to go to the Integer offset 44, I just have to put 44?
09:11:49FromDiscord<Rika> that goes to byte 44 yes
09:12:50FromDiscord<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:02FromDiscord<Rika> multiply by the byte size?
09:14:42FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3py7
09:15:21FromDiscord<Rika> can you copy the whole message
09:15:49FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3py8
09:16:07FromDiscord<Rika> is that literally it?
09:16:16*euantorano joined #nim
09:16:23FromDiscord<mlokis> its complaining about code generated by macro
09:16:29FromDiscord<Rika> which
09:17:01FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3py9
09:17:22FromDiscord<mlokis> this is a deep shit
09:17:38FromDiscord<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:59FromDiscord<haxscramper> Are you sure this is the same code as generated by macro
09:18:07FromDiscord<mlokis> yes
09:18:22FromDiscord<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:47FromDiscord<mlokis> i ll try something maybe am just stupid
09:19:00FromDiscord<Davide> sent a code paste, see https://play.nim-lang.org/#ix=3pya
09:19:03FromDiscord<haxscramper> In macro `echo result.repr`
09:19:11FromDiscord<System64 ~ Flandre Scarlet> Ah there is readInt16
09:19:11FromDiscord<Davide> (edit) "https://play.nim-lang.org/#ix=3pya" => "https://play.nim-lang.org/#ix=3pyb"
09:19:19FromDiscord<haxscramper> `expandMacros` is not sufficient when dealing with macro code that generates errors
09:19:28FromDiscord<haxscramper> Hopefully `nkError`will fix that
09:19:31FromDiscord<Davide> (edit)
09:20:05FromDiscord<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:11FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3pyc
09:20:23FromDiscord<Rika> can you give the macro
09:20:41FromDiscord<haxscramper> yeah, full macro is preferrable
09:20:46FromDiscord<mlokis> macro is big but as you wish
09:20:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @haxscramper "It will read int16": So I need to do +2 at each iteration?
09:21:08FromDiscord<haxscramper> `> inconsistent typing for reintroduced symbol ` first time seeing this error
09:21:15FromDiscord<Rika> In reply to @haxscramper "`> inconsistent typing for": same here lol
09:21:35FromDiscord<mlokis> https://media.discordapp.net/attachments/371759389889003532/852839972724801546/message.txt
09:21:48FromDiscord<mlokis> here its a bit of code
09:22:21FromDiscord<haxscramper> `/home/jail/prog.nim(3, 16) Error: undeclared identifier: 'error'` missing imports?
09:22:58FromDiscord<mlokis> oh sorry well then i have to give you reproducable version
09:23:11FromDiscord<mlokis> that will take little longer
09:23:12FromDiscord<haxscramper> yeah, I can't debug code that I can't run
09:23:24FromDiscord<System64 ~ Flandre Scarlet> oh that works!
09:23:27FromDiscord<mlokis> i thought you just want to see it
09:23:29FromDiscord<mlokis> sec
09:23:42FromDiscord<System64 ~ Flandre Scarlet> it returned 75 and HXD says the same thing!
09:24:06FromDiscord<haxscramper> In reply to @System64 "So I need to": `setFilePos(requiredIndex yourItemSize)`
09:25:14FromDiscord<mlokis> this should run https://media.discordapp.net/attachments/371759389889003532/852840894319034428/message.txt
09:25:57FromDiscord<System64 ~ Flandre Scarlet> > setFilePos(requiredIndex yourItemSize)↵Why?
09:26:01FromDiscord<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:01FromDiscord<mlokis> yea i was kind of lazy to do that as i em only person who will use ithat macro
09:27:11FromDiscord<mlokis> (edit) "ithat" => "that"
09:29:03*Arrrrrrrr joined #nim
09:30:14FromDiscord<haxscramper> https://wandbox.org/permlink/Zkd6eXIPHQfsPsUb it works when I remove `expandMacros`
09:30:34FromDiscord<haxscramper> But I don't know why it doesn't work when I have expandMacros
09:31:33FromDiscord<haxscramper> If I replace `expandMacros` with `macro t(a: typed): untyped = a` it gives the same error
09:33:20FromDiscord<mlokis> i see well i guess a bug
09:33:47FromDiscord<System64 ~ Flandre Scarlet> And how to get the max offset in a file?
09:34:22FromDiscord<Rika> so the file size?
09:35:01FromDiscord<System64 ~ Flandre Scarlet> the max offset, I want to iterates the int16 of a file
09:35:04FromDiscord<System64 ~ Flandre Scarlet> (edit) "iterates" => "iterate"
09:35:31FromDiscord<Rika> what is max offset
09:35:33FromDiscord<Rika> to you
09:36:10FromDiscord<System64 ~ Flandre Scarlet> the end of the file
09:36:55FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/852843830319382538/unknown.png
09:38:13FromDiscord<Rika> so the file size
09:38:19FromDiscord<System64 ~ Flandre Scarlet> yeah
09:38:40FromDiscord<Rika> https://nim-lang.org/docs/io.html#getFileSize%2CFile
09:39:09FromDiscord<System64 ~ Flandre Scarlet> ah but my file is a stream
09:39:41FromDiscord<mlokis> os should have information about file size
09:40:00FromDiscord<haxscramper> use `File/open/setFilePos/getfileSize` then
09:40:07FromDiscord<haxscramper> from `std/io`
09:40:58FromDiscord<Rika> i just sent that
09:41:11FromDiscord<Rika> theyre using a filestream
09:42:40FromDiscord<haxscramper> I mean streams don't have an API for that, so they should use `File`
09:46:45FromDiscord<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:03FromDiscord<mlokis> i em not using nims
13:12:12FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3pz9
13:14:40FromDiscord<haxscramper> you are using macros which run in vm
13:15:20FromDiscord<haxscramper> Or accidentally generated code that has compile-time context, like assign to `const bullets`
13:15:30FromDiscord<haxscramper> (edit) "bullets`" => "Bullets`"
13:16:13FromDiscord<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:35FromGitter<BracketMaster> So this is probably an odd question
14:28:42FromGitter<BracketMaster> But I'd like to access my nim library from C
14:28:51FromGitter<BracketMaster> Is there a way to do this?
14:30:12FromDiscord<Rika> depends
14:30:17Arrrrrrrr@BracketMaster https://nim-lang.org/docs/manual.html#foreign-function-interface-exportc-pragma
14:30:21FromDiscord<Rika> dynamic library? should be simple
14:33:10*fowl joined #nim
14:34:07FromGitter<BracketMaster> Looks like enums can't be exported
14:40:58FromDiscord<haxscramper> When compiling to C code nim generates integers instead of enums, so you would need to reencode all values
14:41:11FromDiscord<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:59FromDiscord<Bung> `No stack traceback available↵16↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
15:25:05*ammar2 left #nim ("Leaving")
15:25:21FromDiscord<Bung> how to get more usefull info when call dll function
15:26:42*giga84 joined #nim
15:27:14giga84it's a legal question
15:27:29giga84if a program or webapp is written in nimlang which uses javascript
15:27:41giga84won't it violate java terms and conditions
15:28:33Prestigejava isn't javascript
15:28:34FromDiscord<exelotl> no, javascript is a completely different language to java, there are no terms and conditions attached to using javascript
15:28:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @giga84 "won't it violate java": JavaScript != Java
15:30:01giga84hmm wikipedia says "Trademark
15:30:02giga84"JavaScript" is a trademark of Oracle Corporation in the United States"
15:30:33giga84how can u write a webapp without their permission
15:30:48giga84in nimlang
15:30:49PrestigeCan you link that? Doesn't sound right
15:31:12FromDiscord<System64 ~ Flandre Scarlet> Why??? https://media.discordapp.net/attachments/371759389889003532/852932986202357800/unknown.png
15:33:47FromDiscord<System64 ~ Flandre Scarlet> that's weird
15:33:54PrestigeThat's very interesting giga84
15:33:55FromDiscord<Bung> array size should be const
15:33:57PrestigeI had no idea
15:35:02FromDiscord<System64 ~ Flandre Scarlet> that's even worse now https://media.discordapp.net/attachments/371759389889003532/852933952847347732/unknown.png
15:35:39Prestigebut anyway giga84 you can use JS freely afaik, but can't claim ownership of javascript
15:36:23giga84so basically you can write an webapp with nim lang and sell it
15:36:40giga84without owing royalties to oracle
15:36:48*ZoomZoomZoom quit (Ping timeout: 240 seconds)
15:37:10FromDiscord<exelotl> yes, same as how you can write an app in JS without owing royalties to oracle
15:37:26FromDiscord<System64 ~ Flandre Scarlet> I don't think you need to ow royalties for using a programming language
15:38:34FromDiscord<Bung> just dont use their trademark, they dont limit you use the language
15:38:49giga84yes but your programming language converts nimlang code java script code
15:39:10FromGitter<tandy1000:matrix.org> im having trouble getting nimble to build documentation for my project
15:39:13giga84hence by using you don't owe royalties
15:39:21giga84ok thx
15:41:10*giga84 left #nim (#nim)
15:41:20FromDiscord<System64 ~ Flandre Scarlet> what can I do for my array?
15:42:17FromGitter<tandy1000:matrix.org> could someone take a look? https://gitlab.com/tandy1000/listenbrainz-nim
15:42:44FromGitter<tandy1000:matrix.org> its in the listenbrainz.nimble file, to generate the docs im just running `nimble doc listenbrainz.nimble`
15:43:35PrestigeWhat's with the .const Flandre?
15:44:11FromDiscord<System64 ~ Flandre Scarlet> I try to make an array to store values
15:45:40FromDiscord<Bung> your `size` is asignment on runtime
15:46:11FromDiscord<Bung> you can't just `.const` it's not a type to convert
15:46:24FromDiscord<System64 ~ Flandre Scarlet> Ah I see↵And if I do a Seq?
15:46:50FromDiscord<Bung> indeed, if your size can't determine at compile type
15:46:56FromDiscord<Bung> time
15:47:03FromDiscord<System64 ~ Flandre Scarlet> I can't at compile time
15:50:36*ZoomZoomZoom joined #nim
15:52:23ForumUpdaterBotNew 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:40FromDiscord<Zachary Carter> ?
16:21:39ldleworkhuh I guess it's not a total outage then
16:22:32ldleworkah they already fixed it too
16:24:22Prestige@Zachary Carter did you apply to papa as well? Was curious if anyone heard back from them
16:25:09FromDiscord<Bung> he is never show again
16:40:06FromDiscord<gerwy> Hewwo
16:46:04FromDiscord<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:26planetis[m]@tandy1000 try mine: https://github.com/planetis-m/libfuzzer/blob/master/nakefile.nim
16:52:53FromDiscord<gerwy> self-promotion?
16:57:24FromDiscord<Lefl> No way
16:57:34FromDiscord<Lefl> You here?
16:57:48FromDiscord<Lefl> Does someone have any experience using nimpy?
17:00:05FromDiscord<demotomohiro> !eval [(proc (a: int) = echo a), proc (a: int) = echo a2][1](3)
17:00:07NimBotCompile failed: /usercode/in.nim(1, 50) Error: invalid token: (\29)
17:01:31FromDiscord<demotomohiro> It works on nim playground
17:03:20FromDiscord<haxscramper> In reply to @Life Sucks "i have a quick": yes, you can use `proc(a: int)` as a type anywhere
17:03:28FromDiscord<haxscramper> In `var/let/sequence/fields and so on
17:03:51*omnigoat joined #nim
17:03:54FromDiscord<demotomohiro> !eval let ary = [(proc (a: int) = echo a), proc (a: int) = echo a2]; ary[1](7)
17:03:56NimBotCompile failed: /usercode/in.nim(1, 60) Error: invalid token: (\29)
17:04:09FromDiscord<haxscramper> IRC bridge breaks some code
17:04:34FromDiscord<haxscramper> https://wandbox.org/permlink/qCnh9Gy19KZ94OI4
17:06:05*narimiran quit (Ping timeout: 272 seconds)
17:06:33Prestigelooks like it's missing a "\"
17:06:50PrestigeI see `!eval let ary = [(proc (a: int) = echo a), proc (a: int) = echo a2]; ary[1](7)`
17:07:00Prestigesee `echo a2]`
17:07:35*clemens3 quit (Ping timeout: 258 seconds)
17:09:16FromDiscord<demotomohiro> discord or irc brige change some charactors?
17:10:09*Guest48150 joined #nim
17:10:48FromDiscord<gerwy> In reply to @Lefl "You here?": LEeeeeeeeeefl<333 How are you :3
17:11:00FromDiscord<Lefl> Good I think
17:11:01FromDiscord<gerwy> i recently started learning nim
17:11:02FromDiscord<demotomohiro> !eval let a=1; echo a2
17:11:03NimBotCompile failed: /usercode/in.nim(1, 16) Error: invalid token: (\29)
17:11:07FromDiscord<Lefl> Feeling tired right now
17:11:23FromDiscord<Lefl> Also my brain starts melting when I try to use python libraries with nim
17:11:35Prestige!eval let a = 1; echo a
17:11:53*Onionhammer6 quit (Read error: Connection reset by peer)
17:11:55FromDiscord<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:12FromDiscord<demotomohiro> "" in a2 is missing in irc log
17:12:23*Guest48150 quit (Remote host closed the connection)
17:12:29Prestigehttps://nim-by-example.github.io/files/ for files
17:12:44FromDiscord<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:38FromDiscord<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:05FromDiscord<gerwy> Also i don't see you Lefl in godot discord anymore, what happend?
17:14:26FromDiscord<haxscramper> In reply to @Life Sucks "because i mostly want": Using `case` is faster than callbacks
17:14:31FromDiscord<haxscramper> Why do you think it is slow?
17:14:33FromDiscord<gerwy> why?
17:14:38FromDiscord<gerwy> In reply to @haxscramper "Why do you think": branches
17:14:44FromDiscord<Lefl> In reply to @Life Sucks "Also i don't see": Nothing, also people talked about politics all the time
17:14:50FromDiscord<haxscramper> https://github.com/status-im/nimbus-eth1/wiki/Interpreter-optimization-resources#nim-implementation-benchmark
17:15:06FromDiscord<gerwy> In reply to @Lefl "Nothing, also people talked": well technically, but it got a little better now
17:15:10FromDiscord<gerwy> In reply to @haxscramper "https://github.com/status-im/nimbus-eth1/wiki/Inter": sus
17:15:10FromDiscord<demotomohiro> @Life Sucks You dont need to put function definition in array. You can create an array of function with function names
17:15:11FromDiscord<haxscramper> In reply to @Life Sucks "branches": vs what? branches vs function call, pointer indirection etc.
17:16:42FromDiscord<haxscramper> computed goto with `case` results in the best performance for interpreter loops, but it all depends on your particular use case.
17:17:06planetis[m]@gerwy he asked for a build docs command, I just happen to have one working
17:17:16planetis[m]any problems with that?
17:17:18FromDiscord<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:31FromDiscord<System64 ~ Flandre Scarlet> I need a pointer to for the buffer?
17:18:47FromDiscord<System64 ~ Flandre Scarlet> (edit) removed "to"
17:21:08FromDiscord<gerwy> sent a code paste, see https://play.nim-lang.org/#ix=3pAT
17:21:35FromDiscord<System64 ~ Flandre Scarlet> I don't want to write text but binary data
17:23:16FromDiscord<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:41FromDiscord<haxscramper> What are you writing btw?
17:24:44FromDiscord<Lefl> I'm pretty sure by quicker he meant quicker to write
17:24:53FromDiscord<Lefl> (edit) "I'm pretty sure by quicker he meant quicker to write ... " added "not quicker to run"
17:25:11FromDiscord<haxscramper> In reply to @Life Sucks "because i mostly want": `> i mostly want to do it because of performance, `
17:25:30FromDiscord<Lefl> Oh nvm I just read his last message
17:26:04FromDiscord<gerwy> In reply to @haxscramper "What are you writing": Game :3
17:26:40Prestigeoh what are you using?
17:26:58FromDiscord<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:02FromDiscord<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:15FromDiscord<haxscramper> So you really need to bench things for your use case
17:28:34FromDiscord<gerwy> In reply to @Prestige "oh what are you": raylib
17:29:06FromDiscord<Lefl> I think I'll go back to the 2 program solution instead of trying this abominations
17:29:08FromDiscord<Lefl> (edit) "abominations" => "abomination"
17:29:14FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pAU
17:29:44FromDiscord<haxscramper> Function call overhead might be diferent depending on the arguments (their number, size etc) I think
17:29:47FromDiscord<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:48FromDiscord<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:26FromDiscord<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:52FromDiscord<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:20FromDiscord<Lefl> I'm trying to use a bluetooth LE library in nim
17:34:46FromDiscord<Lefl> Yeah maybe I could somehow use a C library, but I have no idea how that works
17:35:41FromDiscord<gerwy> i heard that c2nim turns C libraries to be usable for nim↵because raylib bindings used that
17:36:01FromDiscord<Lefl> hmm
17:37:53FromDiscord<gerwy> sent a code paste, see https://play.nim-lang.org/#ix=3pAY
17:38:04FromDiscord<gerwy> the game would be something like Stick War, the good ol' flash game
17:38:11FromDiscord<Lefl> Hmm I'll also have to find a C BLE library, everything is C++
17:39:22FromDiscord<haxscramper> you can interop with C++ as well
17:39:34FromDiscord<haxscramper> and c2nim "supports" "part" of the C++
17:39:59FromDiscord<demotomohiro> Nim can wrap C++ library, but you would need some C++ lang features
17:40:31FromDiscord<haxscramper> such as? Depending on which feature you need
17:41:15FromDiscord<demotomohiro> You would need to know some C++ lang feature
17:41:16FromDiscord<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:34FromDiscord<haxscramper> In reply to @demotomohiro "*You would need ": ah, well
17:42:59FromDiscord<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:11FromDiscord<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:04FromDiscord<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:16FromDiscord<haxscramper> huh
17:46:30FromDiscord<haxscramper> they are not similar,
17:46:42FromDiscord<haxscramper> Unless you write C in C++ at least
17:46:43FromDiscord<gerwy> but if you know C++ you can understand C
17:47:22FromDiscord<haxscramper> True, but it does not work other way around. And some C idioms are different from C++ still
17:47:54FromDiscord<gerwy> ah yes
17:48:02FromDiscord<gerwy> i mean like C++ -> C relation
17:48:19FromDiscord<gerwy> because i know C++, at least a little and i think i can understand C code if i see it
17:50:41FromDiscord<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:52FromDiscord<haxscramper> just `write`, no? https://nim-lang.org/docs/streams.html#write%2CStream%2CT
17:51:59FromDiscord<haxscramper> or `write` bytes as string
17:52:22FromDiscord<System64 ~ Flandre Scarlet> Not as string
17:53:23FromDiscord<haxscramper> And what 'seq of bytes' is then? nim `string` uses `char` so it can be viewed as sequence of bytes
17:53:58FromDiscord<System64 ~ Flandre Scarlet> Oh I see
17:55:00FromDiscord<haxscramper> Or `seq[uint8]`
17:55:10FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pB6
17:55:58FromDiscord<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:52FromDiscord<demotomohiro> This `write` should work: https://nim-lang.org/docs/streams.html#write,Stream,string
17:58:00FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pB7
18:00:14FromDiscord<haxscramper> Same results as if I wrote `var s = @[12]; echo cast[ptr array[sizeof(s), uint8]](addr s)[]`
18:03:21FromDiscord<demotomohiro> In reply to @haxscramper "Same results as if": It just echo internel pointer of seq as array of uint8.
18:03:53FromDiscord<Lefl> Oh boy oh boy oh boy
18:04:04FromDiscord<Lefl> My 2 program solution works pretty nice
18:07:05FromDiscord<gerwy> nicee
18:08:46FromDiscord<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:23FromDiscord<Bung> why you use writeLine ? you are not processing text
18:17:09FromDiscord<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:59FromDiscord<System64 ~ Flandre Scarlet> Even with something else it's messed up
18:26:53FromDiscord<Bung> I dont remenber stream api , have you tried write newSample.addr newSample.len , or just write newSample
18:27:06FromDiscord<System64 ~ Flandre Scarlet> I just write
18:28:01FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pBm
18:33:32FromDiscord<Bung> I guess it's logic problem
18:35:12FromDiscord<Bung> also where `setPositionImpl` coming from ? `setPosition` right ?
18:35:25FromDiscord<System64 ~ Flandre Scarlet> yeah
18:36:30FromDiscord<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:46FromDiscord<System64 ~ Flandre Scarlet> for index in newSample:↵ echo index↵I did that, it outputs RIFF WAVE etc...
18:38:45FromDiscord<Bung> some logic in your while loop may not as you expected I think
18:41:16FromDiscord<System64 ~ Flandre Scarlet> the first or the second?
18:41:36FromDiscord<Bung> both
18:43:48*Arrrrrrrr quit (Quit: Arrrrrrrr)
18:44:42FromDiscord<System64 ~ Flandre Scarlet> I think the first works well
18:50:27FromDiscord<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:04FromDiscord<zetashift> mhmhm maybe `asynctools` is a better option
18:51:25FromDiscord<Bung> @haxscramper your hnimast works? I can't make it work on 1.4.8 and devel
18:51:29leorize[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:11FromDiscord<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:40leorize[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:49leorize[m]so your next best choice is asynctools asyncproc
18:56:47leorize[m]actually this looks kinda weird
18:57:36leorize[m]sys/pipes should work if you don't mind the low level api
18:57:59FromDiscord<haxscramper> In reply to @Bung "<@!608382355454951435> your hnimast works?": define "can't make it work"
18:58:08leorize[m]looks like you won't, the api here is low level as hell :p
18:58:14FromDiscord<haxscramper> it passes CI tests for hnimast and haxdoc
18:59:21FromDiscord<Bung> /Users/bung/.nimble/pkgs/compiler-1.5.1/compiler/commands.nim(40, 33) Error: undeclared identifier: 'nativeStackTraceSupported'
18:59:21FromDiscord<haxscramper> and i"m using 1.4.8 locally as well
18:59:46FromDiscord<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:04leorize[m]@zetashift personal recommendation is sys/pipes because I wrote it :p
19:00:15FromDiscord<haxscramper> and what are you trying to do? Show the code that gives errors
19:00:19leorize[m]on a more serious note then it's because I consider my impl more correct
19:00:36leorize[m]regarding pipe collisions and the likes
19:02:12FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=3pBz
19:02:41FromDiscord<Bung> I import os and hnimast/compiler_aux
19:05:32FromDiscord<Bung> https://github.com/bung87/slim I just init a package
19:06:34FromDiscord<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:07FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3pBA
19:07:21FromDiscord<haxscramper> Everything is parsed and working as expected
19:11:20FromDiscord<Lefl> Are there any resources on how to use nim instead of js for website development?
19:11:27FromDiscord<zetashift> In reply to @leorize "<@77574388035100672> personal recommendation is": Playing around with it now
19:11:32FromDiscord<zetashift> 😄
19:12:22FromDiscord<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:35FromDiscord<haxscramper> `-d:ssl`
19:15:36FromDiscord<haxscramper> https://github.com/nim-lang/RFCs/issues/337
19:15:57FromDiscord<haxscramper> You need to compile with `-d:ssl` when using nimble
19:17:35FromDiscord<Bung> yeah , works with ssl flag , Thanks!
19:18:45FromDiscord<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:53FromDiscord<haxscramper> So it might break at some places
19:19:24FromDiscord<haxscramper> Also use `parsePackageInfo` instead of `nims` version as there are some packages that use old format
19:20:16FromDiscord<Bung> `let x = staticRead("../../nimble.nimble")` in `nimblepkg/common.nim` it looks weird ? a relative path to static read
19:20:52FromDiscord<haxscramper> if you have `srcDir = "src"` it would break when package is installed
19:21:00FromDiscord<haxscramper> But this `srcDir` is broken AF
19:22:15FromDiscord<haxscramper> so you need `staticRead` + check whether it is `../nimble.nimble` or `../../nimble.nimble`
19:24:36FromDiscord<Bung> think it breaks because use it as package
19:25:10FromDiscord<Bung> it should move to bin main file I think
19:25:35FromDiscord<haxscramper> if you have binary package it would still download sources and compile them
19:25:55FromDiscord<haxscramper> but I"m not sure how files are moved in this case (e.g. whether `srcDir` is respected or not)
19:27:47FromDiscord<Bung> all files will move out from src, src doesn't exists after installing
19:29:29FromDiscord<Bung> the simple solution will define a prepublish task simple dump version to a single file
19:30:27FromDiscord<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:16FromDiscord<Bung> well, I still need change the common.nim to make it work
19:35:18FromDiscord<Bung> am wondering how nim version update to system.nim
19:36:28FromDiscord<Bung> oh it use defined flag so other program defines
19:37:34FromDiscord<haxscramper> just has integer value that is manually incremented https://github.com/nim-lang/Nim/blame/44e653a9314e1b8503f0fa4a8a34c3380b26fff3/lib/system.nim#L2114
19:37:56FromDiscord<haxscramper> I mean we don't have releases that often so it become an issue
19:38:53FromDiscord<Bung> make sense, well.
19:44:06FromDiscord<System64 ~ Flandre Scarlet> Do you know what's the problem with my code please?
19:58:09FromDiscord<Bung> can you make a repo that I can directly run , then I can take a look
19:59:36FromDiscord<System64 ~ Flandre Scarlet> alright so I checked and NewSample contains the right sequence of data
20:01:39FromDiscord<Bung> okay
20:02:32*omnigoat quit (Quit: The Lounge - https://thelounge.chat)
20:04:14FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3pBS
20:10:26FromDiscord<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:38FromDiscord<System64 ~ Flandre Scarlet> Alright I found how
20:22:51FromDiscord<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:08FromDiscord<Lefl> Oh thank you
20:23:33FromDiscord<Hi02Hi> (edit) "https://github.com/doccaico/playthings/tree/main/nim/conway-js" => "https://github.com/doccaico/playthings/tree/main/nim"
20:34:33FromDiscord<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:51FromDiscord<Bung> your newFileStrm size is determined
20:38:14FromDiscord<Bung> you can't just setPosition to any position
20:39:14FromDiscord<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:43FromDiscord<System64 ~ Flandre Scarlet> var newFileStrm = newFileStream("sample2.wav", fmWrite)↵I init my stream there
20:40:06leorize[m]@zetashift you can't because I haven't implemented named pipes yet
20:40:25FromDiscord<zetashift> ah I didn't see the issue of named pipes so I thought maybe I was looking wrong
20:41:27leorize[m]named pipes are sorta complicated, which is why I haven't give them a proper API
20:41:31leorize[m]but I'll see what I can do for you
20:43:33FromDiscord<zetashift> It's okay! I'll try and get a tcp connection with neovim working in the meantime
20:43:40leorize[m]ok it's not that complicated, I just have to build the file system layer
20:43:49leorize[m]alternatively you can just use stdlib's openFile
20:46:55FromDiscord<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:25FromDiscord<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:13FromDiscord<ElegantBeef> It's len is probably less than 42
20:48:31FromDiscord<System64 ~ Flandre Scarlet> I crash at the line 58
20:48:51FromDiscord<ElegantBeef> index is outside of 0-255
20:48:59FromDiscord<ElegantBeef> so cannot convert to a char
20:49:38FromDiscord<System64 ~ Flandre Scarlet> it's a signed 8-bits array
20:49:54FromDiscord<ElegantBeef> so it's less than 0 eh?
20:49:59FromDiscord<System64 ~ Flandre Scarlet> yeah
20:50:27FromDiscord<ElegantBeef> !eval let a = (-1i8).char
20:50:29NimBotCompile failed: /usercode/in.nim(1, 15) Error: -1 can't be converted to char
20:50:57FromDiscord<ElegantBeef> It's ambiguous what that should be, convert to int16 add 127 then convert to char
20:51:02FromDiscord<System64 ~ Flandre Scarlet> I need to put the data of this Seq in my file↵'cause the Wav is signed
20:51:25FromDiscord<ElegantBeef> Atleast that's what i'd do, no clue what's "proper"
20:52:09FromDiscord<System64 ~ Flandre Scarlet> I want to convert a signed 16-bits wav to signed 8-bits wav
20:52:20FromDiscord<ElegantBeef> So then why do you need char?
20:53:03FromDiscord<System64 ~ Flandre Scarlet> To put it in my data stream
20:53:24FromDiscord<ElegantBeef> That makes no sense
20:53:43FromDiscord<System64 ~ Flandre Scarlet> I use that : newFileStrm.writeLine(str)
20:53:58FromDiscord<ElegantBeef> https://nim-lang.org/docs/streams.html#write%2CStream%2CT
20:54:00FromDiscord<Bung> all things you write in the end are chars
20:54:30FromDiscord<Bung> so could just turns your input data to chars first ?
20:54:52FromDiscord<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:55FromDiscord<ElegantBeef> Or just write the value to the file
20:55:18FromDiscord<ElegantBeef> But you can if you must `cast[char](index)` though it's pointless when you can just write the data
20:56:34FromDiscord<Bung> the only concern is do you know how you ints turns to chars properly
21:00:36FromDiscord<System64 ~ Flandre Scarlet> The new file is messed up if I do newFileStrm.write(newSample)
21:01:49FromDiscord<ElegantBeef> Well what is supposed to be written when you go to write `-1`?
21:02:07FromDiscord<System64 ~ Flandre Scarlet> hex value
21:02:37FromDiscord<System64 ~ Flandre Scarlet> I mean, like what you see in HxD
21:02:47FromDiscord<ElegantBeef> So you mean the binary value of `-1` so what it did
21:03:27FromDiscord<System64 ~ Flandre Scarlet> I want to write the binary value of -1
21:03:34FromDiscord<ElegantBeef> Which is what `stream.write` should write
21:04:35FromDiscord<System64 ~ Flandre Scarlet> ah maybe it writes the memory adress of the seq?
21:04:45FromDiscord<ElegantBeef> yes
21:05:21FromDiscord<ElegantBeef> If you're writting a seq do `writeData(seq[0].addr, seq.len)`
21:05:23FromDiscord<ElegantBeef> (edit) "writting" => "writing"
21:06:08FromDiscord<System64 ~ Flandre Scarlet> aaaah let me try that
21:12:01FromDiscord<System64 ~ Flandre Scarlet> I'm not far
21:12:07FromDiscord<System64 ~ Flandre Scarlet> some bugs left
21:13:29*rockcavera joined #nim
21:20:03*lritter quit (Ping timeout: 272 seconds)
21:21:44FromDiscord<System64 ~ Flandre Scarlet> alright I see something weird
21:22:04FromDiscord<Lefl> Ok I found a downside of indentation based syntax
21:23:14FromDiscord<Lefl> I mean it's bearable
21:23:15FromDiscord<Lefl> sent a code paste, see https://play.nim-lang.org/#ix=3pCi
21:23:34FromDiscord<Lefl> (edit) "https://play.nim-lang.org/#ix=3pCi" => "https://play.nim-lang.org/#ix=3pCj"
21:25:38FromDiscord<ElegantBeef> What's the issue?
21:26:18FromDiscord<Lefl> It loogs ugly
21:26:23FromDiscord<ElegantBeef> Well let's fix ut
21:26:25FromDiscord<ElegantBeef> (edit) "ut" => "it"
21:30:01FromDiscord<ElegantBeef> This is marginally better https://play.nim-lang.org/#ix=3pCm
21:30:05FromDiscord<ElegantBeef> But we can do it even better
21:31:47FromDiscord<Lefl> Hmm
21:34:18FromDiscord<ElegantBeef> Now we're cooking with gasoline https://play.nim-lang.org/#ix=3pCr
21:36:13FromDiscord<Lefl> Oh boy that's sexy
21:36:14FromDiscord<Lefl> thanks
21:36:28FromDiscord<ElegantBeef> No problem, embrace the block call style
21:36:39FromDiscord<Lefl> what does the {.inject.} pragma do?
21:36:48FromDiscord<ElegantBeef> in templates it doesnt add gensym to the name
21:36:55FromDiscord<ElegantBeef> so you can use `it` inside the blocks to access that value
21:37:23FromDiscord<Lefl> What's gensym?
21:37:41FromDiscord<ElegantBeef> ensured unique name so without it that `it` is actually `itgensym0`
21:37:51FromDiscord<ElegantBeef> And i dont think can be accessed anyway
21:38:16FromDiscord<Lefl> Ok
21:38:23FromDiscord<ElegantBeef> Templates are hygenic which means unless otherwise specified like with the inject they dont emit symbols that are accessible
21:38:45FromDiscord<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:02FromDiscord<Lefl> Is it possible to change the "do" to something like "fail"?
21:41:17FromDiscord<Lefl> I have no real idea how the templating works, I should get into that
21:43:43FromDiscord<System64 ~ Flandre Scarlet> newFileStrm.writeData(array8bits[0].addr, array8bits.len)↵Is it possible to write that in little endian mode?
21:44:23FromDiscord<Lefl> Uh it doesn't execute the `makeGetRequest` proc
21:48:02FromDiscord<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:23FromDiscord<ElegantBeef> You could write a macro for that but seems like a lot of work for very little benefit
21:50:19FromDiscord<Lefl> Hmm weird
21:50:32FromDiscord<ElegantBeef> To show that block param passing https://play.nim-lang.org/#ix=3pCv
21:51:03FromDiscord<ElegantBeef> Can be useful to eliminate pre calculating variables 😄
21:52:17FromDiscord<Lefl> I'm a big dummy
21:52:27FromDiscord<Lefl> I forgot to call the success procedure 😄
21:52:55FromDiscord<Lefl> Hmm wait no
21:54:35FromDiscord<Lefl> nvm it did work
21:55:04FromDiscord<Lefl> Thanks
21:55:16*TheOnlyJoey|BNC joined #nim
21:55:48*TheOnlyJoey|BNC quit (Remote host closed the connection)
22:01:33FromDiscord<System64 ~ Flandre Scarlet> Why?? https://media.discordapp.net/attachments/371759389889003532/853031221142880276/unknown.png
22:03:56FromDiscord<exelotl> @System64 ~ Flandre Scarlet in Nim `/` always returns a floating point value. You want `a div 256` instead.
22:08:09FromDiscord<System64 ~ Flandre Scarlet> Ah alright
22:11:45FromDiscord<Hi02Hi> isn't it impossible for b > 255?
22:12:40FromDiscord<Hi02Hi> uint16.high = 2^16 - 1 = 65535↵65535 div 256 = 255
22:13:00FromDiscord<Hi02Hi> (edit) "uint16.high = 2^16 - 1 = 65535↵65535 div 256 = 255 ... " added "(.996...)"
22:13:11FromDiscord<Hi02Hi> (edit) removed "(.996...)"
22:15:39FromDiscord<System64 ~ Flandre Scarlet> ah yeah truc
22:19:45FromDiscord<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:35FromDiscord<Alea> anyone have hints here? https://media.discordapp.net/attachments/371759389889003532/853037522934169620/unknown.png
22:27:07FromDiscord<Alea> openarray is meant for taking unknown length arrays and seqs right?
22:27:37FromDiscord<Lefl> Does someone know how I can concatenate a cstring and a string?
22:29:47FromDiscord<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:07FromDiscord<konsumlamm> In reply to @Lefl "Does someone know how": convert one to the other and then concatenate as normal?
22:31:29FromDiscord<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:00FromDiscord<konsumlamm> that's because `openArray`s aren't first class, but that may change in the future
22:32:50FromDiscord<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:02FromDiscord<Alea> is returning an unknown length array allowed?
22:33:13FromDiscord<Alea> or do I have to use a seq for that
22:37:40leorize[m]you need a seq, but what are you trying to do?
22:44:17FromDiscord<Hi02Hi> arrays sizes must be known at compile time
22:50:57FromDiscord<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:36FromDiscord<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)