<< 23-03-2020 >>

00:02:34FromDiscord<Tristan> nevermind, just saw the `ord` keyword.
00:07:53Yardanico@Tristan if you're actually translating it into proper Nim code, you would use something like a set of enum type
00:08:11Yardanico(in C with ORing enum values people usually specify more than 1 enum value)
00:08:36leorizeyep, sets are the way to go when translating to Nim
00:08:47leorizemuch simpler and more flexible
00:09:56disrupteqsets my loins a quiverin'.
00:12:21*rnrwashere quit (Remote host closed the connection)
00:12:38*rnrwashere joined #nim
00:14:29FromDiscord<Simula> is there a way to pass an empty seq to a proc that expects a `seq[string]`?
00:15:08Yardanicomyproc(@[])
00:15:42Yardanicoah sorry
00:15:55FromDiscord<Simula> `Error: type mismatch: got <seq[empty]>`
00:16:16Yardanicoeither pass newSeq[string]() or create it like "var data: seq[string]" and pass that
00:16:30Yardanicowhy not have a default value for that seq though?
00:16:56FromDiscord<Simula> it's a seq of error strings. i'm overloading the proc for when there are errors and also no errors
00:17:18Yardanicowell, seq is a runtime thing, maybe you want arrays?
00:17:56FromDiscord<Simula> this is a runtime thing :P
00:18:01FromDiscord<Simula> it's validating html forms
00:18:15FromDiscord<Simula> unless i misunderstand
00:18:33Yardanicoah, then seqs are fine, I just mistunderstood your "overloading" thing :P
00:18:43YardanicoI thought you're actually overloading the proc with different implementations
00:19:35FromDiscord<Simula> nope. the overload just calls the original with an empty seq
00:19:59Yardanicowell I just meant that you can provide the default value for your proc to be an empty seq
00:20:02Yardanicoproc myproc(a: seq[string] = @[])
00:20:13Yardanicoso when you call it like myproc() it uses an empty seq
00:21:27FromDiscord<Simula> oh duh, just saw that lol
00:23:22krux02Simula: myProc((seq[string])@[])
00:23:29krux02Simula: myProc(seq[string](@[]))
00:25:36Yardanicotoo lispy :P
00:37:50*krux02_ joined #nim
00:40:22*krux02 quit (Ping timeout: 246 seconds)
00:53:24*rnrwashere quit (Remote host closed the connection)
01:04:15*Guest67311 quit (Ping timeout: 250 seconds)
01:11:23*enthus1ast joined #nim
01:11:37*sealmove joined #nim
01:12:59*disrupteq quit (Ping timeout: 246 seconds)
01:26:59*SenasOzys quit (Remote host closed the connection)
01:38:42*dadada joined #nim
01:39:06*dadada is now known as Guest36417
01:39:14*dwdv quit (Ping timeout: 246 seconds)
01:57:10*Guest36417 quit (Ping timeout: 250 seconds)
02:04:01*dadada joined #nim
02:04:24*dadada is now known as Guest54744
02:14:10*rnrwashere joined #nim
02:14:32*disrupteq joined #nim
02:15:56*enthus1ast quit (Ping timeout: 240 seconds)
02:27:16*Guest54744 quit (Ping timeout: 256 seconds)
02:33:59*dadada__ joined #nim
02:34:18*chemist69_ joined #nim
02:36:54*chemist69 quit (Ping timeout: 240 seconds)
02:37:50*rnrwashere quit (Remote host closed the connection)
02:39:05*rnrwashere joined #nim
02:53:54*disrupteq quit (Quit: Lost terminal)
02:55:23*opal quit (Ping timeout: 240 seconds)
02:57:24*dadada__ quit (Ping timeout: 250 seconds)
02:59:34*opal joined #nim
03:00:26*ehmry quit (Ping timeout: 246 seconds)
03:04:02*dadada joined #nim
03:04:04*ehmry joined #nim
03:04:25*dadada is now known as Guest26181
03:17:16*endragor joined #nim
03:27:44*Guest26181 quit (Ping timeout: 246 seconds)
03:31:10*krux02_ quit (Remote host closed the connection)
03:34:04*dadada__ joined #nim
03:37:27FromDiscord<Winton> https://mega.nz/#F!4xNjBCYK!ebtr4LFxe3Ilssh1Z-4mgQ!M4kXBCyC who is encouraged to create an emulator server
03:37:53FromDiscord<Winton> transcribe this code from java to nim
03:49:57FromDiscord<Bawbby> what is this zcore?
03:55:52FromDiscord<Winton> > what is this zcore?
03:55:53FromDiscord<Winton> @Bawbby is an emulator created in Java, for a 2D MMORPG game based on Flash Player
03:56:01*muffindrake quit (Ping timeout: 246 seconds)
03:56:32FromDiscord<Winton> really this emulator is version 2 there are other versions 3 created in C # and JS
03:57:22*dadada__ quit (Ping timeout: 256 seconds)
03:57:52FromDiscord<Winton>
03:57:52FromDiscord<Winton> https://cdn.discordapp.com/attachments/371759389889003532/691495905207123979/79100511_104293074400117_1801959606415523840_n.png
03:58:19*muffindrake joined #nim
04:02:30FromDiscord<Bawbby> is there a project page for this somewhere?
04:04:04*dadada joined #nim
04:04:27*dadada is now known as Guest70543
04:06:22FromDiscord<Winton> yes
04:06:45FromDiscord<Winton> > is there a project page for this somewhere?
04:06:45FromDiscord<Winton> @Bawbby https://www.facebook.com/EternityLandsPS
04:08:31FromDiscord<Winton> https://github.com/thalysmarciobn/AQWorlds-Emulator
04:09:12FromDiscord<Winton> this is a half-discontinued project since they migrated it to C#
04:18:36*bgammill joined #nim
04:18:40bgammillhi all
04:27:49*Guest70543 quit (Ping timeout: 264 seconds)
04:33:10*sleepyqt joined #nim
04:34:06*dadada__ joined #nim
04:34:15*nsf joined #nim
04:39:27FromDiscord<Winton> Hi πŸ˜„
04:49:27*rnrwashere quit (Remote host closed the connection)
04:57:23*dadada__ quit (Ping timeout: 250 seconds)
05:04:09*dadada joined #nim
05:04:33*dadada is now known as Guest72832
05:06:36*rockcavera quit (Remote host closed the connection)
05:09:40*bgammill quit (Quit: leaving)
05:25:29*rnrwashere joined #nim
05:27:43*Guest72832 quit (Ping timeout: 250 seconds)
05:30:18*rnrwashere quit (Ping timeout: 256 seconds)
05:34:03*dadada__ joined #nim
05:34:21*NimBot joined #nim
05:42:03FromGitter<awr1> hello
05:57:11*dadada__ quit (Ping timeout: 250 seconds)
06:02:00*andinus joined #nim
06:04:07*dadada joined #nim
06:04:30*dadada is now known as Guest22694
06:19:53*narimiran joined #nim
06:27:34*Guest22694 quit (Ping timeout: 240 seconds)
06:33:03FromGitter<gogolxdong> full stack Nim project has been launched http://cloudfastnet.com/
06:33:46FromGitter<gogolxdong> [email protected] / test for testing
06:34:02*dadada__ joined #nim
06:37:15FromGitter<gogolxdong> There is 21944 loc in HTML+ php for the original project, and 7357 loc in Nim for now.
06:37:54*endragor quit (Remote host closed the connection)
06:38:07*silvernode joined #nim
06:38:12silvernodeHow is everyone?
06:38:54silvernodeI am still working on my space game, I made some more progress yesterday with the help of a friend.
06:47:55*endragor joined #nim
06:49:13leorizegogolxdong: it looks nice, was it made with karax?
06:50:47FromGitter<gogolxdong> karax + prologue
06:53:54*silvernode quit (Ping timeout: 265 seconds)
06:57:46*dadada__ quit (Ping timeout: 265 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:03:59*dadada joined #nim
07:04:24*dadada is now known as Guest67294
07:05:17*gmpreussner joined #nim
07:10:17Guest67294gogolxdong: Nim is reducing the loc for you? nice :-)
07:10:36*Guest67294 is now known as dadada
07:13:29euantorleorize: perfect, thanks
07:42:04FromDiscord<Benumbed> GDIT, the AMQP spec has as self-referential data structure which is making my life a living hell trying to map it out in Nim
07:43:22leorizeself referential? wdym?
07:44:04FromDiscord<Benumbed> let me paste this crazy into something, sec
07:44:39FromDiscord<Benumbed> https://play.nim-lang.org/#ix=2f1X
07:45:12FromDiscord<Benumbed> Notice how `FieldTableValue` has a field named `tableVal` which has a type of `FieldTable`
07:45:21FromDiscord<Benumbed> (near the bottom of `FieldTableValue`
07:45:47FromDiscord<Benumbed> FieldTable is an OrderedTable whose keys are `FieldTableValue` type
07:46:01FromDiscord<Benumbed> because AMQP specifies that field-tables can contain field-tables
07:46:18FromDiscord<Benumbed> Maybe I have just overthought my way into a corner
07:47:38FromDiscord<Benumbed> And I have tried to forward declare `FieldTableValue` but that doesn't work, I think because forward decls don't work with recursive structures in Nim
07:47:45FromDiscord<Benumbed> (I read something like that in the manual I think?)
07:50:06sealmovethis is not a problem in general in nim
07:50:10sealmovejust use ref
07:51:16FromDiscord<Benumbed> Sorry, it's late here and I'm tired, can you expand a bit on what you mean by use ref?
07:52:46sealmoveoh well, for starters use one type section
07:52:55sealmovetype
07:53:07sealmove FieldTable* = ref OrderedTable[string, FieldTableValue]
07:53:17sealmove FieldTableValue* = ref object
07:53:54sealmoveyou need to use one type section when doing self-referential structures
07:54:08FromDiscord<Benumbed> I completely forgot you can nest multiple typedefs under the type keyword... *facepalm*
07:54:22leorizesealmove: use OrderedTableRef :P
07:54:44*PMunch joined #nim
07:55:07FromDiscord<Benumbed> Thank you sealmove, I was losing my mind over here
07:55:11sealmovenp
08:05:32*Vladar joined #nim
08:16:40*Zevv left #nim (#nim)
08:22:45*dddddd quit (Remote host closed the connection)
08:42:16PMunchHaha, someone opened a "Thank you" issue in my termstyle repo :)
08:46:20FromGitter<Vindaar> <3
08:51:53*couven92 joined #nim
09:21:53*krux02 joined #nim
09:31:24*pbb quit (Ping timeout: 246 seconds)
09:35:59FromGitter<alehander92> morning
09:44:30PMunchMorning
09:55:28*pbb joined #nim
09:57:53FromDiscord<Lantos> morning
10:04:43*clemens3 quit (Quit: quit)
10:06:20*clemens3 joined #nim
10:07:24*dadada quit (Ping timeout: 256 seconds)
10:08:44*andinus quit (Quit: ERC (IRC client for Emacs 26.3))
10:12:00*dadada joined #nim
10:12:24*dadada is now known as Guest34231
10:13:51*Guest34231 is now known as dadada
10:16:27*dwdv joined #nim
10:44:00dadadashould deepCopy work inside a macro? I'm not using it to copy a NimNode (where I would use copy()), but for something else and I get Error: cannot generate code for: mDeepCopy
10:44:12Araquse copyTree() instead
10:47:37dadadado you mean copyNimTree() there's no copyTree() showing up in the documentation's search, and may I remind you what I want to copy IS NOT a NimNode, but a custom ref object
10:52:17Araqoh ok
10:55:47dadadaAraq: much like this: https://play.nim-lang.org/#ix=2f2l
11:00:27Araqdon't use 'ref object' then if you don't want ref semantics
11:00:54Araqor use: var copy = newT(); copy[] = orig[]
11:05:13PMunchWhat's the best RSA library for Nim atm?
11:05:33dadadaok, I already had a manual copy proc as workaround in place, but then learned about deepCopy, so wanted to use the more idiomatic solution (which I thought deepCopy to be), now that I learned that deepCopy doesn't work in macros, I'm going back to my earlier solution... But still, I'm curious why it doesn't work
11:07:23AraqdeepCopy is for "Pass value over to different thread"
11:07:44Araqsince the VM doesn't support threads, it never supported deepCopy either
11:11:02*clyybber joined #nim
11:17:07krux02Araq: regarding the the revert of my pr https://github.com/nim-lang/Nim/pull/13712
11:17:08disbotβž₯ fix #13417
11:17:55krux02it would have been nicer if you would have complained about it in the review process that the copy isn't acceptable. After all I even marked it in a comment in the code that you saw.
11:18:50krux02That is the comment I am talking about: # arrays will deep copy here (pretty bad).
11:22:18Araqkrux02, I regard as "not even bothering krux02" as nice
11:22:34AraqI saw the comment but wasn't aware of its implications
11:22:47AraqI thought only edge cases are affected
11:22:55krux02well yes
11:23:01Araqand today is release day so I'm rushing it
11:23:02krux02the regression is a constructed edge case
11:23:15Araqas I still know no other way of how to do a release
11:23:35Araq:-P
11:24:02Araqclyybber, your templates are the bomb
11:24:09krux02well I can open you a performance regression that was introduced by reverting my PR.
11:24:31krux02you want that?
11:24:38dadadayeah, release day! :P thanks Araq for all the work you do
11:24:55Araqno, I want a decent fix, krux02 but not for 1.2.
11:25:09krux02what do you see as a decent fix.
11:25:21Araqfirst class open array support for temporaries
11:26:20Araqalternatively an optimization in the backend so that it takes address of arrays instead of copying them around
11:26:36Araqwould have helped for our base64 fixes too
11:27:33dadadaAraq: which clyybber templates are the bomb?
11:27:38krux02Well, you can contract me to do it. I am offering you to do it. Not for free though.
11:28:17Araqthe one in injectdestructor.nim, dadada, can't replace them with a proc and get the same logic
11:29:01dadadawe need a curated list somewhere of the best nim modules/templates/macros, so that it's easier for people (especially those new to Nim) to find, learn and use them
11:29:33krux02https://github.com/VPashkov/awesome-nim
11:29:37Araqkrux02, I lack the money, we can put bounties on it though
11:29:39krux02first list I found
11:30:13krux02After all I spok with zahary at fosdem, he said the payment just continued.
11:30:29krux02so you should be able to pay me.
11:31:27clyybberAraq: Which templates?
11:32:12PMunchNo one have any suggestions for RSA libraries?
11:32:47clyybberOh, seen the answer now
11:32:54clyybberThanks :)
11:32:56krux02dadada, the curated list I just set you is probably outdated and not the best. But it is a start.
11:33:05FromGitter<sheerluck> a release day! a release day!
11:34:09krux02I think nim-awesome should be forked to github.com/nim-lang to make it more official.
11:34:51dadadakrux02: thanks, there's also https://github.com/nim-lang/Nim/wiki/Curated-Packages
11:34:58FromDiscord<Recruit_main707> hello, let me explain the situation, there is a community for creating rocket league bots, (as i have mentioned here before), and i made some python intermediate bridge to connect Nim (and any executable really) to the game, and i was wondering if it is worth it getting it into nimble, (because you need to have rocket league installed to use it) what do you think?
11:36:05FromDiscord<Recruit_main707> (not only the python bridge, but the tiny framework i made in Nim for connecting to it and sending receiving data)
11:36:18PMunchSure, why not
11:37:16FromDiscord<Recruit_main707> its just that if there is no one to use it (which is probably the situation) i can avoid having to do it :p
11:37:23jkenAnyone here good with opengl and willing to tell me where I am going wrong setting up glVertexAttribPointer for my vertex data?
11:37:24krux02Recruit_main707: How does it work. Does rocket league have any robot interface? is it a hack to read values out of the running executable? Or is it hard screen reading with image recognition?
11:37:43FromDiscord<Rika> i have a feeling its the middle one
11:38:26FromDiscord<Recruit_main707> krux02, at first the community started with reading values, but we actually got psyonix to support us officially and now the framework comes with rocket league
11:38:31krux02Could be fun to program a team of rocket league players.
11:38:46FromDiscord<Recruit_main707> its only offline though
11:38:48FromDiscord<Rika> oh wow so its both the 1st and middle
11:38:59FromDiscord<Rika> why the python bridge though
11:39:37FromDiscord<Recruit_main707> bc they only support certain languages officially and i have no experience with flatbuffers (nor any faster language to develop the bridge)
11:39:41krux02you don't need to be online to let AI play against each other if you can download other people's AI from the internet.
11:40:13FromDiscord<Rika> time to deconstruct the python library then πŸ˜›
11:40:16FromDiscord<Recruit_main707> ye, ofc, they have a cool gui with a bunch of bots by "default"
11:41:00krux02I really thik AI programming is interesting.
11:41:04FromDiscord<Recruit_main707> https://tenor.com/view/it-just-works-tod-todd-howard-%d1%82%d0%be%d0%b4%d0%b4%d0%b3%d0%be%d0%b2%d0%b0%d1%80%d0%b4-fallout-skyrim-gif-14803660
11:42:17FromDiscord<Recruit_main707> krux02: for now, most bots (and best ones) are hardcoded, but people are trying to use ML too
11:42:53FromGitter<sheerluck> Recruit_main707 there's russian chars in your url
11:43:05jkenThis isn't runnable, but the important bits are here. Anyone see my flaw? https://play.nim-lang.org/#ix=2f2y
11:43:18krux02yea I think hardcodod bots can always be defeated by finding a weakness/exploat in the strategy.
11:43:32jkenI think my stride and offset calculations for glVertexAttribArray are wrong but I can't figure out why
11:44:03krux02jken, they are always wrong, because that is a very error prone process.
11:44:48krux02That is why I wrote my project here: https://github.com/krux02/opengl-sandbox
11:45:01krux02never ever write glVertexattribArray manually anymore.
11:45:12krux02just feed it typed object and it will work.
11:45:54jkenI am not sure what you mean by that krux02, could you elaborate?
11:46:34krux02I wrote a project because I didn't like the error prone-ness of glVertexAttribArray and other low level opengl functions.
11:47:00krux02they are low level, but they also expect you to set a lot of parameters correctly. A job that could be done easily by a human.
11:47:12krux02But I also didn't want to use a game engine.
11:47:28krux02I thought game engines are too restrictive
11:48:10krux02sorry I mean "A job that could be done easily by a computer. It is very error prone when a human does it.
11:48:46krux02So I tried to figure out how these parameters could be automatically infered by the context and types.
11:49:04krux02just rinse and repead and this is what I ended up with: https://github.com/krux02/opengl-sandbox/blob/master/examples/hello_shapes.nim
11:50:28krux02here is an example of how I call a shader program: https://github.com/krux02/opengl-sandbox/blob/master/examples/hello_shapes.nim#L210
11:51:39krux02paremeters like vertexOffset and baseVertex are still set explicitly, since I wanted to experiment with a single buffer for all meshes.
11:52:08krux02(that part might be automated at some point too)
11:53:47krux02and if you look in the attributes block, where I set a_vertex a_normal a_color, this block enables all attributes, provides attribute input variables in the shader, passes the attributes to the shader and tells opengl how to treat the input data.
11:54:07krux02like I said, never ever call glVertexattribArray manually again
11:54:35jkenlooks like i have alot to learn
11:54:54krux02this project is maximum metaprogramming in Nim.
11:55:20krux02But I really have to reactivate it. I didn't touch it for quite some time, because I was too busy in working on the Nim compiler.
11:56:55krux02this project is the reason I even started to learn Nim. It would simply not be possible in other programming languages.
11:57:19dadadasince you seem to be an expert in this domain krux02, why would you use OpenGL over Vulkan for new projects?
11:57:31Yardanicowell Vulkan seems to be much more verbose :P
11:59:17krux02for me, OpenGL is just what I know better.
11:59:46krux02but there are good reasons to take OpenGL over Vulkan.
12:00:09krux02I can write you a hello triangle in basically 5 lines of code in OpenGL 1.0.
12:01:10krux02The fixed function pipeline of OpenGL 1.0 is really great for individuals to get something to the screen without too much hassle in any direction.
12:02:10krux02Yea, it is marked as "deprecated", but it is well specified, breadly implemented, and a lot of code relies on its existence. In other words, it won't go away.
12:02:40Yardanicowell yeah, there's already a OpenGL->Vulkan implementation being worked on in Mesa
12:02:42krux02Not saying immediate mode is "fast", I am just saying you get things faster done.
12:02:54krux02Yardanico, yes
12:02:54Yardanicoso even after vendors stop implementing OpenGL it'll be supported :P
12:03:10krux02yes
12:03:16Araqif OSX deprecates OpenGL they might remove it some day. Not saying that's a good thing
12:03:19krux02it will probably the other way araoud
12:03:40Araqbut operating systems are not required to implement "standard X" at all, that's not how it works
12:04:02Yardanicothere's already MoltenVK for Metal->Vulkan, and MoltenGL too (but it's proprietary)
12:04:09FromDiscord<Generic> I really dislike the opengl api with all of this binding stuff, it makes some many thing so cumbersome
12:04:17Yardanicoand MoltenGL is for OpenGL ES though
12:04:33krux02on OSX your choice is OpenGL from 10 years ago, or proprietary Metal (not Vulkan).
12:05:07krux02yea this binding in OpenGL is horrible.
12:05:27Yardanicowell MoltenVK works "quite well" so that you can even play Vulkan games :P or even play windows DX9/10/11 games with DXVK (DirectX) -> Vulkan -> Metal
12:05:45clyybbervulkan is awesome
12:06:03krux02as far as I know MoltenVK isn't a full Vulkan implementation, because Metal doesn't support it.
12:06:06clyybberquite verbose but a much better debugging experience compared to opengl
12:06:06FromDiscord<Recruit_main707> no nim vulkan yet right?
12:06:13Yardanicothere are libs for vulkan in nim
12:06:16Yardanicobut they're bindings mostly
12:06:19clyybberRecruit_main707: I made bindings
12:06:25clyybberAnd I'm making an engine
12:06:27jkenturns out all my troubles were because my Vertex type was a ref object
12:06:36krux02bindings should not be a problem.
12:06:52Yardanico@Recruit_main707 when you want to find something implemented in Nim, search for it like that: https://github.com/search?q=language%3Anim+vulkan
12:07:39FromDiscord<Recruit_main707> cool, can i download them with nimble?
12:07:50Yardanicowell yeah, ofc
12:07:58Yardanicomost nim projects have a .nimble file, but not all :P
12:08:05FromDiscord<Recruit_main707> nice
12:08:15Yardanicoclyybber's one doesn't, but you can just copy that single vulkan.nim file in your project
12:08:48FromDiscord<Recruit_main707> thats enough
12:08:57YardanicoNimGL seems to have Vulkan bindings too - https://github.com/nimgl/nimgl/blob/master/src/nimgl/vulkan.nim
12:10:11clyybberOh, yeah
12:10:17clyybberDo you need nimble?
12:10:26clyybberI should probably publish it..
12:10:59FromDiscord<Recruit_main707> me? i personally dont if its just one file, but it would be nice to have it in nimble nevertheless
12:11:35clyybberyeah
12:27:15*rockcavera joined #nim
12:40:47clyybberAraq: Should we maybe mark byaddr and thinout as experimental?
12:41:01clyybberSo as to reserve the right to remove them
12:42:07*dadada quit (Ping timeout: 256 seconds)
12:47:00Araqthinout is opt-in via -d:nimThinout
12:47:17Araqand byaddr is a separate 'std' import
12:47:26Araqand 'std' is really 'experimental'
12:47:28Araq:D
12:48:52*dadada joined #nim
12:49:15*dadada is now known as Guest25620
12:51:08FromDiscord<Rika> so `monotimes` is experimental?
12:52:19PMunchWhat is thinout?
12:55:23*sleepyqt_ joined #nim
12:57:56*lritter joined #nim
12:58:47AraqRika: no.
12:59:01*sleepyqt quit (Ping timeout: 264 seconds)
12:59:15AraqI wasn't entirely serious but new modules start in std/ so that you don't have to update your import paths as they ripe
12:59:55clyybberOk, cool
13:01:39FromDiscord<Rika> i see
13:02:47*Kaivo joined #nim
13:03:10*noonien quit (Quit: Connection closed for inactivity)
13:11:48*dddddd joined #nim
13:17:40*rnrwashere joined #nim
13:21:50*rnrwashere quit (Ping timeout: 250 seconds)
13:42:36*zacharycarter joined #nim
13:48:39FromDiscord<Generic> does byaddr work with the js backend?
14:01:42FromDiscord<Recruit_main707> i dont think so
14:01:58FromDiscord<Rika> is there a reason the `do:` syntax is totally undocumented
14:02:40Yardanicoit is? lol
14:02:44Yardanicodidn't notice :P
14:03:26FromDiscord<Rika> i tried searching everywhere lmao
14:04:10solitudesfhttps://nim-lang.org/docs/manual_experimental.html#do-notation
14:04:58Yardanicowell, how it is experimental though? :P
14:05:30FromDiscord<Rika> ah its in experimental lmao
14:05:50FromGitter<kaushalmodi> use the `=>` from sugar; it's nice
14:05:52FromGitter<kaushalmodi> https://scripter.co/notes/nim/#do-notation
14:06:08FromDiscord<Rika> => doesnt allow me to do blocks of code πŸ™‚
14:06:21FromGitter<kaushalmodi> hmm
14:07:05clyybberuse do then
14:07:19FromDiscord<Rika> the heck do you mean, i already amm
14:07:20FromDiscord<Rika> am
14:10:20clyybberkk
14:15:08*tefter quit (Ping timeout: 250 seconds)
14:19:07*clyybber quit (Quit: WeeChat 2.7.1)
14:20:10FromGitter<awr1> nimterop AST2 looks interesting
14:24:09FromGitter<awr1> does set[T] work with cligen?
14:25:12FromGitter<awr1> or is it seqs only
14:30:04disruptekcligen works with enums, if that's your question. i dunno if it knows how to constitute sets.
14:37:28Yardanicoi like that you can do stuff like fs.setPosition(ePhoff + (if eClass == 1: 0x20 else: 0x38) * i) :P
14:38:47disruptekplease no.
14:39:40disrupteki guess my idOrSig pr misses some corners.
14:40:46disruptekalso, we should have it add the module name to tmpBase.
14:45:26*noonien joined #nim
14:45:29*natrys joined #nim
14:46:32*tane joined #nim
14:50:46disruptekis 1.2 a thing?
14:52:34narimirandisruptek: it will be soon ;)
14:56:49Yardanicois there a way to force C compiler to keep an unused string constant (nim const) in binary in release mode?
14:57:17*endragor quit (Remote host closed the connection)
14:57:43lqdev[m]are `osproc.Process`es closed automatically when the program quits?
15:03:39FromDiscord<Recruit_main707> can i create a pointer that points to an specific address?
15:03:50FromDiscord<Rika> addr (the object) doesnt work?
15:03:51Yardanicowell, that would be a pointer to pointer, why not?
15:04:02Yardanicoah, I understand what you mean
15:04:36YardanicoWell, a pointer is basically a number which is an adress containing the thing pointer points to :P
15:07:05*drewr joined #nim
15:11:27FromDiscord<Recruit_main707> i want to do something like this https://play.nim-lang.org/#ix=2f3d
15:12:00solitudesfjust cast it
15:13:12Yardanico@Recruit_main707 Addr is the address for which you want a pointer?
15:13:12FromDiscord<Recruit_main707> cast[ptr int]([the_number])?
15:13:17Yardanicoyes
15:13:48Yardanicobut if you cast an incorrect address and then try to access it - probably you'll get a segfault :)
15:15:16FromDiscord<Recruit_main707> risk it 4 the biscuit
15:17:31FromGitter<kennymalac> Hello all, trying to generate a cffi for mongo-c-driver, and I have this error when trying to generate for bson:
15:17:32FromGitter<kennymalac> Error: unhandled exception: getters.nim(103, 14) `name[0] != '_' and name[^1] != '_'` Identifier '_bson_context_t' (nskType) contains leading/trailing underscores '_' [AssertionError] [AssertionError]
15:17:45FromGitter<kennymalac> how do I handle this? nim doesn't allow leading underscores for type names...
15:17:55FromGitter<kennymalac> so *bson*context_t does not work
15:20:41Yardanicowell, why do you need underscores in types names in Nim?
15:20:59Yardanicocan't you just strip them or something like that?
15:21:18FromGitter<kennymalac> the cffi autogen is generating from the C type names in the header file
15:22:42FromGitter<kennymalac> proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} = ⏎ ⏎ ```sym.name = sym.name.replace(re"_[_]+", "_").strip(chars = {'_'})``` ⏎ ⏎ seems like a workaround [https://gitter.im/nim-lang/Nim?at=5e78d441e2b4467c36f3f663]
15:23:12FromGitter<kennymalac> lol gitter.im removes the _ in the regex
15:23:20FromGitter<alehander92> use ``
15:23:23FromGitter<alehander92> for code snippets
15:25:05FromGitter<kennymalac> ` proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} = ⏎ ⏎ ```sym.name = sym.name.replace(re"_[_]+", "_").strip(chars = {'_'})```` [https://gitter.im/nim-lang/Nim?at=5e78d4d1238b385efc9e43e9]
15:27:32Yardanicois this a new regression in devel with arc? when trying to do "echo repr fileobj" with
15:27:40Yardanico--gc:arc I get this:
15:27:45Yardanico/home/dian/stuff/nim-cephei/cephei.nim(107, 13) Error: ambiguous call; both repr_v2.repr(x: ref T or ptr T) [declared in /home/dian/.nim/lib/system/repr_v2.nim(106, 6)] and repr_v2.repr(x: ptr T) [declared in /home/dian/.nim/lib/system/repr_v2.nim(102, 6)] match for: (File)
15:30:50shashlickawr1: has been really challenging but a lot of fun
15:31:50Yardanicohttps://github.com/nim-lang/Nim/issues/13731
15:31:52disbotβž₯ A regression (?) with --gc:arc and repr ; snippet at 12https://play.nim-lang.org/#ix=2f3n
15:32:08disruptekYardanico: repr wasn't supported in arc and then maybe it was and now maybe it isn't again.
15:32:19Yardanicowell, still worth to make an issue :P
15:33:20disruptekokay, but note that it's basically code smell to use it at runtime.
15:33:31Yardanicowell, repr is for debugging, isn't it?
15:33:35Yardanicoat runtime
15:34:25disruptekdebugging, yes.
15:35:01*endragor joined #nim
15:39:07FromGitter<kennymalac> how come nimterop is telling me
15:39:07FromGitter<kennymalac> #Type '_bson_value_t' skipped ⏎ ⏎ # Type 'bson_type_t' skipped
15:39:17FromGitter<kennymalac> and then subsequently saying bson_type_t is not defined, lol
15:39:58*endragor quit (Ping timeout: 256 seconds)
15:40:18FromDiscord<Rika> underscore
15:40:27FromDiscord<Rika> ah
15:40:32FromDiscord<Rika> the 2nd one i see
15:40:33FromDiscord<Rika> hm
15:40:39FromDiscord<Rika> maybe bug lol
15:41:14shashlickit has nested structs which nimterop doesn't support yet
15:41:32shashlickhttps://github.com/mongodb/libbson/blob/master/src/bson/bson-types.h#L275
15:41:53shashlickast2 will support it soon
15:42:00FromGitter<kennymalac> OK so what do I do about this
15:42:02FromGitter<kennymalac> as a workaround
15:42:30shashlickuse c2nim to convert it and then add it to a cOverride section before your cimport
15:42:43Deunseuantor: same openbsd (-current), one can build nimble, the other can't open "std/options" :p
15:42:52Deunseverything is fine...
15:42:54FromGitter<kennymalac> ah alright
15:43:05euantorDeuns: Yeah, I'm not sure why at the minute
15:43:24euantorI'm setting up a clean OpenBSD 6.6 VM at the moment so I can test ona clean system
15:43:39shashlickkennymalac: https://github.com/nimterop/nimterop/issues/137
15:43:41disbotβž₯ Issues with nested structs ; snippet at 12https://play.nim-lang.org/#ix=2f3q
15:44:39FromGitter<kennymalac> mkay is there an example that does this somewhere? or how to do this ? thanks
15:47:40FromGitter<kennymalac> my guess is I just run c2nim and then take the proc definitions and put it in a cOverride block?
15:47:59shashlickcopy/paste that struct into a.h, c2nim a.h - it might complain about some stuff, fix it in the a.h and rerun till you get it working
15:48:24shashlicklet nimterop do all the other stuff, only hand-wrap this one struct with c2nim
15:49:02axionI think I'm about ready to give up on my first Nim project. Wrote a ton of code and can't figure out how to get rid of recursive module errors without shoving thousands of lines in 1 file.
15:50:36disruptek~stream
15:50:36disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:50:43disruptektoday i think i'll just talk about musical lyrics.
15:50:51disruptekwhile i spelunk the compiler.
15:51:25leorizelqdev[m]: no
15:53:09leorizeaxion: well if you want recursive modules you gotta have a good reason to argue with Araq :P
15:53:46Araqnot really. recursive module deps are blocked by IC
15:53:50axionI've been trying for 2 days now to structure the modules in this project in a way that will work. Nothing I try is working. I'm just not experienced enough to figure this out
15:54:14Araqapart from that it's basically an accepted RFC
15:54:29disruptekso put thousands of lines in a file.
15:54:36disruptekthere are worse problems to have in life.
15:54:38*nsf quit (Quit: WeeChat 2.7)
15:55:05Araqmaybe we'll make the import with a {.cyclic.} so that's explicit
15:55:06leorizeaxion: worst case scenario, use `include` to make a thousand lines file from multiple files
15:55:24shashlickaxiom: can you share your code, we can make suggestions
15:56:05axion`include` may work, though it's all generics that would be duplicated. not sure if the compiler will warn/error
15:56:31leorizeofc it will :)
15:56:46leorizethe idea is that you make your thousand line file with a ton of includes, like the compiler :P
15:57:06axionI can share what I have so far, though far from complete.
15:57:10axionGive me a moment please
15:59:38axionhttps://github.com/mfiano/origin.nim
15:59:39FromGitter<kennymalac> @shashlick possible to reference types that will be later defined? for instance, using uint32_t which gets generated from cinterop
16:03:15FromGitter<kennymalac> oh nevermind those are C types
16:03:15FromGitter<kennymalac> hmmm
16:04:02FromGitter<kennymalac> found it https://github.com/CoryNull/nim-bgfx/blob/master/bgfx/types.nim#L7 :)
16:04:15leorizeaxion: please inherit from either CatchableError or Defect :)
16:05:17axionI don't know what that means yet. I'm a complete newbie and taking one step at a time. A lot about this project can be improved I'm sure, but my focus is on organization right now.
16:06:07leorizeso what's your problem rn?
16:07:03axionIt's a bit hard to explain but
16:08:26FromGitter<kennymalac> now I get a very unhelpful error, lol
16:08:27FromGitter<kennymalac> /home/kenster/.choosenim/toolchains/nim-1.0.2/lib/core/macros.nim(1765, 43) Error: string literal expected
16:09:13axionThe user is intended to import the main origin module only, which imports and exports the public API for them. One of those modules is common.nim which contains all the types and common operations for all the other modules. I don't want to export this module though, because it also contains internal stuff, like macros for internal use. I can't split them out into other files without recursive module
16:09:15axionerrors. Additionally, the types aren't even exported by the main origin.nim module because they are in common.
16:10:20FromGitter<kennymalac> trying out 1.0.6
16:11:12*natrys quit (Quit: natrys)
16:11:42FromDiscord<Rika> you can `import module except`
16:12:01FromDiscord<Rika> and `export module except` too afaik
16:13:39axionI can't import common.nim from origin.nim because common.nim needs to be imported from each other file and a circularity arises when trying to compile them
16:13:50axionIt's all a big mess right now...been trying to find a way to fix it
16:14:20FromDiscord<Rika> theres a way to strategically place imports to avoid circularity
16:14:24FromGitter<kennymalac> okay upgrading didn't help, lol
16:15:08FromGitter<kennymalac> but line 1765 in macros.nim doesn't exist it only seems to go up to line 1665
16:15:30shashlickkennymalac: that's not an error in nim
16:15:36shashlickthat's an error in the generated code
16:15:47FromGitter<alehander92> Araq thanks for `.emit`
16:15:49FromGitter<alehander92> works well
16:15:50axionRika: Probably. I feel like I'll get it in a few more weeks of trial and error.
16:16:07shashlickkennymalac: can you post your wrapper somewhere, i can look at it
16:16:38FromDiscord<Rika> axion theres a tutorial for how in the manual
16:16:43FromGitter<kennymalac> sure
16:16:51FromDiscord<Rika> first section of the manual
16:17:17shashlickalso, cOverride will insert your override at the right location so it can refer to other stuff created by nimterop before this symbol
16:17:33shashlickbut you need to make sure your override works by itself
16:17:39shashlicki.e. is valid Nim
16:17:52FromDiscord<Rika> https://play.nim-lang.org/#ix=2f3u ok so this doesnt seem to agree with me, is there a reason why? i know this is bad design, but im not keen on adding `.int` to the middle of 170 lines
16:18:19FromDiscord<Rika> because i have to do this manually, since all of these values are arbitrary
16:18:29FromDiscord<Rika> (i'm conforming to game values)
16:19:05axion"About this document"?
16:19:46FromDiscord<Rika> i mean the first part of the manual
16:19:48FromDiscord<Rika> there are 3 parts
16:19:59FromDiscord<Rika> https://nim-lang.org/docs/manual.html#modules
16:20:02FromDiscord<Rika> or am i mistaken
16:20:05FromDiscord<Rika> i think im thinking of something else
16:20:11FromDiscord<Rika> nonetheless ive sent the link
16:20:45axionYeah I have read that. My problem is more domain specific due to the dependencies and generics used.
16:21:10FromDiscord<Rika> might need include then
16:22:04FromGitter<kennymalac> https://github.com/ParadigmInteractive/libmongonim @shashlick
16:22:50solitudesf@Rika, https://play.nim-lang.org/#ix=2f3v
16:22:57solitudesfa workaround
16:23:18solitudesfyour version doesnt work because there converter doesnt get used.
16:23:57solitudesfwait, but should it?..
16:24:29FromDiscord<Rika> those are my thoughts
16:24:44disruptekcreepy.
16:24:55disruptekwhat card am i holding up?
16:24:57solitudesfno, its right, it shouldn't get used
16:25:10FromDiscord<Rika> why not?
16:25:39solitudesfyoure calling this proc `proc `[]=`[I: Ordinal; T, S](a: T; i: I; x: S)`
16:25:58solitudesfits fully generic so it obviously doesnt call converter
16:26:09*endragor joined #nim
16:26:42axionRika: I can't do that because it's intended for things in different modules to have the same such as consts and types
16:26:49axionsame names*
16:27:17axionI think I need a break. Hurting my brain. Going to watch tv or something.
16:28:19shashlickkennymalac: trying
16:29:02FromGitter<kennymalac> cool
16:29:45FromDiscord<Rika> solitudesf, darn, okay
16:30:16*clemens3 quit (Quit: laterz)
16:31:00solitudesfjust use your custom []= if you want to do wacky shit
16:31:09*endragor quit (Ping timeout: 258 seconds)
16:34:07FromDiscord<Rika> okay
16:34:15shashlickkennymalac: just change your cOverride uint32_t to just uint32
16:34:19shashlickno need to declare those
16:39:09*clemens3 joined #nim
16:39:12*clemens3 quit (Client Quit)
16:39:33*clemens3 joined #nim
16:40:16FromGitter<kennymalac> oh okay
16:41:04shashlickWhy did you have to override the enum
16:41:36FromGitter<alehander92> axion
16:41:42FromGitter<alehander92> hm https://github.com/mfiano/origin.nim/blob/master/src/origin/mat4.nim#L406
16:41:50FromGitter<kennymalac> it complained about bson_type_t not being defined shashlick
16:41:51FromGitter<alehander92> i dont know algebra much
16:42:02FromGitter<alehander92> but isnt there a way to somehow loop over a pattern here
16:42:09FromGitter<kennymalac> oh weird, it compiles without it
16:42:09FromGitter<alehander92> it seems very easy to make a mistake
16:42:43FromGitter<alehander92> and the "loop" can still generate the same code
16:42:54shashlickCool beans
16:43:21FromGitter<alehander92> might be closer to math defs otherwise tho so maybe i am wrong
16:43:36FromGitter<kennymalac> how would you debug the string literal expected?
16:43:58axionalehander92: Sure there is, but the overhead in doing so is not ideal. It could be a macro, but I'm trying to write this in an educational form without magic hidden behind tons of macros
16:46:52*Trustable joined #nim
16:48:12axionThe only macro I will eventually have are matrix accessors, like M02 -> m[8], so it reads just like you'd read it in a math text. I'm actually going for verbosity here because math should be written as it would be on paper
16:49:25FromGitter<alehander92> hm, maybe
16:49:41FromGitter<alehander92> it's bit subjective thing but for educational purposes it makes sense
16:50:05shashlickkennymalac: did you change bson_subtype to bson_subtype_t in your override
16:50:08shashlickthat's one failure
16:50:24shashlicksame with bson_oid_t
16:51:07euantorso `nim dump` dumps a bunch of paths to stderr that look right, but they're unfortunately not full paths :(
16:51:14shashlickokay i'm down to the string literal error now
16:52:22shashlickhere's how you debug that
16:52:29shashlickfirst `nim c bson.nim > a.txt`
16:52:45shashlickthen open a.txt and see the nimterop/toast command line at the top
16:52:53shashlickrun that on the command line with the -k flag
16:53:26shashlickbasically you haven't declared your dynlib="bson" <= what is bson there
16:54:23shashlickchange dynlib="bson" -> dynlib = "bsonLPath"
16:54:26shashlickand it works
16:54:49FromGitter<kennymalac> oh okay nice
16:55:03FromGitter<kennymalac> I did bson so I could get rid of this error from mongo: ERROR: bson/bson.h: No such file or directory
16:55:23shashlickhere's your final wrapper - http://ix.io/2f3M/nim
16:55:24FromGitter<kennymalac> looks like it still errors
16:56:44FromGitter<kennymalac> hmm that link doesn't load for me
16:57:00FromGitter<kennymalac> should I make the output dir go to build/bson ? would that fix it?
16:59:02shashlickit isn't the output dir
16:59:52FromGitter<kennymalac> okay now the link works, it was my internet
16:59:55FromGitter<kennymalac> yeah nevermind
17:00:05shashlicktry https://pastebin.com/s8AXP9SN
17:04:10*rnrwashere joined #nim
17:05:46FromGitter<kennymalac> so how to get bson.h loading from bson/bson.h as required by mongoc.h?
17:06:06*endragor joined #nim
17:08:23*rnrwashere quit (Remote host closed the connection)
17:09:39shashlickOh you are onto the next one
17:09:52shashlickUse cIncludeDir
17:10:02shashlickSee the nimarchive/archive wrapper
17:10:12shashlickHow it refers to lzma, zlib, etc
17:10:14*endragor quit (Ping timeout: 240 seconds)
17:10:41shashlickIf you include bson.nim then bsonPath will exist
17:11:28FromGitter<kennymalac> the reason I split them into two seprate files is having both getHeaders in the same file causes a compile time error
17:11:31FromGitter<kennymalac> probably a bug
17:12:56FromGitter<kennymalac> I think two headers from the same git repo fails
17:13:47FromGitter<kennymalac> so I don't think I can import it
17:14:19FromGitter<kennymalac> nvm, I can because it's not exported
17:14:30FromGitter<kennymalac> the conflicts that is
17:16:46FromGitter<kennymalac> ah this is confusing
17:17:55*ccreat joined #nim
17:19:01*ccreat left #nim (#nim)
17:29:43*rnrwashere joined #nim
17:32:15shashlickWhat's up
17:32:55FromGitter<kennymalac> I see I have to override the cmake values for the bson lib dir
17:34:30*rnrwashere quit (Remote host closed the connection)
17:34:49*rnrwashere joined #nim
17:41:49*natrys joined #nim
17:54:46*rnrwashere quit (Remote host closed the connection)
17:59:13*Guest25620 is now known as dadada
18:01:37*rnrwashere joined #nim
18:01:44shashlickif required that is
18:02:21*sleepyqt_ quit (Ping timeout: 265 seconds)
18:02:38disruptek!last zedeus
18:02:39disbotzedeus joined 12#nim-offtopic 5 days ago and last spoke 75 days ago
18:02:46disruptekwhere is he?
18:02:48disrupteksick?
18:02:55zedeushello
18:03:03disruptekare you on stream?
18:03:09disruptek~stream
18:03:09disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
18:03:15zedeusnope, i'll have a look
18:03:27disruptekjust realized i hadn't seen you in awhile.
18:03:46FromGitter<zetashift> 75 days ago surely is wrong no?
18:04:14FromGitter<alehander92> irc=>gitter doesnt get the color codes
18:04:15zedeusjust been busy trying not to get infected :)
18:04:30FromGitter<alehander92> its probably 5 days
18:04:42disruptekyeah.
18:04:47disruptekget a real client.
18:05:50Yardanicoquassel :P
18:05:55dadadalet's say I want a sequence with many different types in it, where I don't know the composition at compile-time, Nim provides one way to do this through the Any type that can basically wrap any type you can use in Nim, but there's one complication here, when you eventually want to use the original object/type at runtime, you've to use the Any.kind field to determine the correct method (I mean proc) to do it
18:06:01dadada(something like getString() or getInt()), this works best I assume for builtin types like int, but what if you're dealing with custom objects, or maybe objects that users of your library will later define, what I mean is there's no generalized way of casting the type that is wrapped inside the Any into its original form (that I can see), has someone done any work to simplify dealing with this?
18:06:26disruptekyes, see the json module.
18:06:32Yardanicoyeah, json is the way :P
18:07:56dadadaI imagine there's some overhead involved with JSON, I'd prefer to find a way that works without it
18:08:13Yardanicoas long as you're not decoding/encoding, not really
18:08:15disrupteklet us know what you come up with.
18:08:43Yardanicojson just uses an object variant with different fields
18:08:50*rnrwashere quit (Remote host closed the connection)
18:09:11Yardanicohttps://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/json.nim#L156
18:09:17*rnrwashere joined #nim
18:17:17dadadaI may be mistaken here, but json can't preserve reference/pointers to objects? This can be done with Any getPointer and manual casting. I'll definitely try to come up with something.
18:19:21disrupteki think you're missing the point.
18:19:45FromGitter<alehander92> guys
18:21:43dadadaalehander92: hello
18:21:52FromGitter<alehander92> yea
18:21:58FromGitter<alehander92> i want to talk about error types
18:22:09*btop joined #nim
18:22:14FromGitter<alehander92> its fun to talk about them
18:22:17Yardanicooh no
18:24:03*btop quit (Client Quit)
18:24:04*btop_ joined #nim
18:34:30FromGitter<alehander92> oh no
18:39:04*rnrwashere quit (Remote host closed the connection)
18:47:58disruptekwhat did we decide about shadowing with new type names? it'd be better to have a warning?
18:48:08disruptekie. same name, new type
18:53:16*rnrwashere joined #nim
18:56:29*couven92 quit (Ping timeout: 265 seconds)
18:58:58FromGitter<alehander92> is this in the spec
19:02:48*MarderIII joined #nim
19:08:44*NimBot joined #nim
19:12:34*dadada quit (Ping timeout: 240 seconds)
19:15:32*dadada joined #nim
19:15:43*opal quit (Ping timeout: 240 seconds)
19:16:21*dadada is now known as Guest29670
19:18:11*Guest29670 is now known as dadada
19:18:51*opal joined #nim
19:32:12FromDiscord<Recruit_main707> i am having an issue with passing pointers by value: https://play.nim-lang.org/#ix=2f4H (full error if you run the code)
19:34:25leorizewell I'm seeing a crash which makes sense?
19:34:38disruptekweak symbol names?
19:34:56FromDiscord<Recruit_main707> ??
19:35:18leorizeso what's the problem? it's supposed to crash like that, at least with your snippet
19:35:34FromDiscord<Recruit_main707> then what am i doing wrong?
19:35:52leorizethe value you hardcoded in there doesn't exists
19:36:12leorizepointers point to a place in the program's memory
19:36:18Araqhow do you know that 0x8832205C is a valid address?
19:37:03FromDiscord<Recruit_main707> how can i know if they are valid addresses?
19:37:12leorize... you can't
19:37:58leorizewhat are you trying to do?
19:38:25FromDiscord<Recruit_main707> here, making sure that variable is at a certain memory location
19:38:39leorizeI'm sorry, but that's not how it works
19:38:51FromDiscord<Recruit_main707> this is just a demo
19:38:54leorizethe OS assigns you the memory, you don't get to do that
19:39:20FromDiscord<Recruit_main707> in practice, i am trying to access a variable of another process
19:39:26FromDiscord<Recruit_main707> by reference
19:39:29leorizewell but if what you mean is to convert an arbitary value into a pointer, then yes, that's how
19:40:01leorizeyou still can't do it like that, sadly
19:40:15leorizeunless you have access to the program's address space
19:40:34FromDiscord<Recruit_main707> my code is injected in the process
19:40:45leorizesure, then that's how
19:41:33FromDiscord<Recruit_main707> ok, so ill have to keep trying
19:41:37FromDiscord<Recruit_main707> thank you
20:03:01*rnrwashere quit (Remote host closed the connection)
20:17:18*Vladar quit (Quit: Leaving)
20:23:48*PMunch quit (Quit: leaving)
20:37:48*filcuc joined #nim
21:12:00*filcuc quit (Ping timeout: 250 seconds)
21:15:54*narimiran quit (Ping timeout: 240 seconds)
21:17:42*endragor joined #nim
21:20:11*natrys quit (Ping timeout: 250 seconds)
21:22:25*endragor quit (Ping timeout: 264 seconds)
21:27:17*MarderIII quit (Quit: Leaving)
21:33:46*natrys joined #nim
21:33:46*natrys quit (Client Quit)
21:45:01*rnrwashere joined #nim
21:53:54rockcaveraIs there a proc to check if a string is a valid ipv4 or ipv6?
21:55:37leorizeno
21:56:42leorizethough there's this:
21:56:50leorize!packages validateip
21:56:51disbothttps://github.com/Akito13/nim-validateip -- 9validateip: 11Checks if a provided string is actually a correct IP address. Supports detection of Class A to D of IPv4 addresses.
21:57:28rockcaverathanks
22:00:48axionWhat am I doing wrong here? I'm confused why it's returning -1: https://play.nim-lang.org/#ix=2f5t
22:04:19shashlick-1 or 0 =
22:04:43axion?
22:06:08*Trustable quit (Remote host closed the connection)
22:06:20*solitudesf quit (Ping timeout: 246 seconds)
22:08:32lqdev[m]is there a way for sending data in to a process progressively? eg. I want to send some PNG files to the stdin of an ffmpeg Process, but I don't have them all at once. instead, they come in slowly, rendered from Blender
22:08:35*filcuc joined #nim
22:08:56disruptek!repo asynctools
22:08:56disbothttps://github.com/cheatfate/asynctools -- 9asynctools: 11Various asynchronous tools for Nim language 15 53⭐ 12🍴
22:09:15axionHmm. I was expecting `or` to short circuit and not evaluate later terms. I'll have to think of the proper way to do this. I'm too used to FP style it seems.
22:12:39FromGitter<kaushalmodi> axion: in your example, you are using a type name `char` as var name
22:13:43FromGitter<kaushalmodi> also `find` returns int and `or` would be to OR bools
22:14:08axiongah, in lisp everything that isn't false is truthy
22:15:20FromGitter<kaushalmodi> this is a compiled lang
22:15:27axionso is common lisp
22:15:30FromGitter<kaushalmodi> true != 1
22:21:50FromDiscord<Rika> this is a lang that doesnt have a concept of truthy
22:22:46leorizeaxion: only true means true in Nim
22:22:52axionI noticed. I'm fighting every step of the way trying to write as expressive and efficient code as I am used to. It's not easy to write Nim without lots of boilerplate, whether in the form of macros or runtime branching
22:23:26FromDiscord<mratsim> WHat?
22:23:27leorizeinstead of that, try this: `char in "xyzw"`
22:23:27axionI think a blog post is in order, as other Lispers have been asking me how my progress has been.
22:23:49FromDiscord<Rika> theres a balance between expressive and less error prone perhaps
22:24:18FromDiscord<mratsim> in my experience, only very few language were more expressive than Nim (i.e. Haskell) but they had oother issues
22:24:29axionIf I wanted less error prone I'd use a dependently typed language or a static Lisp like Carp, which Nim is not.
22:24:45FromDiscord<Rika> dependently typed language?
22:25:26FromDiscord<Rika> maybe what you mean instead of expressive is terse
22:26:19FromDiscord<mratsim> Nim can do dependent typing
22:27:30FromGitter<zetashift> I like the fact that only true means true in Nim and I don't find that it impairs it's expressiveness. Maybe your view of expressive code is different then what Nim thinks?
22:28:29FromDiscord<mratsim> https://github.com/mratsim/constantine/blob/master/constantine/arithmetic/finite_fields.nim#L32-L38
22:28:29FromDiscord<mratsim> https://github.com/mratsim/constantine/blob/master/constantine/arithmetic/bigints.nim#L58-L75
22:28:29FromDiscord<mratsim>
22:28:29FromDiscord<mratsim> ^ this is using dependant typing
22:28:30FromDiscord<mratsim>
22:28:33FromDiscord<mratsim> And I'm also modeling algebraic concept of groups, fields and number theory: https://github.com/mratsim/constantine/blob/master/constantine/tower_field_extensions/abelian_groups.nim#L38-L44
22:29:13FromDiscord<Rika> is there dependent typing in functions?
22:29:50FromDiscord<mratsim> This is an example: https://github.com/mratsim/Arraymancer/pull/413#issuecomment-586924873
22:29:52disbotβž₯ WIP: Add dbscan clustering method ; snippet at 12https://play.nim-lang.org/#ix=2bWh
22:30:09FromDiscord<mratsim> "Alternative 2 typedesc dispatch"
22:31:51FromDiscord<mratsim> Nimcrypto is entirely based on typedesc dispatch: https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/hash.nim#L68
22:32:18axiondependent types can have the return type depend on information only known at runtime.
22:32:23*lritter quit (Ping timeout: 260 seconds)
22:32:28axionIn order to typecheck the compiler has to verify that the types work out for every possible value though
22:32:40axion(Which means dep-typed langs tend to be rather picky about the allowed values you can construct)
22:33:01FromDiscord<mratsim> pretty sure Idris doesn't allow that
22:33:19FromDiscord<Rika> `I`dris or `l`dris?
22:33:28FromDiscord<mratsim> Is there runtime dependant type? Isn't that just an interface or polymorphism?
22:33:39FromDiscord<mratsim> Idris with i
22:33:51FromDiscord<Rika> i think you misunderstood them
22:34:50axionDepends how dependent the types have gotten I suppose.
22:35:19axionThe entire point of curry-howard is that every program you write is a proof of something, it’s just without the rich specification of dependent types the particular properties you’re "proving" are more or less trivial.
22:37:01leorizecan I have some examples?
22:37:11leorizethis sounds interesting
22:37:29rayman22201Of all the criticisms of Nim that I have heard, I never thought I would hear "Nim is not expressive enough"... only the most hard core lisp person could come up with with that lol
22:37:36FromDiscord<Rika> lmaooo
22:37:41FromDiscord<Rika> or maybe the haskeller
22:37:47axionI would read "The Little Typer" or "Type-Driven Development in Idris". It's a pretty complex subject to say the least if you aren't familiar with proof assistants already
22:38:12FromDiscord<Rika> sounds like something that would be nice tbh but sounds like a pain to implement
22:38:13FromDiscord<mratsim> Coq is a bit too much for first contact πŸ˜›
22:38:23FromDiscord<mratsim> Z" would be a step in that direction
22:38:26FromDiscord<mratsim> Z3
22:38:37FromDiscord<mratsim> F* is using Z3 for their dependent type system AFAIK
22:39:24FromDiscord<mratsim> currently Nim is a collection of typedesc and static cobbled together, it kind of works but it's easy to trigger "Cannot instantiate T"
22:39:35FromDiscord<Recruit_main707> leorize: got it to work, sleep() function was crashing my program, so i can only burn cpu
22:39:57FromDiscord<mratsim> besides the cannot instantiate or the straight up crash I didn't see any type-level bug though.
22:42:15*couven92 joined #nim
22:47:07axionrayman22201: "expressive" means that it's easy to write code that's intutitive, both for the compiler and a human. The addition of un-needed boilerplate code, not being able to share names between consts/procs for example, or wrongly choosing a reserved keyword because there's no context-sensitive shadowing (god, i can't count how many times i tried using `out` etc), that goes against it.
22:48:20axionBut you're right. I've been using Lisp for a couple decades so I am quite hardcore :)
22:51:43FromDiscord<Rika> un-needed boilerplate code -> example?
22:52:04FromDiscord<Rika> not being able to share names between consts/procs for example -> with UFCS, this is impossible i'm pretty sure
22:52:15FromDiscord<Rika> actually, probably is possible
22:52:23FromDiscord<Rika> i've just not thought of it that much
22:52:48FromDiscord<Rika> wrongly choosing a reserved keyword because there's no context-sensitive shadowing -> this is prolly easy to implement
22:54:18FromDiscord<mratsim> const and proc and modules can have the same name though?
22:54:33rayman22201Reserved keyword sharing would be hard b/c of the way the Nim lexer works afaik. Nim is very much a classical lang and not a lisp in this regard.
22:54:40rayman22201shadowing*
22:54:44FromDiscord<mratsim> I think keyword are actually hard because they are parser level
22:54:52FromDiscord<Rika> huh, i see
22:55:19FromDiscord<mratsim> The "block" keyword is super annoying in particular
22:55:29FromDiscord<Rika> why so?
22:55:34FromDiscord<mratsim> In blockchain everything is a block ...
22:55:41FromDiscord<mratsim> in our codebase it's blck or blk
22:55:41FromDiscord<Rika> ooh
22:55:44FromDiscord<Rika> ouch
22:55:53FromDiscord<Rika> i've seen most people use blk
22:57:31shashlickaxiom: appreciate the struggle, i had similar challenges with python lists to nim, etc. but nim != lisp so some mental flexibility is warranted
22:57:36rayman22201axion, it seems to me that you really want Nim to be a lisp. for better or worse it is not. Nim is a "classic" statically typed language that happens to have an expansive macro system.
22:57:47FromDiscord<mratsim> oh yeah, the list comprehensions :/
22:58:14*dadada quit (Ping timeout: 240 seconds)
22:58:54FromDiscord<Rika> oh i had no issues with list comprehensions
22:59:06FromDiscord<Rika> just converted them to mapIt and filterIt
22:59:08axionYeah reserved keywords are by far the most annoying thing for me so far. In Lisp, we can annotate the parser to tell it to look in a different symbol table on a per module-basis, and fully qualify the originals if we want them back
22:59:50rayman22201axion, slightly off topic, but I think I found your blog https://www.michaelfiano.com/. I'm curious how your transition to racket went? Since you came to our corner of the internet, I'm guessing you had some issues there too?
23:00:49leorizeaxion: well you can use Nim's keywords as identifier
23:00:58FromDiscord<Rika> axion, i mean you can use backticks to use them
23:01:00leorizeit's just not really pretty
23:01:03axionrayman22201: That was years ago. I wrote about my transition back to Common Lisp a post or two later, mostly because it generates efficient machine code.
23:01:10FromDiscord<Rika> just, 2 extra characters aint worth it
23:04:36*dadada joined #nim
23:04:59*dadada is now known as Guest80189
23:05:27rayman22201ah. I saw the update about moving back to CL, but I didn't see the reasoning.
23:06:43axionrayman22201: and no, I don't want Nim to be a Lisp. Infact the reason I'm learning Nim is because I've grown tired of the ecosystem, and the people surrounding it. I wrote about it a few days ago here, but in short, there is no collaboration and requires a very specific set of tools that only really work with Emacs, which I also dislike. I wanted to join the world of more traditional compiled
23:06:45axionlanguages...just going through some growing pains.
23:07:37leorizeI'd say try not to focus too much on the efficient part rn
23:07:41leorizewrite code that looks good
23:07:46leorizethen make it run got
23:07:48leorizegood*
23:08:33leorizeI'm certain that you know the basics, so whatever you designed will not be horrendously slow
23:08:33axionOh and I'm not. I'm trying to write code that expresses my ideas but having a hard time learning how to do trivial tasks.
23:08:48leorizelearn some Nim idioms :)
23:09:15disruptek^
23:09:16leorizeinstead of `find(string, char) >= 0`, use `contains(char, string)` or `char in string` :)
23:09:27axionMy only resources have been the manual and the tutorials and NIA. I read all them, and going back and forth between them every day, and some things still don't click with me.
23:10:02leorizeyou forgot that you have #nim as a huge resource :)
23:10:04rayman22201I understand. :-) You are definitely giving up some "cosmic superpowers" that only a lisp (or Haskell maybe) can provide. But I do hope you stick around. We always need more smart people.
23:10:18FromDiscord<Rika> leorize, `contains(string, char)`
23:10:29leorizeah, yea
23:11:27axionleorize: Yeah and tbh it was the biggest help by far. The documentation is pretty hard to navigate with Ctrl+F as a single page, there is only one years-old published book, and the community is still quite small, but I'm hoping all of that will change sometime.
23:11:32FromDiscord<Rika> other than the ecosystem, what's worse in Lisp vs Nim?
23:12:16*rnrwashere quit (Remote host closed the connection)
23:12:31leorizewe got the man power for writing code, we just lack the man power writing documentation :p
23:13:04leorize@Rika: I'd say the parenthesis but Lisp users will kill me :)
23:13:29FromDiscord<Rika> axi0n's gonna i bet
23:13:44axionRika: Aside the ecosystem/community? The tooling and editor lock-in. The language itself is fine in all respects if you ask me.
23:14:28FromDiscord<Rika> huh interesting
23:14:35shashlickWhat about the tooling
23:15:04*rnrwashere joined #nim
23:15:36axionWell, CL is built for interactive compilation from the ground up, and so requires extensive introspection support. You basically run a server in CL, and a client in the editor listens and responds to events. The only editor worth using for this is Emacs.
23:15:37FromDiscord<Rika> oh also for those who actually decide on nim functionality, what's the reason for declaring that there is no "truthiness" and everything that needs a bool must need a bool?
23:15:57axionLSP is not good enough for Lisp. It doesn't cover everything that the language has to offer
23:16:29leorize@Rika: because it's stupid
23:17:31rayman22201lol, partially, but it's also about taste. some people prefer truthiness to be more strict.
23:17:38axionleorize: You don't even see the parentheses or type them for that matter in Lisp with proper tooling. That's the biggest complaint to outsiders that never work with CL
23:17:49leorizeI'd say that it's an artifact of C's weak typing
23:18:12FromDiscord<Rika> C's weakly typed?
23:18:27rayman22201yes. very much so
23:18:39FromDiscord<Rika> guess i havent worked with it enough
23:18:42*tane quit (Quit: Leaving)
23:21:23leorizeaxion: "proper tooling" :P
23:21:29leorizeyou mean emacs :p
23:21:56axionI mean the dozen or so plugins for it that aren't yet mature enough on other platforms
23:22:15leorizethough I'll admit that I've never written any lisp other than some for emacs to install plugins
23:22:24rayman22201I like Nim's boolean behavior. I think it prevents bugs. I have seen plenty of C bugs from throwing incorrect things into a boolean expression...
23:22:49*couven92 quit (Remote host closed the connection)
23:22:59axionleorize: regarding your `find` suggestion. I need to find the position of a character in one of 3 different strings, or false if not present in any of them.
23:23:15*couven92 joined #nim
23:23:19axionnot a simple boolean expression
23:23:33FromDiscord<Rika> are they in a seq or array
23:23:40axionstatic strings
23:23:59*couven92 quit (Client Quit)
23:24:19FromDiscord<Rika> you'll still need find then
23:24:22FromDiscord<Rika> also
23:24:49leorizeaxion: for i in [ConstString1, ConstString2]: result = find(i, char); if result != -1: break
23:24:53FromDiscord<Rika> maybe use an Option, then return none if not found then a some if found
23:25:16FromDiscord<Rika> maybe i'm thinking too weirdly lmao πŸ˜›
23:25:23axionAlso, I didn't mean to sound like I was so upset with Nim above if I came off to be. It's just frustrating learning a new language after decades of using a very unorthodox language _exclusively_ every day. I love Nim so far.
23:25:40rayman22201not crazy, I would use an Option for this too
23:25:49*filcuc quit (Quit: Konversation terminated!)
23:25:54FromDiscord<Rika> you sounded very annoyed yeah but that's to be expected really
23:26:03leorizeI'd vote for Option[Natural] :)
23:26:12*rnrwashere quit (Remote host closed the connection)
23:26:22FromDiscord<Rika> somehow i never experienced this phase, though i came from python
23:26:49leorizepython is nowhere near the weirdness of lisp :P
23:26:59rayman22201axion, yay, good to hear we haven't lost you πŸŽ‰
23:27:02FromDiscord<Rika> exactly why i said `though` πŸ˜›
23:27:19*krux02 quit (Remote host closed the connection)
23:27:21*uvegbot quit (Remote host closed the connection)
23:28:14*Guest80189 quit (Ping timeout: 246 seconds)
23:29:41*krux02 joined #nim
23:29:51*uvegbot joined #nim
23:29:53shashlickaxion I was asking about Nim tooling but guess I read your comment wrong
23:30:10*luis_ joined #nim
23:30:36leorizehe was complaining about lisp
23:31:44axionYeah, Nim's tooling is excellent. Particular props to leorize for his great vim support. But, `nim`, `nimsuggest`, `nimble`, etc are also great
23:33:06leorizeI'm glad I freed you from the emacs abomination
23:33:10axionAt face value, ignoring any subtle bugs that may exist, Nim's tooling is perfect.
23:33:32leorizeyou'll find the situtation reversed here, emacs tooling for nim is kinda bad :P
23:34:11axionI noticed. I tried to Nim in Emacs when I was deciding to switch to Nim and still in "lisp mode". I'm glad I didn't base my decision of of that :)
23:34:32*dadada__ joined #nim
23:35:01axionThough to be honest, I've read the manual 3 times in the last 2 years and been keeping an eye on it since back then. Only recently actually started writing code though.
23:39:25axionMy only real complaint with Nim is something that can't be fixed because it's not a Lisp.
23:39:32axionSo I'll just have to get used to it
23:42:34axionIn Lisp, writing macros is no different than writing any other code, because Lisp code is already in AST form. Code in a macro is the same as code outside of a macro. In Nim, it's much more tedious and forces me to switch contexts. But it is what it is. A lot of languages don't even have macros to this degree anyway. So no real complaint...just more work to get the same job done.
23:43:32*luis_ quit (Ping timeout: 260 seconds)
23:45:18FromDiscord<Rika> argh! i keep on forgetting i cant use linenoise on windows
23:52:40FromDiscord<treeform> Hey guys, is there a way to pin the main thread - the thread you start with to a CPU? `pinToCpu` takes a thread object, but how do it get for the main thread?
23:53:57FromDiscord<treeform> I am starting a work q of threads, I would like to keep main thread on 0th core, while create work threads for the rest of the cores and pin all of the threads. Is doing that smart or stupid?
23:57:59*dadada__ quit (Ping timeout: 246 seconds)
23:58:33leorizethat's stupid imo