<< 27-06-2020 >>

00:00:14sschwarzerSince I learned it, Python was always my "universal" language. It's really very flexible and useful for many things. Before learning Python, I learned a new language about every two years on average. After Python, only very few.
00:00:23FromDiscord<Technisha Circuit> Oh?
00:00:37FromDiscord<Technisha Circuit> I think JS is better for websocket stuff
00:01:01sschwarzerTechnisha Circuit: When I started with Python, the community was also very small and Python was a hardly know niche language.
00:01:01FromDiscord<Technisha Circuit> Because Python websocket modules are generally very limited client-side or server-side
00:01:10FromDiscord<Technisha Circuit> Oh?
00:01:38sschwarzerTechnisha Circuit: That was with Python 1.5.2 :-)
00:01:56FromDiscord<Technisha Circuit> Also, anyone know how i can run a .nims file without it needing the .nims extension?
00:02:04sschwarzerNo unicode, no list comprehensions, no `yield` ...
00:02:04FromDiscord<Technisha Circuit> Holy crap that's old+
00:02:10FromDiscord<Technisha Circuit> (edit) 'old+' => 'old-'
00:02:26FromDiscord<Technisha Circuit> Oh? No async at all?
00:03:31sschwarzerRegarding the assignment semantics, you can see it here: https://sschwarzer.com/download/robust_python_programs_europython2010.pdf (starting at page 8)
00:04:08sschwarzerTechnisha Circuit: I think there was some async support in the standard library, but more limited and much less mature than nowadays.
00:04:38FromDiscord<Technisha Circuit> Wait, so here https://media.discordapp.net/attachments/371759389889003532/726226442681057310/Screenshot_20200627_010419_com.google.android.apps.docs.jpg
00:04:48FromDiscord<Technisha Circuit> X and Y could have the same value?
00:05:25FromDiscord<Technisha Circuit> If i changed x after i did `y = x`, would y have the same value as x?
00:05:56sschwarzerTechnisha Circuit: a bit above, with "Names and Assignments" / "Basics"
00:06:14FromDiscord<Technisha Circuit> sent a code paste, see https://play.nim-lang.org/#ix=2qh5
00:06:43*krux02_ quit (Remote host closed the connection)
00:07:14sschwarzerTechnisha: Depends on the "change". `y = x` binds `y` to the same object that `x` is pointing to. If you change `x` in-place (i. e. change the object itself), you'll see this also in `y`. (See the list example)
00:08:07FromDiscord<Technisha Circuit> Oh
00:08:16FromDiscord<Technisha Circuit> But that's not what happens now, correct?
00:08:58sschwarzerSome people think that assignment and argument passing work differently for mutable and immutable types in Python. But that's not the case. :-)
00:09:27sschwarzerTechnisha: What do you mean by "now"?
00:10:20FromDiscord<Technisha Circuit> sent a code paste, see https://play.nim-lang.org/#ix=2qh6
00:10:29FromDiscord<Technisha Circuit> (edit) 'https://play.nim-lang.org/#ix=2qh6' => 'https://play.nim-lang.org/#ix=2qh7'
00:10:33FromDiscord<Technisha Circuit> So if i do that in modern Python
00:10:52FromDiscord<Technisha Circuit> y will stay as 1.0, but x will change to 2.0
00:11:19sschwarzerTechnisha: When you posted the Nim playground link, I didn't think you were speaking about Python :)
00:11:21FromDiscord<Technisha Circuit> But in python 1, what would happen is that y would also become 2 because y points to x
00:11:33FromDiscord<Technisha Circuit> Oh
00:11:37FromDiscord<Technisha Circuit> I didn't post a link
00:11:45FromDiscord<Technisha Circuit> It's just the bot that does that :0
00:11:54FromDiscord<Technisha Circuit> (edit) ':0' => ':p'
00:11:59sschwarzerThe assignment semantics has never changes, it's the same in Python 1, 2 and 3.
00:12:07sschwarzer"changed"
00:13:08FromDiscord<Technisha Circuit> Oh okay
00:13:50sschwarzerTechnisha: Regarding https://play.nim-lang.org/#ix=2qh6 : When you do the `x = 2.0` in line 6, you "break" the reference of the name `x` to 1.0, but create a new float 2.0 and reference it from `x`.
00:14:25sschwarzerIf `y` didn't still point to the 1.0, it could be garbage-collected.
00:14:58FromDiscord<Technisha Circuit> Oh okay then
00:15:01FromDiscord<Technisha Circuit> Thanks
00:15:29sschwarzer"Variables" in Python are just names attached to objects.
00:16:50FromDiscord<Technisha Circuit> :P
00:21:43sschwarzerI find it interesting that the metaprogramming in Nim is so powerful that I sometimes forgot it only works with information available at compile time. Some things (at first sight) _look_ dynamic as in Python, but aren't. :)
00:25:18sschwarzerOoops, it's 2:30 (AM) here now. Bye. :-)
00:26:09*sschwarzer quit (Quit: leaving)
00:43:57FromDiscord<Technisha Circuit> Oh?
00:44:06FromDiscord<Technisha Circuit> Bye!
01:00:11FromDiscord<impbox> so i'm passing a utf8 filename to a c library which opens the file, but on windows it fails, i'm thinking i probably need to convert it to utf16 before passing it to the c lib, does that sound right? does nim have a utf8->16 command?
01:01:09FromDiscord<impbox> ahh maybe i can open the file first and then pass the file handle to the c lib
01:07:08FromDiscord<impbox> cool, that works
01:12:34*oddp quit (Ping timeout: 240 seconds)
01:14:05FromDiscord<Technisha Circuit> Check https://nim-lang.org/docs/unicode.html
01:18:50FromDiscord<impbox> @Technisha Circuit yep I did
01:18:58FromDiscord<impbox> can't see any mention of utf16
01:19:29FromDiscord<Technisha Circuit> Hm
01:19:44FromDiscord<impbox> only utf8, and I'd like to convert it to utf16 as I'm guessing that's what is expected by window's open file call
01:19:58FromDiscord<impbox> but calling nim's `open` passing utf8 works
01:20:01FromDiscord<impbox> but not on the c side
01:20:08FromDiscord<Technisha Circuit> Sorry, no idea then :/
01:20:40FromDiscord<impbox> all good, i've worked around it for now
01:21:10FromDiscord<Technisha Circuit> S: Oh okay
01:21:35FromDiscord<impbox> by opening the file on nim and passing the file handle to C
01:25:08FromDiscord<Technisha Circuit> Oo
01:29:10*fredrikhr quit (Ping timeout: 260 seconds)
01:46:51FromDiscord<Shucks> is there a easy way to concat two arrays? I've found this `https://stackoverflow.com/questions/43834584/how-to-concat-two-arrays-in-nim` but I feel like thats a bit overpowered
01:47:16FromDiscord<Elegant Beef> Do you mean sequences or arrays
01:47:23FromDiscord<Shucks> arrays
01:47:23FromDiscord<Elegant Beef> Cause one doesnt seem possible really 😄
01:48:07FromDiscord<Elegant Beef> I dont even know aht that works cause, arrays are compile time constant size afaik
01:48:22FromDiscord<Elegant Beef> know how that*
01:48:54FromDiscord<Shucks> well the proc generates a new array in result. Thats why I guess
01:49:45FromDiscord<Elegant Beef> Maybe, idk i dont tend to touch arrays since they're static and i prefer exact size over a buffer 😄
01:50:27*chemist69 quit (Ping timeout: 240 seconds)
01:50:54FromDiscord<Elegant Beef> Yes i abuse the heap
01:52:40*chemist69 joined #nim
01:55:36FromDiscord<Rika> @Shucks https://play.nim-lang.org/#ix=2qhl i dont see why not
01:55:48FromDiscord<Rika> what do you mean by overpowered anyway
01:56:48FromDiscord<Shucks> I don't want to have a extra function in my code to concat arrays. However since I know the size of the array and just the data will change in it I actually don't need it at all. Thanks anyway ;D
02:06:55*dmi0 quit (Remote host closed the connection)
02:07:16*dmi0 joined #nim
02:41:32*muffindrake quit (Ping timeout: 260 seconds)
02:43:35*muffindrake joined #nim
02:51:46*arecaceae quit (Remote host closed the connection)
02:52:09*arecaceae joined #nim
03:17:41*Tongir joined #nim
03:19:58*Tlongir quit (Ping timeout: 246 seconds)
03:24:32FromDiscord<impbox> is there an easy way to expose procs to nimscript?
03:25:39FromDiscord<impbox> eg `proc foo() = echo bar` in nim, then make that available to the nimscript interpreter
03:27:11FromDiscord<Elegant Beef> I think PMunch's blog post does that, did you already read it?
03:28:01FromDiscord<Elegant Beef> https://peterme.net/how-to-embed-nimscript-into-a-nim-program-embedding-nimscript-pt-2.html Inside Calling between script and compiled code
03:30:37FromDiscord<impbox> hmm based on that it looks like you need to manually redefine all the procs you want to pass to the interpreter
03:30:47FromDiscord<impbox> though I guess maybe you could make a macro to do it
03:30:53FromDiscord<Elegant Beef> Seems so, but might be able to automate it wi... yes
03:33:16FromDiscord<impbox> was thinking to expose all nico procs to the interpreter
03:35:33FromDiscord<Elegant Beef> Would that allow you to use nimscript in the browser?
03:35:36FromDiscord<Elegant Beef> Ah nvm
03:36:01FromDiscord<Elegant Beef> Or maybe not idk my question is reasked!
03:36:48FromDiscord<impbox> maybe, dunno if nimscript works in browser, but gotta get things working native first
03:37:31FromDiscord<Elegant Beef> If you can include the compiler in a `nim js` then i'd imagine it'd work
03:38:33FromDiscord<impbox> `C:\Users\user\.nimble\pkgs\compiler-1.2.0\compiler\pathutils.nim(25, 6) Error: this proc is not available on the NimScript target; usage of 'copyFile' is an {.error.} defined at C:\Users\user\.choosenim\toolchains\nim-1.2.2\lib\pure\os.nim(1645, 1)`
03:41:23*opal quit (Ping timeout: 240 seconds)
03:44:39FromDiscord<Deorder> @impbox yes, this template does that, https://github.com/komerdoor/nim-embedded-nimscript/blob/master/main.nim#L70
03:44:55FromDiscord<Deorder> But you have to modify it to support arguments 😬
03:44:56FromDiscord<impbox> @Deorder nice
03:45:03FromDiscord<Deorder> Never got to that 😄
03:45:43FromDiscord<Deorder> Right below there is an example where I use it.
03:46:40FromDiscord<impbox> seems like a good start
03:46:44FromDiscord<Deorder> Do not bother building the project. It is too old and it does not compile anymore. I remember the compiler internal `future` and the `future` module clashing.
03:46:55FromDiscord<Deorder> Something like that
03:50:19FromDiscord<Deorder> @impbox I see that Serenitor improved upon my code here: https://github.com/Serenitor/embeddedNimScript/blob/master/embeddedNims/apiImpl.nim#L37
03:55:06*justsomeguy joined #nim
03:56:06FromDiscord<Deorder> Then at the scripting side you have to declare all functions that exist, using that `builtin` thing so that the script knows those exported functions exist.
03:58:19FromDiscord<Deorder> Like here <https://github.com/komerdoor/nim-embedded-nimscript/blob/master/imports.nims#L3> and here <https://github.com/Serenitor/embeddedNimScript/blob/master/scripts/api.nim#L4>
04:04:55FromDiscord<codic> when i add `*` to the end of a var and use the js backend why does it not go in module.exports in js?
04:06:01*supakeen quit (Quit: WeeChat 2.8)
04:06:44*supakeen joined #nim
04:08:57FromDiscord<Deorder> With commonjs, shouldn't it go in `exports.thevar`?
04:10:03*opal joined #nim
04:11:52FromDiscord<Deorder> I mean something like that should show up in the generated code
04:15:32FromDiscord<Deorder> I was thinking it may also generate JS code in the form `module.exports = { thevar: 'value' };`
04:21:50FromDiscord<juan_carlos> The Star is for Nim code, for the JS export theres a module on Nimble that does that, but yeah it does what you say basically.
04:55:44*waleee-cl quit (Quit: Connection closed for inactivity)
05:04:21*justsomeguy quit ()
05:22:16*endragor joined #nim
05:41:50*NimBot joined #nim
06:03:44*dddddd quit (Ping timeout: 265 seconds)
06:04:32*Mister_Magister quit (Quit: bye)
06:09:36*Mister_Magister joined #nim
06:28:51*nsf joined #nim
06:39:15*ForumUpdaterBot joined #nim
06:44:52FromGitter<YusufCakan> Hi are there any instructions on how to set up vscode for debugging nim programs
06:45:16FromGitter<YusufCakan> I see some discussions from various forums but they are from 2/3 years ago
06:53:58FromDiscord<Elegant Beef> Did you see this?↵https://github.com/jasonprogrammer/nim-debug-example
06:56:09*solitudesf joined #nim
06:57:59FromGitter<YusufCakan> Thanks for the link, I hadn't seen that one. Let me give it try and see if it works.
07:03:06ForumUpdaterBotNew thread by Yardanico: Nuglifier - Nim source code uglifier, see https://forum.nim-lang.org/t/6497
07:24:46*Vladar joined #nim
07:25:37*narimiran joined #nim
07:45:20*endragor quit (Remote host closed the connection)
07:45:48*endragor joined #nim
07:50:35*endragor quit (Ping timeout: 260 seconds)
08:02:50*nsf quit (Quit: WeeChat 2.8)
08:08:53*fredrikhr joined #nim
08:10:46FromDiscord<impbox> hmm in a generic proc[T] can I branch based on the type of T?
08:10:49Yardanicoyes
08:10:53Yardanicoyou need to use "when" tho
08:11:07FromDiscord<impbox> ahh
08:11:15Yardanicocompile-time if and also doesn't open a new scope
08:11:44FromDiscord<impbox> eg `when T in [float,float32]: result = value.formatFloat(ffDecimal, 2)`
08:11:48FromDiscord<impbox> something like that
08:11:48Yardanicoyeah
08:12:10FromDiscord<impbox> thanks
08:12:24Yardanicowell this syntax won't work though
08:12:48YardanicoI think you'll need to do "when T is float or T is float32"
08:12:53Yardanicoor just
08:12:55Yardanicowhen T is SomeFloat
08:12:58FromDiscord<impbox> yeah, i thought that might be the case
08:13:04FromDiscord<impbox> oh didn't know about SomeFloat
08:13:11Yardanicosystem.nim has some of these
08:13:17FromDiscord<impbox> handy
08:13:19YardanicoSomeOrdinal, SomeNumber, SomeFloat
08:13:27YardanicoSomeSignedInt, SomeUnsignedInt, SomeInteger
08:18:33*rockcavera quit (Remote host closed the connection)
08:23:09*Cybuster quit (Quit: Leaving)
08:25:09FromDiscord<Synth> Can anyone help me with asyncdispatch with dynlib? I'm trying to compile this program, but I am getting an error violating memory safety. Is anyone able to help me with this?
08:50:14*lbart quit (Ping timeout: 240 seconds)
08:56:06*endragor joined #nim
08:56:13*ForumUpdaterBot quit (Remote host closed the connection)
08:57:42*ForumUpdaterBot joined #nim
08:57:50ForumUpdaterBotNew post by Adilh in Choosing Nim: Thanks! I ' m a bit old fashioned (I still use mutt for my mail client). I ... (https://forum.nim-lang.org/t/6488#40128)
08:57:54Yardanicowah
08:57:55Yardanicowrong
08:57:56*ForumUpdaterBot quit (Remote host closed the connection)
08:58:04FromDiscord<Synth> Regarding my case?
08:58:08Yardanicono, sorry
08:58:13FromDiscord<Synth> It's okay
08:59:30*ForumUpdaterBot joined #nim
08:59:38*ForumUpdaterBot quit (Remote host closed the connection)
09:00:06*ForumUpdaterBot joined #nim
09:01:03*endragor quit (Ping timeout: 260 seconds)
09:05:35*oddp joined #nim
09:07:46*drdee joined #nim
09:10:05*drdee quit (Client Quit)
09:11:40*nikita` joined #nim
09:31:45FromDiscord<dom96> When did we get a ForumUpdaterBot?
09:32:25*nsf joined #nim
09:33:21FromDiscord<lqdev> 2 days ago I think
09:33:27FromDiscord<lqdev> ask @yardani
09:33:31FromDiscord<lqdev> ah
09:33:34FromDiscord<lqdev> @Yardanico
09:33:49FromDiscord<lqdev> fuckin mobile keyboard, can't type on this thing
09:33:51FromDiscord<Yardanico> @dom96 I made it yesterday
09:33:54FromDiscord<dom96> cool cool
09:33:57FromDiscord<Yardanico> Just randomly
09:34:02FromDiscord<Synth> No one is able to help me? ;-;
09:34:04FromDiscord<Synth> Hey dom!
09:34:10FromDiscord<Synth> Hey Yard!
09:34:25FromDiscord<lqdev> @Synth you didn't post the error message
09:34:29FromDiscord<Yardanico> Although right now it checks every 20 seconds, is that okay? Well I guess around 1 minute should be fine too
09:34:35FromDiscord<Synth> Oh, I'll post it
09:34:58FromDiscord<Synth> ```nim↵(7, 9) Error: 'tb' is of type <var TerminalBuffer> which cannot be captured as it would violate memory safety↵```
09:35:10FromDiscord<Synth> Should I post the code it's coming from?
09:38:06FromDiscord<mratsim> are you trying to capture a var in a closure?
09:38:31FromDiscord<Synth> I'm trying to use a var parsed into a proc that has async implemented
09:39:32FromDiscord<mratsim> you can't do that (tm)
09:39:37FromDiscord<Synth> Oh/
09:39:38FromDiscord<Synth> (edit) 'Oh/' => 'Oh?'
09:40:01FromDiscord<Synth> My apologies, I didn't know
09:40:19FromDiscord<mratsim> if you pass the var, to the async, and then it's descheduled and another async proc access the var, you will have a single-threaded data race
09:40:33FromDiscord<mratsim> so the compiler is protecting you from a subtle bug
09:40:46FromDiscord<Synth> Ahh okay. Thank you very much!
09:41:58FromDiscord<mratsim> that said if you are printing to a terminal, you might be OK with having things reordered
09:42:25FromDiscord<mratsim> in that case you can take the raw pointer of the var via "addr" and pass that around
09:44:46FromDiscord<mratsim> mmm what to do today ... Cryptography, working on a JIT assembler, SNES emulator, go playing bot, or explore multithreaded async/IO
09:45:54*opDispatch left #nim ("Konversation terminated!")
09:46:12FromDiscord<lqdev> jit assembler? the one from laser?
09:46:23FromDiscord<mratsim> yes
09:46:26FromDiscord<lqdev> cool
09:46:42FromDiscord<mratsim> lifting that in a proper project, and adding more instructions
09:47:13FromDiscord<mratsim> To be fair, both the JIT and SNES would be about filling x86 or 6502 opcodes
09:47:44FromDiscord<mratsim> fill in the blanks: https://github.com/mratsim/glyph/blob/master/glyph/snes/opcodes.nim#L219-L268
09:48:06FromDiscord<mratsim> https://github.com/numforge/laser/blob/master/laser/photon_jit/x86_64/x86_64_ops.nim
09:48:34FromDiscord<mratsim> Ah I could do a compile-time assembler for bigint and crypto as well. I'm tired of fighting GCC poor code generation
09:49:03*Senny quit (Ping timeout: 272 seconds)
09:50:12*chemist69 quit (Remote host closed the connection)
09:50:38*chemist69 joined #nim
09:55:45*narimiran quit (Quit: leaving)
10:07:57*krux02 joined #nim
10:12:11*vsantana joined #nim
10:30:03FromGitter<gogolxdong> Any idea of fsm library?
10:33:56*Vladar quit (Quit: Leaving)
10:38:44federico3"onSignal" is not being found in the search on https://nim-lang.org/docs/lib.html - how comes?
10:39:28federico3mratsim: multithreaded async i/o please :)
11:15:20Zevvfederico3: well, you know what to do to fix that, right
11:15:52Zevvgogolxdong: https://github.com/mratsim/Synthesis ?
11:15:58federico3Zevv: no, I don't remember where to tweak to index the file
11:16:26ZevvI ment the multithreaded async :)
11:17:38federico3what do you mean?
11:18:15ZevvAh I probably just missed context and made a non-sense remark. Please do ignore :)
11:26:32planetis[m]gogolxdong: also https://github.com/b3liever/macromachining/blob/master/statepatternmacro.nim
11:33:40*waleee-cl joined #nim
11:35:41*PMunch joined #nim
11:48:05krux02does anybody have an alternative to githubs LFS?
11:48:10federico3lfs?
11:48:16krux02large file storage.
11:48:23krux02I think their prices are ridiculous.
11:49:06krux02You can host a lot of data, but only one person can download it to reach your download quota
11:49:14federico3s3?
11:50:47krux02ok
11:51:42krux02I think I will remove most of the resources for now and include the files without LFS.
11:51:57krux02not a fan of amazon
11:52:10federico3krux02: how much storage and monthly trasfer are you talking about?
11:52:29krux02around one GB of storage for my github project
11:52:41krux02and cloning the repository.
11:53:01krux02not a lot, maybe 20 people per month cloing the repository maximum.
11:53:19krux02certainly not a lot.
11:53:21FromDiscord<Shucks> Any Idea how I could make that proc different pointer types at once? https://play.nim-lang.org/#ix=2qiC
11:53:27FromDiscord<Shucks> accepting*
11:53:29Yardanico"pointer"
11:53:38federico3krux02: how big is it?
11:53:43Yardanicoyou don't need to make it generic
11:54:05Yardanicojust accept "pointer" which is a generic pointer type
11:54:21Yardanicoit'll accept any "ptr" type (and "pointer" directly too)
11:54:32Yardanicohttps://play.nim-lang.org/#ix=2qiE
11:54:43krux02Shucks: you create a forwarding macro that takes varargs[untyped].
11:55:11krux02or what Yardanico suggested
11:55:20krux02but don't you need to explicitly convert to `pointer`?
11:56:10Yardanicono
11:56:12krux02federico3, I just want to host a few background textures, that is all.
11:56:47federico3...
11:57:25Yardanicokrux02: https://play.nim-lang.org/#ix=2qiF
11:57:46FromDiscord<Shucks> Thanks. Guess it still doesn't compiles https://prnt.sc/t7ftl8
11:58:00Yardanicooh, different types
11:58:06Yardanicothen yeah, you'll need a macro
11:58:09Yardanicoor a template
11:58:56FromDiscord<Shucks> oh well.. now I finally would need to dig deeper into nim lol
11:59:09Yardanicowell wait
11:59:18Yardanicodo you really need varargs?
11:59:26Yardanicoah right it won't really work otherwise anyway
12:00:07krux02yea `ptr int` converts automatically to `pointer` but `varargs[ptr int]` does not automatically convert to `varargs[pointer]`.
12:00:23Yardanicoyeah also in his example they're using multiple pointer types
12:01:28FromDiscord<lilah ▸ 🎀> how do i do c-like byte operations in nim: ` |= a[i] ^ b[i]` is there something i can cast char too that has those operaters?
12:01:51FromDiscord<lilah ▸ 🎀> where a / b would be char* in c
12:02:02Yardanicowhat's ^ ?
12:02:05Zevvxor
12:02:07FromDiscord<lqdev> xor
12:02:27Yardanicoah right
12:02:29Yardanicothen use xor in nim :P
12:02:43FromDiscord<lqdev> `i = i or (a[i] xor b[i])`
12:02:53Zevvlilah ▸ 🎀: xor, and, or are all defined for int types, all sizes, signed and unsgned
12:02:57Zevvbut not for char
12:03:08Yardanicobut you can convert char to int and back
12:03:11Yardanicono need for unsafe casti
12:03:12Yardanicong
12:03:30Yardanicochr(ord('a') + 3)
12:04:37FromDiscord<lilah ▸ 🎀> thanks! :)
12:05:18FromDiscord<lilah ▸ 🎀> that works
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:44*supakeen joined #nim
12:11:31FromDiscord<Shucks> Guess I just check every pointer seperately then huh
12:13:23FromDiscord<Shucks> Oh wait
12:15:34*lritter joined #nim
12:16:15FromDiscord<Shucks> https://play.nim-lang.org/#ix=2qiH
12:16:32Yardanicoyeah that will work
12:18:16FromDiscord<Shucks> btw. we don't got that built in right? https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-isbadreadptr
12:19:34Yardanicoгрр тщ
12:19:36Yardanicouhh no*
12:19:38Yardanico" This function is obsolete and should not be used. Despite its name, it does not guarantee that the pointer is valid or that the memory pointed to is safe to use. For more information, see Remarks on this page."
12:20:31FromDiscord<Rika> thonk
12:26:55*marnix joined #nim
12:46:23FromGitter<gogolxdong> @Zevv, Synthesis seems not right about phase transition.
13:02:52FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ef7437b3a0d3931fab8f164]
13:06:58FromDiscord<mratsim> uh
13:07:04FromDiscord<mratsim> that seems very strange
13:08:03*dddddd joined #nim
13:08:18FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2qiR
13:08:50FromDiscord<mratsim> did you run the full example in examples?
13:12:37*yc44 joined #nim
13:13:43FromGitter<gogolxdong> works now, have no idea where went wrong .
13:17:23*yc44 quit (Remote host closed the connection)
13:18:18*nsf quit (Quit: WeeChat 2.8)
13:24:24FromGitter<gogolxdong> seems the example in README.md is different from the one from example directory.
13:26:32*endragor joined #nim
13:29:28*vsantana quit (Quit: leaving)
13:33:54*endragor quit (Ping timeout: 240 seconds)
13:34:55*haxscramper joined #nim
13:37:09*endragor joined #nim
13:38:49*endragor quit (Remote host closed the connection)
13:38:58*endragor joined #nim
13:41:32*PMunch quit (Quit: leaving)
13:44:59*fredrikhr quit (Read error: Connection reset by peer)
13:48:56*fredrikhr joined #nim
13:49:48haxscramperThe only way to profile nim compilation (macro execution time) is to add `cpuTime` everywhere, correct? Is there any wrapper for this or I will have to just do it manually?
13:54:46*kenran joined #nim
13:56:22*kenran quit (Client Quit)
13:56:46*kenran joined #nim
13:57:04*kenran quit (Client Quit)
13:57:35*kenran joined #nim
13:58:22*kenran quit (Client Quit)
13:59:13*kenran joined #nim
13:59:59*kenran quit (Client Quit)
14:00:44*kenran joined #nim
14:00:55*kenran quit (Client Quit)
14:03:47*Senny joined #nim
14:05:44FromDiscord<Technisha Circuit> > Okay, using Nimpy, is there a way to have my procs from Nim (with the exportpy pragma) carry over to the `pyBuiltinsModule().exec` function?↵Anyone? :P
14:08:14FromDiscord<Vindaar> @treeform are you around?
14:09:00FromDiscord<Vindaar> @Technisha Circuit Hmm, I'm not quite sure I understand what you mean
14:11:01*marnix quit (Ping timeout: 264 seconds)
14:12:10FromDiscord<Technisha Circuit> I want to use pyBuiltinsModule().exec in Nim, but i need to be able to use my Nim functions with the exportpy Pragma
14:14:46FromDiscord<Vindaar> exec is like eval except it doesn't return the return value, right?
14:15:20FromDiscord<Vindaar> so you want to write a Nim program in which you use declare some proc using `exportpy` and then call said proc from the same program with `pyBuiltinsModule.exec`?
14:15:39*tane joined #nim
14:22:11*marnix joined #nim
14:25:05*audiophile joined #nim
14:25:12audiophiledom96 when did you start programming?
14:25:25audiophileor rather, start to learn
14:27:41FromDiscord<Rika> long time no see (i think) audiophile
14:27:58audiophilehullloooo
14:28:02audiophilelife happened!
14:28:09audiophilewhat's up with you Rika ^_^_
14:29:48FromDiscord<Rika> what is up with me?
14:29:58FromDiscord<Rika> (whats up with you has a negative implication)
14:30:07FromDiscord<Rika> i know what you meant was "what's up"
14:30:15FromDiscord<Rika> just saying for info if you needed it
14:30:38audiophilewait what
14:30:40FromDiscord<Rika> anyway i am trying to figure out why i'm getting an "Address already in use" when the port is unused...
14:30:48audiophileok 'sup
14:30:55audiophileis that better
14:31:44FromDiscord<Rika> T_T sorry i just want to make sure you dont make a mistake in the future
14:31:50FromDiscord<Rika> someone might take it wrongly
14:32:06audiophileokok better not to ask people how they're doing
14:32:11audiophileez mode ¯\_(ツ)_/¯
14:32:33FromDiscord<Rika> no no, the "with you" in "whats up with you" make it sound negative to some people
14:32:36audiophilebut what you said is true, I understood that yeah
14:33:26FromDiscord<Rika> sorry
14:33:39audiophilenono thanks for informing me, English is not my first language
14:33:55audiophileit is good to know different interpretations
14:34:37FromDiscord<Rika> i think its more common for younger people to interpret that negatively
14:35:13FromDiscord<Rika> anyway the address in use thing, i cant figure it out
14:35:51FromDiscord<Rika> here's what the error + a netstat looks like https://media.discordapp.net/attachments/371759389889003532/726445690992984114/unknown.png
14:36:33haxscramperHow do I append text to file at compile time? I can do `writeFile` but there is no `appendFile`.
14:37:20audiophilesorry, I don't know much about that but is that solarized-dark
14:37:30FromDiscord<Rika> yes it is
14:37:34FromDiscord<Rika> i use solarized, so?
14:37:48FromDiscord<Rika> smh people be judging my color theme even if i dont mention it
14:37:52audiophileomg
14:37:59audiophileI just asked because I recognized it
14:38:08audiophileyou dont have to interpret everything someone says in a negative like mkay?
14:38:15FromDiscord<Rika> haxscramper: open(file, fmappend)?
14:38:24audiophileI use it too smh
14:38:33FromDiscord<Rika> audiophile: sorry, people judged me heavily (but jokingly) in nim offtopic
14:38:44FromDiscord<Rika> still kinda recovering from that
14:39:08audiophileokok nw, I too use that theme along with ayu in my setup, that's why I wanted to confirm
14:39:19FromDiscord<Vindaar> @haxscramper I could be mistaken, but I don't think that's possible
14:39:22*sz0 quit (Quit: Connection closed for inactivity)
14:39:47FromDiscord<Rika> cant you do a `let file = open(filename, fmappend); file.write(contents); file.close()`?
14:39:52FromDiscord<Rika> would that not work
14:39:59FromDiscord<Vindaar> no, can't use that at compile tiem
14:40:00FromDiscord<Vindaar> *time
14:40:13FromDiscord<Rika> ah, why'd he mention writefile then
14:40:16FromDiscord<Rika> does that work on compile time
14:40:23FromDiscord<Vindaar> because `writeFile` works at compile time 😉
14:40:50haxscramperRika: `cannot 'importc' variable at compile time; fopen`. But! `writeFile` implementation uses exactly the same code and no 'magic'.
14:40:57FromDiscord<Rika> i dont see code in `writeFile` that doesnt
14:40:58FromDiscord<Rika> yeah
14:41:01FromDiscord<Rika> i was gonna say
14:41:17FromDiscord<Rika> what does the benign pragma do...
14:41:27haxscramperBut simply copy-pasting code gave the same error.
14:41:51FromDiscord<Rika> maybe its the benign pragma as ive said
14:41:53FromDiscord<Rika> i wonder
14:42:48audiophilecan someone explain or point me to resources on why style insensitivity is good? genuinely curious - if I get code from someone else using a different convention, is it okay for me to lint it according to my style and then send it back to them under the assumption that their linter will fix it for them (linter + formatter I mean)
14:43:19FromDiscord<Vindaar> the `writeFile` that's used at compile time isn't the one in the `io` module
14:44:44FromDiscord<Vindaar> I'm not too familiar with the compiler / vm, but I think the vm is wrapping `writeFile` here: https://github.com/nim-lang/Nim/blob/devel/compiler/vmops.nim#L181
14:45:06FromDiscord<Vindaar> so if you add your own proc there and recompile the compiler it might work 😉
14:46:21FromDiscord<Rika> (glhf)
14:47:29FromDiscord<Technisha Circuit> > exec is like eval except it doesn't return the return value, right?↵Not exactly, basically exec allows all types of code, but doesn't return anything, but eval only supports stuff to be evaluated, not executed↵> so you want to write a Nim program in which you use declare some proc using `exportpy` and then call said proc from the same program with `pyBuiltinsModule.exec`?↵I've tried that, it hasn't worked
14:48:30FromDiscord<Technisha Circuit> It won't recognise the proc in the exec function
14:49:40FromDiscord<Vindaar> I'm not too versed in python to know the difference between being evaluated and executed, tbh. Is it just single expression + return value vs arbitrary python code consisting of multiple expressions?↵Well, I didn't really propose how to do it, just asking what you're trying
14:51:08FromDiscord<Technisha Circuit> Yup
14:51:16FromDiscord<Technisha Circuit> https://hastebin.com/litogevaji.nim https://media.discordapp.net/attachments/371759389889003532/726449570933899274/Screenshot_20200627_155040_com.termux.jpg
14:51:29FromDiscord<Technisha Circuit> This is my code btw and anything returned from it
14:51:55FromDiscord<Technisha Circuit> sent a code paste, see https://play.nim-lang.org/#ix=2qjl
14:51:59FromDiscord<Technisha Circuit> That's the error when it's ran
14:52:23*audiophile_ joined #nim
14:52:42*endragor quit (Remote host closed the connection)
14:53:11FromDiscord<Vindaar> I'm not quite sure I understand what you want. If you're still within Nim, you can just call the nim code as nim code. Obviously no need to execute via python
14:53:20ForumUpdaterBotNew thread by Adnan: How to use inheritance?, see https://forum.nim-lang.org/t/6498
14:53:47FromDiscord<Vindaar> if for some reason you want to do that, you need to be aware that 1. python has to import the module containing the exported nim proc and 2. namespace it correctly
14:53:59FromDiscord<Vindaar> but I'm not sure if this can work at all in one nim module
14:54:59FromDiscord<Technisha Circuit> I want to call it within pyBuiltinsModule().exec because I'm using a python lib that doesn't work in Nimpy, but it does work in the execution function from Python
14:55:22FromDiscord<Technisha Circuit> And i want to compile this single file so it's all contained nice and neat
14:55:52*audiophile quit (Ping timeout: 256 seconds)
14:56:02*audiophile_ is now known as audiophile
14:56:19FromDiscord<Vindaar> why does the library not work in nimpy? maybe that can easily be fixed?
14:56:31FromDiscord<Technisha Circuit> Nope, it's a segfault error
14:56:44FromDiscord<Vindaar> that's weird
14:56:58FromDiscord<Technisha Circuit> So it has to be in python, then i just call some nim functions for specific parts
14:57:47FromDiscord<Vindaar> can you post somewhere more details on what's going on exactly? which module you want to call and how? otherwise I'm too confused to help
14:59:13FromDiscord<mratsim> @gogolxdong the example in the README is shortened
15:00:56*marnix quit (Quit: WeeChat 1.9.1)
15:01:04*marnix joined #nim
15:02:19FromDiscord<Technisha Circuit> I'm trying to use a library called Hata (it's a discord lib and I'm using it for testing purposes) and what i need to do is register PyObject functions, because I can't register C functions in that lib. That's what causes the segfault
15:02:39FromDiscord<Technisha Circuit> So a workaround is to use exec, but i still want to use some Nim functions for certain parts of the code
15:03:27FromDiscord<Technisha Circuit> I'm doing this for fun since i have nothing better to do
15:04:10haxscramperIs it possible to `.push/.pop` user-defined pragma? Right now I have `macro tmp ...` and `{.push tmp.}` - I'm getting error `invalid pragma: tmp`. I want to annotate lots of procs with this `pragma` and want to use `push/pop`.
15:08:14FromDiscord<Vindaar> @Technisha Circuit phew. while is sounds doable, I think I'm not really sure how I can help you 😐
15:08:57FromDiscord<Vindaar> can you give me a "working" example that produces the segfault you mention? I'm curious why that happens
15:16:42*ForumUpdaterBot quit (Remote host closed the connection)
15:17:12FromDiscord<Technisha Circuit> Okay
15:19:47Zevvhaxscramper: I have a patch to the nim compiler that adds profiling
15:22:59FromDiscord<treeform> @Vindaar are YOU around?
15:23:05FromDiscord<Vindaar> sure am
15:23:30haxscramperZevv: can you share it please?
15:23:53FromDiscord<Vindaar> so I was mainly wondering about why you decided to fork the websocket library and what the main differences are between the two. Like aside from the API being slightly different
15:24:02Zevvhaxscramper: cleaning up and rebasing
15:26:05Zevvhaxscramper: https://github.com/zevv/Nim/commits/zevv-vm-profiler
15:26:22FromDiscord<treeform> @Vindaar 1. I wanted to learn how websockets work. I really like using websockets for everything. I run into a bug in the original lib where it can't sand large payloads. I needed to send large payloads. I told the author about it and he said PRs welcome but did not fix it. I tried to fix myself - its a blocker for me - it but the code was kind of messy. So I started to clean it up. After a while I just decided to rewrite it. I think min
15:26:41Zevvhaxscramper: it's just hardcoded always on. It don't dare submitting a PR for it, it'll probably be burned down at arrival
15:26:53Zevvwhat I do is checkout the branch and do `./koch temp -d:danger`
15:27:02Zevvand then use `nim_temp` instead as `nim` for profiling
15:27:19FromDiscord<Vindaar> @treeform ah, I remember that bug. Stumbled over that myself on a project. Ok, cool that sounds good (in the sense of your code being shorter etc)
15:27:29FromDiscord<treeform> @Vindaar here was the issue that started it all: https://github.com/niv/websocket.nim/issues/18
15:27:30disbotSending data over 0x7fff bytes breaks.
15:28:33FromDiscord<Vindaar> Essentially I just wanted to hear something like this and know you'd be around supporting that library / are available if I have questions
15:28:52FromDiscord<Vindaar> Especially since the other library for some reason blocks now
15:29:06FromDiscord<treeform> Yeah I am around.
15:29:16FromDiscord<treeform> https://github.com/treeform/ws/issues
15:29:28FromDiscord<treeform> I probably will close that issue because the author is not providing more info.
15:29:41FromDiscord<treeform> No issues linger for long.
15:29:57FromDiscord<Vindaar> that's what I like to hear 🙂
15:30:11FromDiscord<Vindaar> but yeah, I've noticed before that you take care
15:30:22FromDiscord<Technisha Circuit> @Vindaar https://media.discordapp.net/attachments/371759389889003532/726459410318229645/Screenshot_20200627_162915_com.termux.jpg
15:30:48FromDiscord<Technisha Circuit> Code compiles but produces a segfault
15:31:00FromDiscord<treeform> @Vindaar I also have a CI that runs the tests on every commit.... and do releases ... you know the standard stuff.
15:31:38FromDiscord<Vindaar> @Technisha Circuit can you paste that code somewhere?↵@treeform 👌
15:31:46FromDiscord<Technisha Circuit> Sure!
15:32:04FromDiscord<Technisha Circuit> https://hastebin.com/umoyeyiyaj.nim
15:32:30FromDiscord<Technisha Circuit> I added the while true: continue line so the bot doesn't exit
15:32:40*nsf joined #nim
15:32:58FromDiscord<Technisha Circuit> Otherwise it would normally just not run at all iirc
15:33:17FromDiscord<Vindaar> I'll take a look at it in ~15 min
15:33:23FromDiscord<Technisha Circuit> Okay!
15:34:13FromDiscord<KrispPurg> I tried nim on devel branch and I keep getting appease ssl errors for some weird reason.
15:34:31FromDiscord<Technisha Circuit> Uhoh
15:36:01FromDiscord<KrispPurg> heres the error
15:36:05FromDiscord<KrispPurg> sent a code paste, see https://play.nim-lang.org/#ix=2qjt
15:39:11*Vladar joined #nim
15:39:26*marnix quit (Ping timeout: 260 seconds)
15:41:41*leorize quit (Remote host closed the connection)
15:42:08*leorize joined #nim
15:42:12haxscramperZevv: it works great, thanks a lot.
15:44:43*rockcavera joined #nim
15:45:45*pietroppeter joined #nim
15:46:04*audiophile quit (Quit: Default Quit Message)
15:49:05*marnix joined #nim
15:51:38*sz0 joined #nim
15:54:36Zevv~yw
15:54:36disbotno footnotes for `yw`. 🙁
15:54:39Zevvyw
15:54:47FromDiscord<Yardanico> ~ystream
15:54:48disbotystream: 11stream at https://www.twitch.tv/yardanico, voice chat at mumble://uberalles.mumbl.io/ -- Yardanico
15:54:52FromDiscord<Yardanico> It's still there yay
15:54:55Zevvwell, you're the third who finds it useful. Maybe I should PR it
15:56:42*marnix quit (Ping timeout: 260 seconds)
16:02:50FromDiscord<KrispPurg> anyone?
16:04:38FromDiscord<Rika> no clue, might be devel only bug
16:05:46FromDiscord<Vindaar> @Technisha Circuit the segfault simply happens, because accessing `ext` on `hata` results in nil
16:06:30FromDiscord<Technisha Circuit> oh?
16:06:53FromDiscord<Vindaar> yeah, if you want to access the `extension_loader` submodule, you can't import `hata` and then try to access it that way
16:07:06FromDiscord<Technisha Circuit> oh okay
16:07:07FromDiscord<Vindaar> I guess `hata` is similar to `scipy` for instance, where you must import different submodules
16:07:24FromDiscord<Technisha Circuit> that makes sense, thanks!
16:07:51FromDiscord<Vindaar> if you do e.g. `var hataExt = pyImport("hata.ext.extension_loader")` you can work with it
16:09:35FromDiscord<Vindaar> ah, wait. `setup_ext_commands` is part of `ext.commands` instead
16:10:16FromDiscord<Vindaar> so this "works" https://play.nim-lang.org/#ix=2ql6
16:10:28FromDiscord<Vindaar> doesn't crash at least. not sure what one does with this now of course 🙂
16:12:44haxscramperZevv: it would be very useful - AFAIK there is absolutely no way to figure out how one macro or another affects compilation time. If codebase has a lot of macros it might significantly affect build time (or just badly implemented algorithm in my case).
16:13:37FromDiscord<KrispPurg> Might as well make an issue about it
16:17:48Zevvhaxscramper: https://github.com/nim-lang/Nim/pull/14833
16:17:50disbotCrude VM profiler ; snippet at 12https://play.nim-lang.org/#ix=2ql9
16:44:18*haxscramper quit (Remote host closed the connection)
17:21:18*marnix joined #nim
17:44:01*Vladar quit (Quit: Leaving)
17:47:05FromDiscord<dponyatov> I tried to build `csources` boostrap compiler with redefined `CFLASG` with strict `-ansi` dialect, and got lot of errors. Is it important for maximum portability? It looks not a problem for compiler, but this sources were generated by generic Nim->C machanics, so how portable the generated C code on modern 1.2.4 version?
17:47:41FromDiscord<dponyatov> (edit) 'machanics,' => 'mechanics,'
17:48:45FromDiscord<dponyatov> It makes me warry about some strange targets, liek FPGA syntesised cores, and not frequently used targets such as Z80 etc
17:49:28FromDiscord<dponyatov> (edit) 'It makes me warry about some strange targets, liek FPGA syntesised cores, and not frequently used targets such as ... Z80' => 'It makes me warry about some strange targets, liek FPGA syntesised cores, and not frequently used targets such asi8080, 8086,'
17:49:59FromDiscord<dponyatov> (edit) 'warry' => 'worry' | 'liek' => 'like' | 'syntesised' => 'synthesized' | 'Z80' => 'i8080, 8086, Z80,'
17:50:24*FromDiscord quit (Remote host closed the connection)
17:50:45*FromDiscord joined #nim
17:51:40*FromDiscord quit (Remote host closed the connection)
17:51:54*FromDiscord joined #nim
17:51:54FromDiscord<Yardanico> I think Nim targets C89 mostly
17:52:31shashlickv0.6.0 of nimterop is out
17:52:44FromDiscord<Generic> isn't C on Z80 not really useable?
17:52:55FromDiscord<dponyatov> legacy hardware
17:53:18FromDiscord<dponyatov> (edit) 'hardware' => 'hardware, like old CNC machines'
17:53:36FromDiscord<Generic> I can see where Z80's are still used
17:53:48FromDiscord<dponyatov> (edit) 'hardware' => 'hardware, like old CNC machines (PCB multispindle drill stands)'
17:53:53FromDiscord<Clyybber> @dponyatov What kind of errors?
17:54:00FromDiscord<Clyybber> If its the overflow check ones thats easy to fix
17:54:09FromDiscord<Generic> though I'm surprised that C is used
17:54:22FromDiscord<Generic> because I've heared the compilers are quite bad
17:54:40FromDiscord<Generic> because there are no real addressing modes
17:54:48FromDiscord<Generic> and to get fast
17:54:54FromDiscord<dponyatov> sent a code paste, see https://play.nim-lang.org/#ix=2qlu
17:55:09FromDiscord<Generic> code you need to avoid 16-bit arithmetic and stuff like that
17:55:41FromDiscord<dponyatov> addressing modes is the same as generic embedded 8/16 bit systems, but it is not RISC
17:56:16FromDiscord<dponyatov> (edit) 'it' => 'i8080-like CPUs'
17:57:06FromDiscord<Generic> I know this discussion is pretty pointless, but it interests me 🙂
17:57:09FromDiscord<dponyatov> ```↵c_code/nimbase.h:95:35: error: unknown type name ‘inline’↵ # define N_INLINE(rettype, name) inline rettype name↵```
17:57:39FromDiscord<Generic> because afaik 8080 has atleast an 8-bit alu
17:58:15FromDiscord<dponyatov> It looks I must fork if really need something strange like that 8)
17:58:52FromDiscord<Generic> what compiler do you use for this?
17:59:41FromDiscord<dponyatov> (edit) 'It looks I must fork if really need something strange like that 8) ... ' => 'It looks I must fork if really need something strange like that 8)at least hack C codegen to pure ISO/ANSI C, and fix cross-compiling quirks'
18:00:18FromDiscord<dponyatov> ``` Debian 10↵ponyatov@debian:~/Nim$ gcc --version↵gcc (Debian 8.3.0-6) 8.3.0↵```
18:01:02FromDiscord<Generic> I meant, when you target those old processors
18:01:49FromDiscord<dponyatov> oops, I forgot about Clang ability, it can provide even more with custom LLVM backend
18:02:04FromDiscord<dponyatov> (edit) 'backend' => 'backend, and east c99 without problems'
18:02:10FromDiscord<dponyatov> (edit) 'backend' => 'backend, and eats c99 without problems'
18:03:38*hyiltiz joined #nim
18:03:50FromDiscord<dponyatov> anyway, I fought with cross-mingw32 yesterday, so fork stays in mind...
18:11:50FromDiscord<Yardanico> By the way guys
18:11:59FromDiscord<Yardanico> https://github.com/github/linguist/pull/4900 got merged finally
18:12:00disbotChange Nim's colour
18:12:07FromDiscord<Yardanico> The second attempt
18:12:27FromDiscord<Yardanico> After the first merged PR was reverted because damn Dafny took a too similar colour
18:13:02hyiltizAnyone has a sudoku solver implementing Norvig's algo.?
18:14:15FromDiscord<Vindaar> @Yardanico now the waiting begins
18:14:34FromDiscord<Yardanico> Yeah
18:14:38FromDiscord<Vindaar> one day I'll wake up and be confused that all my repositories are now javascript 😛
18:14:40FromDiscord<Yardanico> Waiting for up to one month
18:14:49FromDiscord<Yardanico> @Vindaar nah
18:14:54FromDiscord<Yardanico> This one is quite different
18:14:57FromDiscord<Vindaar> haha I know
18:15:23FromDiscord<Yardanico> https://forum.nim-lang.org/t/6350#40043
18:16:11*Sembei joined #nim
18:16:17FromDiscord<InventorMatt> I am trying to write to a file and it works the first time I write to it and flush it but the second time I write to it in the exact same way I get an invalid argument error. Any ideas what could be causing this?
18:16:45FromDiscord<Yardanico> It was closed!
18:16:49FromDiscord<Yardanico> *?
18:17:30FromDiscord<InventorMatt> I don't manually close it until far later on in the script. unless it is closing itself somehow
18:17:59FromDiscord<Rika> @Yardanico WTF YOUR ICON
18:18:02FromDiscord<Rika> WHY
18:18:28FromDiscord<Yardanico> ????
18:18:45FromDiscord<Yardanico> You mean my pfp on GitHub?
18:18:51FromDiscord<Yardanico> I like that honey badger
18:21:51FromDiscord<Yardanico> Are you still sad for some unknown reason
18:21:54FromDiscord<Rika> no
18:22:01*Jesin joined #nim
18:24:10*rockcavera quit (Ping timeout: 260 seconds)
18:31:34*kenran joined #nim
18:31:35*kenran quit (Client Quit)
18:41:22*kenran joined #nim
18:48:57*rockcavera joined #nim
18:53:27*ForumUpdaterBot joined #nim
18:53:36ForumUpdaterBotNew thread by Shashlick: Nimterop release update, see https://forum.nim-lang.org/t/6499
18:55:24leorize@Yardanico so we still have to wait til next month for them to release? :P
18:55:29Yardanicoleorize: at max - yes
18:55:35Yardanicolast release aws 10 days ago
18:55:38Yardanicowas*
18:55:42Yardanicoso in next 20 days I guess
18:55:52leorizewell we should PR in a better syntax highlighting file too
18:56:17leorizeI imagine that the NimLime version they linked is dead old
18:56:28*kenran quit (Quit: leaving)
18:56:29leorize(if NimLime is still maintained, that is)
19:07:03*kenran joined #nim
19:23:01FromDiscord<Shucks> Does c2nim just fails for me there? https://paste.sh/Itc35IlU#ZHkUbh1MN3Tqpe7FJ-cDm9-0
19:23:35*MightyJoe is now known as cyraxjoe
19:24:07FromDiscord<Yardanico> hacking battlefield 1 I see 😛
19:24:14FromDiscord<Yardanico> or BF4
19:24:21FromDiscord<Yardanico> but c2nim is not perfect, yeah
19:25:09FromDiscord<Shucks> star wars 😉
19:25:42FromDiscord<Yardanico> still same engine 😛
19:25:51FromDiscord<Shucks> yups
19:27:50*marnix quit (Ping timeout: 258 seconds)
19:30:19FromDiscord<Shucks> btw. I'm not sure what I've did. But im finally able to debug libraries lol
19:31:12disruptekhaxscramper: https://github.com/disruptek/criterion
19:31:44Yardanicodisruptek: you're alive? :)
19:34:03*haxscramper joined #nim
19:36:03*Trustable joined #nim
19:38:41disruptekhaxscramper: https://github.com/disruptek/criterion
19:38:59disruptekspeak his name and he shall appear.
19:40:03FromDiscord<Technisha Circuit> > doesn't crash at least. not sure what one does with this now of course 🙂↵@Vindaar thanks!
19:41:27*marnix joined #nim
19:42:07FromDiscord<Vindaar> you're welcome!
19:42:32FromDiscord<Technisha Circuit> Client doesn't log on :/
19:46:20FromDiscord<Vindaar> but that's almost certainly an issue with the (usage of) the hata library and not nim / nimpy
19:46:31FromDiscord<Vindaar> try to get a simple example in python up and running before using nimpy for it
19:46:49FromDiscord<Technisha Circuit> Fixed my code up↵https://hastebin.com/ajehilipuv.nim
19:47:10FromDiscord<Technisha Circuit> Also, i already have made a working example in python following a structure similar to the one I'm doing in Nim
19:47:35FromDiscord<Vindaar> and there it works fine?
19:47:57FromDiscord<Technisha Circuit> In Python
19:48:01FromDiscord<Vindaar> yes
19:48:21FromDiscord<Technisha Circuit> In python, how it would be written would work
19:48:49FromDiscord<Technisha Circuit> sent a code paste, see https://play.nim-lang.org/#ix=2qm0
19:49:05*fredrikhr quit (Read error: Connection reset by peer)
19:49:33*fredrikhr joined #nim
19:49:38FromDiscord<Vindaar> can you also show your python code? makes it easier to see what's supposed to happen
19:49:43FromDiscord<Shucks> is there any difference if im using cfloat or float32?
19:49:55FromDiscord<Yardanico> yes
19:50:14FromDiscord<Yardanico> ah actually not
19:50:24FromDiscord<Recruit_main707> :p
19:50:43FromDiscord<Shucks> ;D
19:51:02FromDiscord<Yardanico> well I just checked the source
19:51:04FromDiscord<Yardanico> keyboard go brrr
19:51:11FromDiscord<Recruit_main707> Not sure if float32 directly appears as a c float in the generated code, but c doesn’t really matter usually and only about the size
19:51:18FromDiscord<Yardanico> in the binary it'll be the same
19:51:28FromDiscord<Yardanico> because the C compiler is smart enough to remove unnecessary casts
19:51:52FromDiscord<Recruit_main707> The smart way to say it ^
19:52:19leorizenot that they're smart enough to remove casts, is that they have to :P
19:52:47FromDiscord<Yardanico> well yeah
19:52:50FromDiscord<Shucks> guess all that stuff here isn't necessary then `https://github.com/nim-lang/Nim/blob/version-1-2/lib/system.nim#L1328`
19:52:57FromDiscord<Shucks> But cstring was ;o
19:52:58FromDiscord<Recruit_main707> Bc everything is an int
19:53:09FromDiscord<Yardanico> @Shucks but it'll be still nicer if you use cfloat when interfacing with C
19:55:05*fredrikhr quit (Read error: Connection reset by peer)
19:55:31*fredrikhr joined #nim
19:56:45*kenran quit (Quit: leaving)
20:03:52Yardanicobtw language-specific channels have been a partial success :P
20:03:57Yardanicowe have some discussions in the russian channel
20:04:17Yardanico(maybe the fact that I'm russian too contributes to it as well lol, since I can be quite talkative sometimes)
20:06:31FromDiscord<Recruit_main707> Spanish second most active, but way less
20:06:50*kenran joined #nim
20:09:04*nixfreak joined #nim
20:10:11nixfreakI built nim on gnu guix system I am trying to install nimlsp and get this error ... /tmp/nimble_6101/githubcom_PMunchnimlsp_#head/src/nimlsppkg/suggestlib.nim(7, 14) Error: cannot open file: /gnu/store/gy2hv90in37dprl86rphly55n1vxl8b6-nim-1.0.6/nimsuggest/nimsuggest.nim
20:10:36Yardanicothis means that nimsuggest sources were not shipped with the package
20:10:37nixfreakI build nim and use the koch tools in ~/$HOME/nim/
20:11:08nixfreakhmm I built nim from source though
20:11:38Yardanicowell then nimsuggest/nimsuggest.nim should exist
20:11:47Yardanicoif you installed the official nim way :P
20:14:05nixfreakit does in another directory
20:14:16Yardanicothen that's not the "official" way :D
20:14:22nixfreakis there a nimpath ? that I need to setup
20:14:29Yardanicohrm
20:14:39nixfreakgnu guix is a different OS
20:14:45YardanicoI know
20:14:50YardanicoI've used NixOS for a few months myself
20:15:06Yardanico(I know they're different in terms of PL and the package manager, but the core principles are the same)
20:15:16nixfreakyes
20:15:31*pietroppeter quit (Quit: Connection closed for inactivity)
20:17:06nixfreak ls -l ~/.nimble
20:17:06nixfreaktotal 876
20:17:06nixfreak-rw-r--r-- 1 nixfreak users 168 Jun 27 15:03 nimbledata.json
20:17:06nixfreak-rw-r--r-- 1 nixfreak users 445264 Jun 27 00:59 packages_official.json
20:17:06nixfreak-rw-r--r-- 1 nixfreak users 445264 Jun 27 00:59 packages_temp.json
20:17:09nixfreakdrwxr-xr-x 1 nixfreak users 84 Jun 27 15:03 pkgs/
20:17:15nixfreakthis is what I have
20:19:30*vsantana_ joined #nim
20:19:39*vsantana_ quit (Quit: Leaving...)
20:32:07FromDiscord<Technisha Circuit> > can you also show your python code? makes it easier to see what's supposed to happen↵@Vindaar sure
20:35:13*kenran quit (Quit: leaving)
20:37:53FromDiscord<KingDarBoja> U making a discord both?
20:37:56FromDiscord<KingDarBoja> (edit) 'both?' => 'bot?'
20:38:20*nixfreak quit (Quit: leaving)
20:39:16FromDiscord<Yardanico> with js backend :/
20:39:28*marnix quit (Ping timeout: 246 seconds)
20:39:38FromDiscord<Technisha Circuit> Nope
20:39:53FromDiscord<Technisha Circuit> With a python lib using Nimpy because i am stupid
20:40:53FromDiscord<KingDarBoja> I saw u on discord py
20:41:02FromDiscord<KingDarBoja> _not really, just noticed now_
20:41:34*zedeus quit (Ping timeout: 240 seconds)
20:43:41*zedeus joined #nim
20:46:33FromDiscord<Technisha Circuit> O
20:46:48FromDiscord<Technisha Circuit> I'm only using discord.py for a friend
20:47:08FromDiscord<Technisha Circuit> Otherwise, I'd use a different python lib called Hata for Python
20:59:21*NimBot joined #nim
21:02:34*FromDiscord quit (Remote host closed the connection)
21:02:48*FromDiscord joined #nim
21:03:43FromDiscord<Shucks> why not nim ;p
21:05:15FromDiscord<Technisha Circuit> For Python
21:05:21FromDiscord<Technisha Circuit> For Nim i use Dimscord
21:14:47FromGitter<deech> Is there a reason why all enum members go into the global enum namespace? I'd like some way to do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ef7b6c7405be935cdc7e623]
21:15:16FromDiscord<lqdev> @deech the convention is to prefix your enums with an abbreviation of the enum name
21:15:35FromGitter<deech> So like `E2_AA`?
21:16:07leorizeI thought Araq fixed that..
21:16:44leorizeput the `{.pure.}` pragma on to enforce qualification
21:17:15leorizeusually we prefix with an abbreviation of the enum name, but it doesn't make much sense if the enum name is that short
21:19:53FromGitter<deech> Nice, {.pure.} works! Also just recompiled with the HEAD of the compiler and it's still an error without it.
21:23:41FromDiscord<Technisha Circuit> sent a code paste, see https://play.nim-lang.org/#ix=2qmw
21:25:06FromDiscord<Technisha Circuit> I've modified the Nim code slightly
21:25:28FromDiscord<mratsim> Ahhh, spend the whole day trying to beat GCC and Clang inline assembly into submission. I won, their quirks in inline assembly syntax is so annoying
21:26:15FromDiscord<Technisha Circuit> Here is the new code https://hastebin.com/otopinucim.nin
21:26:20FromDiscord<Technisha Circuit> (edit) 'https://hastebin.com/otopinucim.nin' => 'https://hastebin.com/otopinucim.nim'
21:26:34FromDiscord<Technisha Circuit> sent a code paste, see https://play.nim-lang.org/#ix=2qmz
21:27:43FromDiscord<Technisha Circuit> Also, what's pure?
21:33:44FromDiscord<Vindaar> @Technisha Circuit gotta make some dinner & eat now. will take a look after↵@mratsim that sounds good though?
21:34:19FromDiscord<mratsim> basically this undocumented quirk: https://github.com/mratsim/finite-fields/blob/master/macro_assembler.nim#L140-L144
21:35:13FromDiscord<Technisha Circuit> > @Technisha Circuit gotta make some dinner & eat now. will take a look after↵Okay!
21:38:26*haxscramper quit (Remote host closed the connection)
21:47:47*audiophile joined #nim
21:49:01ForumUpdaterBotNew thread by Exelotl: What's the future of "implicitDeref"?, see https://forum.nim-lang.org/t/6500
21:52:31*solitudesf quit (Ping timeout: 265 seconds)
21:53:43FromDiscord<exelotl> This is the worst ligature I've ever seen in my life :') https://media.discordapp.net/attachments/371759389889003532/726555887023685652/Screenshot_from_2020-06-27_22-51-20.png
21:56:31FromDiscord<Elegant Beef> Oh god, i didnt notice it initially cause i was blind, but when i seen it...
21:57:40*nsf quit (Quit: WeeChat 2.8)
22:00:03FromDiscord<Clyybber> @exelotl I'm curious, why would you ever use ptr T over var T in the signature?
22:00:29FromDiscord<Clyybber> Just to not write [] ?
22:01:57FromDiscord<Clyybber> Because in your post you write that you actually *prefer* `m[].chooseAnim()`
22:03:15*nikita` quit (Quit: leaving)
22:05:29FromDiscord<exelotl> oh sorry I didn't mean better as in "this is a better way of doing it"
22:05:38FromDiscord<exelotl> just as in "ah.. that's better"
22:07:41FromDiscord<exelotl> but yeah I guess I'd use `ptr T` in the signature if I'm already expecting that the variable usually will be a pointer when I encounter it
22:09:30FromDiscord<exelotl> though in that case I guess it would normally be better to define a `TPtr` type, or make `T` itself a pointer type and then have a `TObj` type for the occasion when I have to work with it as a value
22:12:24FromDiscord<Clyybber> I guess you'd be better of just dereferencing it at callsite :p
22:12:38FromDiscord<Clyybber> but yeah implicitDeref is a neat feature
22:12:46*Trustable quit (Remote host closed the connection)
22:20:47*zama quit (Ping timeout: 240 seconds)
22:21:48*zama joined #nim
22:32:06FromDiscord<Technisha Circuit> :p
22:36:56federico3any help with using c2nim on multiple header files?
22:41:29*clemens3 quit (Read error: Connection reset by peer)
22:49:10audiophileanyone written ios apps using nim here?
22:49:27audiophilecan you interface with anything, including the watch api?
22:59:07*lritter quit (Ping timeout: 246 seconds)
23:04:00*lritter joined #nim
23:11:02*tane quit (Quit: Leaving)
23:16:26FromDiscord<Vindaar> sent a long message, see http://ix.io/2qnc
23:16:58FromDiscord<Vindaar> just do the whole thing in nim instead 🙂
23:17:02FromDiscord<Vindaar> more fun anyways 😛
23:26:45FromDiscord<Technisha Circuit> Actually, this lib uses it's own Async
23:26:50Yardanicowhat
23:26:50FromDiscord<Technisha Circuit> But yeah, maybe
23:27:06FromDiscord<Technisha Circuit> Yeah, the author made their own async in pure Python
23:27:13FromDiscord<Technisha Circuit> It's faster then asyncio too
23:27:28FromDiscord<Technisha Circuit> And iirc it has support for threading
23:28:21Yardanico"faster than asyncio" doubt it really
23:28:28Yardanicoor maybe if it's tailored for the exact usecase
23:28:28FromDiscord<Technisha Circuit> Try it yourself
23:28:38Yardanicobut really it seems to be quite stupid to implement your own async for the lib
23:28:51FromDiscord<Technisha Circuit> She wants the lib to be as fast as possible
23:29:28FromDiscord<Technisha Circuit> So she only has one dependancy for her lib
23:29:29FromDiscord<Vindaar> for a.... _discorcd_ lib?
23:29:29YardanicoI think you're wrong
23:29:34Yardanicoit uses python's async
23:29:36FromDiscord<Technisha Circuit> It's only Chardet
23:29:38FromDiscord<Vindaar> can't even type discord
23:29:39FromDiscord<Technisha Circuit> Well
23:30:01Yardanicowhat is this then? https://github.com/Rapptz/discord.py/blob/13a3f760e6de8aa251f06bbe2a746e5f92deafd2/discord/shard.py#L27
23:30:20FromDiscord<Technisha Circuit> I'm not talking about discord.py
23:30:31FromDiscord<Vindaar> https://github.com/HuyaneMatsu/hata
23:30:35FromDiscord<Vindaar> that's the one
23:30:36FromDiscord<Technisha Circuit> Yup
23:31:05FromDiscord<Vindaar> the acknowledgements mention based on an earlier version of asyncio though
23:31:09Yardanicowell i guess the author is too lazy to migrate
23:31:12Yardanicoto asyncio
23:31:16FromDiscord<Technisha Circuit> Only external dependancy is Chardet
23:31:23FromDiscord<Technisha Circuit> They aren't
23:31:30Yardanicoyeah I can copy all libs in my project too
23:31:33Yardanicoand say "I don't have external deps"
23:31:37FromDiscord<Technisha Circuit> It's that theirs is faster (at least in PyPi it is)
23:31:46Yardanicohow do you measure "faster" lol
23:31:48FromDiscord<Technisha Circuit> She rewritten her own though
23:31:49Yardanicoand I still doubt it as I said
23:32:00FromDiscord<Technisha Circuit> :P
23:32:01Yardanicoit might only be faster for one specific use-case
23:32:03Yardaniconot generally
23:32:10FromDiscord<Technisha Circuit> Try it and compare it maybe?
23:32:22FromDiscord<Technisha Circuit> Faster http, async, and websockets in general
23:32:23Yardanicoso you're saying all core python devs are more stupid than this single person? :)
23:32:25FromDiscord<Vindaar> but in any case, this makes compatibility with nimpy even harder (:
23:32:29FromDiscord<Technisha Circuit> Even made a websocket server
23:32:32Yardanicoso they can't make async as fast as this person did
23:32:39FromDiscord<Technisha Circuit> > so you're saying all core python devs are more stupid than this single person? :)↵Not at all
23:32:46Yardanicoand why this person didn't try to PR their changes to python itself?
23:32:59Yardanicoanyway let's move to #nim-offtopic
23:33:07FromDiscord<Technisha Circuit> It's faster in PyPi definitel, not sure about CPython
23:33:09FromDiscord<Technisha Circuit> Sure
23:39:08*krux02_ joined #nim
23:42:48*krux02 quit (Ping timeout: 256 seconds)
23:51:57shashlick@federico3 what you wrapping