<< 22-12-2017 >>

00:07:27dom96https://forum.nim-lang.org/t/3426
00:14:52*yglukhov quit (Read error: Connection reset by peer)
00:15:35*yglukhov joined #nim
00:25:51*MJCaley joined #nim
00:33:02*yglukhov quit (Read error: Connection reset by peer)
00:33:39*yglukhov joined #nim
00:34:58*Leeky_ quit (Quit: Page closed)
01:03:10*vivus quit (Quit: Leaving)
01:05:21FromGitter<kayabaNerve> How can I pass a Nim function's pointer to a C dll?
01:10:21dom96addr func
01:11:43FromGitter<kayabaNerve> Thanks
01:15:20*yglukhov quit (Remote host closed the connection)
01:36:59*vlad1777d_ quit (Ping timeout: 252 seconds)
01:37:17*RushNY joined #nim
01:40:27*RushNY left #nim ("Leaving")
01:43:06FromGitter<kayabaNerve> dom96: addr(myProc) Error: expression has no address
01:43:35FromGitter<kayabaNerve> The proc is defined as `proc handleOutput(output: string, size, nmemb: uint; userdata: pointer): uint =` ABOVE the addr() line, in the same file.
01:43:40*happycoder joined #nim
01:46:15*happycoder quit (Read error: Connection reset by peer)
01:47:26*nyeaa quit (Quit: leaving)
01:47:50*Serenit0r joined #nim
01:48:07FromGitter<kayabaNerve> {.procvar.} does not help either...
01:50:05FromGitter<kayabaNerve> It also appears that may be the default.
01:50:57*Serenitor quit (Ping timeout: 240 seconds)
01:55:34FromGitter<kayabaNerve> NVM. Solution was just to remove addr() and just the function name.
01:56:17*dddddd quit (Remote host closed the connection)
02:04:52*chemist69 quit (Ping timeout: 255 seconds)
02:18:30*chemist69 joined #nim
02:50:43*marenz_ quit (Read error: Connection reset by peer)
02:52:59*noonien quit (Quit: Connection closed for inactivity)
03:03:03*chemist69 quit (Ping timeout: 272 seconds)
03:06:33*marenz_ joined #nim
03:15:57*yglukhov joined #nim
03:16:45*chemist69 joined #nim
03:19:57*yglukhov quit (Ping timeout: 240 seconds)
03:20:14*SenasOzys joined #nim
03:38:06*marenz__ joined #nim
03:42:04*marenz_ quit (Ping timeout: 268 seconds)
03:45:08*radagast quit (Ping timeout: 252 seconds)
03:57:36*MJCaley quit (Quit: MJCaley)
04:09:03*Serenit0r quit (Quit: Leaving)
05:05:32FromGitter<tekjar> Hi.
05:05:48FromGitter<tekjar> Is anyone using nim on microcontrollers?
05:06:27FromGitter<tekjar> Any blog/repo links please
05:09:01*marenz__ quit (Ping timeout: 260 seconds)
05:27:57Tanger@tekjar http://disconnected.systems/blog/nim-on-adruino/ https://forum.nim-lang.org/t/658
05:28:07Tanger@tekjar https://github.com/gokr/ardunimo
05:28:13TangerSome resources that might get you started
05:28:48TangerOooh, and https://github.com/Dhertz/AkaPi apparently runs on rPi
06:16:40*nsf joined #nim
06:31:09*Elronnd quit (Quit: be right back...)
06:32:10*elronnd joined #nim
06:33:08*elronnd is now known as Elronnd
07:23:30*yglukhov joined #nim
07:28:23*yglukhov quit (Ping timeout: 268 seconds)
07:34:32FromGitter<tekjar> Tanger: Thanks :). May be there should be a nostd section in awesome-nim
07:35:13TangerNo worries! I can't vouch for how much you'll get from them, but from the looks of it it should be a starting point at the very least :)
07:35:31TangerCould be like a dev-driven list of articles and libs
07:47:49*skrylar joined #nim
07:48:17*solitudesf joined #nim
08:06:14*Ven`` joined #nim
08:09:49*Ven`` quit (Read error: No route to host)
08:10:15*Ven`` joined #nim
08:18:35skrylarsuccessfully got a nim subclass of a fltk widget last night
08:18:53skrylarIt's a little jenky though :(
08:19:37skrylarnim stable docs imply it is safe to use emit to create a type in C++ land, then import on nim land. while true, exporting that type from one module to another results in Badness because it tries to use a type that doesn't exist
08:20:49*claudiuinberlin joined #nim
08:22:19*Trustable joined #nim
08:24:41*PMunch joined #nim
08:25:37*Ven`` quit (Ping timeout: 248 seconds)
08:27:31*Trustable quit (Remote host closed the connection)
08:28:14*Trustable joined #nim
08:30:13FromGitter<mratsim> @dom96 Nim at FOSDEM, awesome! I’ll see if I can be there.
08:30:37*yglukhov joined #nim
08:35:51*yglukhov quit (Remote host closed the connection)
08:45:36*floppydh joined #nim
08:47:46*Jesin quit (Ping timeout: 260 seconds)
08:50:22Araqskrylar: it's just an example in the docs, it doesn't claim to work out in practice :P
08:53:05FromGitter<konqoro> Hey being porting some fortan code to nim. For a
08:54:08FromGitter<konqoro> Array 1000 , what is prefered in nim? A seq or array?
09:04:08*gmpreussner quit (Ping timeout: 252 seconds)
09:05:15*vlad1777d_ joined #nim
09:05:19*gmpreussner joined #nim
09:06:35*dddddd joined #nim
09:06:46Araqdepends
09:06:57Araqstart with the array version
09:25:50ftsfhmm is there a way to debug a template to see what nim code is generated?
09:28:53*solitudesf quit (Ping timeout: 252 seconds)
09:30:48*Arrrr joined #nim
09:31:12FromGitter<andreaferretti> Something like this should do (warning: untested) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a3cd0df5355812e57067c49]
09:31:40FromGitter<andreaferretti> there is also `macros.expandMacro` which may as well work on templates
09:32:23ftsfthanks!
09:33:27ftsf\o/
09:40:10*Jesin joined #nim
09:41:59PMunchdom96, yeah really nice to see that Nim will be at FOSDEM. I would love to be there but it seems that plane tickets are pretty expensive..
09:45:54*yglukhov joined #nim
09:47:42ftsfyay! just made my code so much nicer with some templates
09:49:02FromGitter<mratsim> @konqoro array will be faster if you don't need the dynamic stuff from seq, only caveat is your stack size.
09:54:38FromGitter<mratsim> @Araq if there I have 2 types `Node -> Foo` and `Foo -> Node` describing a DAG, where should I put the {.acyclic.} pragma, on both types?
10:00:23Araqyeah
10:03:03Araq.acyclic is ignored btw
10:09:38FromGitter<mratsim> Ugh ><, I wanted to remodel my parent-child relationships in my NN graph by using weak reference (ptr) and strong reference (ref) to make sure I avoid the cycle collector.
10:11:29FromGitter<mratsim> Btw I give up on trying to reproduce the allocator issue with setters like proc `data=`, spend ~3 evenings trying. I'll work around it by not using setters.
10:17:46Araqsetters are irrelevant
10:18:14Araqyou had a corruption, corruptions are non local and can be hard to reproduce
10:18:21Araqbut need to be fixed
10:19:24Araqptr / ref works without .acyclic and to avoid the cycle collector disable it
10:20:09Araqthinking about it ... we could detect the need for the cycle collector and disable it automatically but it would add some tracking costs
10:24:01*vlad1777d_ quit (Ping timeout: 260 seconds)
10:25:53*nyeaa joined #nim
10:29:16yglukhovmratsim: do you have a stack trace?
10:29:26yglukhovbecause i have relevant issues
10:31:22FromGitter<mratsim> Lots.
10:31:43Araqstack traces are irrelevant too ;-)
10:31:53Araqthey point to the crash but not to the cause
10:34:14FromGitter<mratsim> Sorry it's a bit of a mess it was so frustrating to try to get a minimum test case without Arraymancer-only procs/datastructure and have the crash disappear for seemingly dumb modifications: https://github.com/mratsim/Arraymancer/issues/178
10:35:09*kunev quit (Ping timeout: 264 seconds)
10:38:00FromGitter<mratsim> @yglukhov : there are some other stacktraces on dealloc and addChunkToMatrix in the IRC logs from the last 4 days.
10:38:08Araqer do you use || without protection?
10:38:39*xkapastel quit (Quit: Connection closed for inactivity)
10:39:47FromGitter<mratsim> Only for non-GC-ed types.
10:40:04*sz0 quit (Quit: Connection closed for inactivity)
10:41:56Araqok
10:42:42FromGitter<mratsim> ref/string/ptr types have a different code path for higher order functions like map/fold, for the function in my report I didn't put the T: SomeReal because it was for benchmarks, I was lazy ;), and exp, `/` are not defined for anything else than SomeReal by default.
10:42:55skrylarAraq, examples should always work or else contain notes about caveats, but in this particular case i mad eit work by telling importcpp to pretend its the base class, and use emit to typecast at in C++
10:43:05skrylarsince the whole interface is just routing some virtual calls from cc to nim
10:54:42*kunev joined #nim
10:58:59*solitudesf joined #nim
11:03:35skrylarsecurehash really should be deprecated and renamed imo
11:03:47skrylari just saw it was moved back. SHA1 is useful, it's just not secure
11:04:00*radagast joined #nim
11:09:43skrylaroh i get why its named that. kind of
11:10:58*marenz__ joined #nim
11:17:08*radagast quit (Quit: radagast)
11:17:26*radagast joined #nim
11:21:40*radagast quit (Client Quit)
11:21:53*radagast joined #nim
11:29:16*Yardanico joined #nim
11:29:37*marenz__ quit (Ping timeout: 248 seconds)
11:38:34*dddddd quit (Remote host closed the connection)
11:42:25skrylarpushed the custom widget support for nfltk online
11:57:52*Vladar joined #nim
12:05:22FromGitter<mratsim> Comparison between ref objects is done by comparing pointer adress or is it deep?
12:07:15Araqpointer address
12:23:26skrylarmratsim: so here's an amusing puzzle; segmenting words in to phonemes without black boxes :)
12:24:21skrylarAraq, came across this, you might find it neat if you haven't already https://swtch.com/~rsc/regexp/regexp1.html
12:26:14FromGitter<mratsim> @skrylar, you’ll pry my black boxes from my dead hands
12:26:21*mostly-harmless joined #nim
12:27:48*Snircle joined #nim
12:27:59skrylarmratsim: eh well in this case i have a partial solution (for segmenting ex. cmudict)
12:28:27skrylarmostly involves nudging borders and checking, although still have to work out 3+ symbol cases and ambiguities
12:31:28skrylaractually the ambiguity case can probably be solved as "if no band can be moved to create a solution, then fork"
12:32:13PMunchmratsim, I looked into getting colours into drawille and I don't think it's going to be as trivial as I was expecting..
12:33:26PMunchI might be able to get around it by requiring that you also specify the color to remove when you want to unset a pixel. But otherwise I'd have to change how the entire system works..
12:33:31*endragor joined #nim
12:36:13FromGitter<mratsim> don’t worry, it’s not my priority
12:36:41FromGitter<mratsim> I think I’ll add OpenCL to Arraymancer in the coming month. It’s been itching me.
12:37:18skrylarwhat is drawille and also i have some color code lying around
12:41:08skrylarprobably should put that on github as well; have done some color space conversion and it was using type safety to prevent accidental mixes across RGB/HSL/HSV
12:42:03skrylarallegedly you can also do color spaces with Adaptively Sampled Distance Fields, which collapses the weird geometry in to an octree
12:44:44*endragor quit (Remote host closed the connection)
12:45:11*endragor joined #nim
12:45:35skrylarmratsim: opencl has been a thing i'm curious about for quite some time, although it is less than easy to get into
12:46:08FromGitter<mratsim> Yeah, Cuda seems much easier, I read some OpenCL but the enqueue/dequeue + context management ugh ...
12:48:01skrylarboilerplate is macro fodder
12:48:11skrylarCUDA is the easier option but i prefer nvidia not be too comfortable
12:48:38skrylarthough opencl also runs on CPU, as well as it runs on FPGAs now
12:49:07FromGitter<mratsim> Argh, seems like the dereference operator is broken when you have a template `[]` that accepts varargs[untyped]: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a3cff425355812e57077092]
12:49:16skrylarthe A-something company that makes one model of them, they added an OpenCL input for their logic synthesizer. So it will convert a kernel to (almost) hardware, albeit less efficiently than verilog
12:49:37FromGitter<mratsim> AMD added “Hip"
12:50:01skrylarfpgas are a thing i want, but they are all super proprietary ;_;
12:50:10FromGitter<mratsim> Hip can compile to AMD ROCm or OpenCL for CPU or Nvidia/AMD GPU (but not Intel GPU …)
12:50:59FromGitter<mratsim> Also it’s easy to port Cuda to Hip, just replace cuda/cu by hip —> cudaMalloc, HipMalloc
12:51:16skrylarDiscovered the Any type. will have to see hwo well that boxes and unboxes
12:51:28skrylarCobweb is theoretically useful but has the issue of it currently relies on JsonNode
12:52:46skrylarthe macro for flatbuffers shouldn't be TOO hard
12:53:05*endragor quit (Remote host closed the connection)
12:54:54skrylarkind of terrified at the state of computer engineering
12:55:25skrylarreading these 15+ year old books and articles on "how to store THINGS in piece tables and weird trees"
12:55:29*endragor joined #nim
12:56:29skrylarhttp://doc.cat-v.org/plan_9/4th_edition/papers/sam/ admittedly, almost everything about plan 9 is gold
12:57:27*nyeaa quit (Quit: leaving)
12:58:13*arecacea1 quit (Remote host closed the connection)
12:58:32*arecacea1 joined #nim
13:03:22skrylarhttps://www.mythic-beasts.com/order/rpi ... lol?
13:07:41*endragor quit (Remote host closed the connection)
13:09:12*floppydh quit (Quit: WeeChat 2.0)
13:10:09*Ven`` joined #nim
13:12:22skrylarmratsim: do you think there should be a warning against using types like "int"
13:12:45skrylarintuition says it should complain if you do, because those types might change size and thus brick your flatbuffer compat
13:14:39*happycoder joined #nim
13:14:41*endragor_ joined #nim
13:17:16*kunev quit (Ping timeout: 260 seconds)
13:18:57*endragor_ quit (Ping timeout: 240 seconds)
13:23:54*yglukhov_ joined #nim
13:24:22*skelett quit (Ping timeout: 255 seconds)
13:25:10*freevryheid joined #nim
13:25:57*yglukhov quit (Ping timeout: 240 seconds)
13:26:19*freevryheid left #nim (#nim)
13:26:37*fvs joined #nim
13:26:41GitDisc<NopeDK> skrylar, while the iCE40 is still a proprietary chip, they have reverse engineered the synthesis and have a fully open source software chain for development if you don't mind using Verilog.
13:29:35skrylarah, lattice. i heard about them once or twice
13:31:23PMunchskrylar, drawille is using unicode braille symbols to draw things in a terminal
13:31:35PMunchBasically turns every character into a 2x4 grid of pixels
13:35:26federico3nice
13:38:08PMunchhttps://github.com/asciimoo/drawille
13:38:22PMunchIt's pretty cool, and I implemented it a while back for Nim
13:42:53*Ven`` quit (Ping timeout: 256 seconds)
13:45:57*Jesin quit (Quit: Leaving)
13:47:23*nsf quit (Quit: WeeChat 1.9.1)
13:58:27*happycoder quit (Ping timeout: 240 seconds)
14:05:42Arrrrthis looks great
14:06:09ArrrrAh, yours is here https://github.com/PMunch/drawille-nim
14:06:20PMunchYup
14:06:36PMunchIt's mostly the same thing, but completely re-implemented
14:06:43PMunchAnd it supports layers :)
14:07:51FromGitter<Varriount> PMunch: No colors?
14:08:23ftsfcoloured braille, sounds like a great invention =)
14:08:24PMunchNot yet, working on it now :)
14:08:55skrylari hav a feeling that color would look like the ZX Spectrum more than anything else.
14:09:07skrylarSpeccy could only apply color in 8x8 pixel regions
14:09:42ftsfmaking a simple Entity Component Architecture system for my game engine and adding networking to it now via enet. Kinda works =)
14:12:24PMunchskrylar, yeah this would apply a color to each 2x4 region.
14:12:45PMunchBut it's going to store all the colours and generate an average
14:13:09skrylarenet can be neat.
14:13:19ftsfit's pretty nice to use
14:13:21skrylarnot doing anything nearly so fun :/ dealnig with flu, and macros to serialize flatbuffers
14:13:23ftsfbut networking is still hard
14:13:24PMunchftsf, enet?
14:13:38skrylarenet is a TCP layer over UDP and was made for Cube/Sauebraten
14:13:44PMunchskrylar, did you see my binary parser?
14:13:46ftsfhttps://github.com/fowlmouth/nimrod-enet http://enet.bespin.org/
14:13:51skrylarPMunch, i hven't
14:13:56skrylarthe same guy (Wouter) also wrote the spec for flatbuffers
14:14:07PMunchhttps://github.com/PMunch/binaryparse
14:14:32PMunchUsage example: https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L623
14:14:59ftsfmy problem currently is when a player connects to the server, the server needs to tell it to spawn all the existing objects. but doesn't know which info is important to send.
14:15:23ftsfwonder if i can annotate that somehow
14:15:55skrylarthe wonders of modern entity systems are neat to develop with, but the old school arena blobs are better to run :|
14:16:16ftsfneed to serialize all the component variables and send them over to the client
14:17:04ftsfI guess the component can know which variables need to be serialized
14:17:34ftsfI'd want to mark them via a pragma in the type perhaps.
14:18:40skrylarthat would be neat if you could put user pragmas on fields :)
14:18:55ftsfimpossible?
14:18:55skrylaryou have to eat the whole type section in a macro to do that ._.
14:19:00ftsf=(
14:19:02ftsfdang
14:19:35skrylari found i didn't NEED pragmas for flatbuffers, so i got by without it. although it occurs to me that one can also just use a macro to hold field layout, which might happen in a later version
14:19:41ftsfI guess just a serialize method on the component will do
14:20:16skrylarright now if you delete a field or re-order in the obejct, you break your compatability (the AST order is used) while having the user specify the order in a separate macro violates dry, it lets you order a struct for yourself and force an order on the wire
14:36:59PMunchCrap, I just remembered that terminals are dumb when it comes to colour..
14:37:38dom96ftsf: enet? Why not try using Nim's sockets? :)
14:38:31ftsfdom96, should probably have a look at those in the future
14:38:34ftsfbut enet is working nice for now
14:39:35ftsfenet has some nice features, but probably easy enough to implement myself over UDP
14:40:41dom96hopefully in the future you'll be able to switch over to Nim's sockets
14:40:52dom96admittedly UDP support is still not the best for async
14:41:09ftsfwill likely be using sync
14:45:09dom96ahh, then it should work perfectly
14:47:25PMunchHmm, can I upconvert an object to an object that inherits from that object?
14:48:17ftsfcat = Cat(animal) ?
14:50:05PMunchresult = ColourCanvas(newCanvas(x, y)) # Illegal object conversion
14:50:32ftsfis ColourCanvas a ref?
14:53:37*marenz joined #nim
14:57:50*dddddd joined #nim
14:58:01dom96yeah, needs to be a ref
14:58:14dom96the error message for that should be improved :)
15:00:24*byte512 quit (Ping timeout: 268 seconds)
15:01:08FromGitter<mratsim> @skrylar yes flatbuffer should store as int64 / float64
15:05:13FromGitter<mratsim> Any serializer with schema should do that actually.
15:15:59*Arrrr1 joined #nim
15:15:59*Arrrr quit (Disconnected by services)
15:16:05*Arrrr1 quit (Client Quit)
15:17:15*happycoder joined #nim
15:19:52*happycoder quit (Remote host closed the connection)
15:20:15*happycoder joined #nim
15:25:06*Jesin joined #nim
15:27:42*Jesin quit (Remote host closed the connection)
15:29:24*Jesin joined #nim
15:29:36PMunchOh, it has to be a ref?
15:30:03dom96yep
15:30:07dom96because all refs are the same size
15:30:13PMunchAh
15:30:15dom96but non-ref objects can have varying sizes
15:30:15PMunchOf course
15:30:44PMunchThat reminds me I should fix up my Reddit post on refs and objects and post it
15:33:32PMunchHuh: http://ix.io/Dij/
15:33:37PMunchCompiler made me some illegal code
15:33:58dom96bug report
15:36:34Araqalready reported, I bet
15:40:47Yardanicoyes
15:41:00PMunchWhat's cousing it?
15:41:08PMunchcausing*
15:44:22Araqdon't use 'var ref Subtype'
15:46:08PMunchHmm
15:46:18PMunchHow do I do that then?
15:47:31*yglukhov_ quit (Remote host closed the connection)
15:47:52PMunchNever mind, figured out how to get around it
15:48:22*yglukhov joined #nim
15:48:33*yglukhov quit (Remote host closed the connection)
15:48:48*yglukhov joined #nim
16:15:43*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
16:25:19*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:29:17PMunchOkay, now drawille-nim has colour support
16:29:46PMunchIt's got a bug where fields with only a single character doesn't show anything but apart from that I think it should work pretty well
16:29:48*PMunch quit (Quit: Leaving)
16:41:34*xet7 quit (Ping timeout: 252 seconds)
16:42:36*xkapastel joined #nim
16:45:02*happycoder quit (Ping timeout: 252 seconds)
16:54:42*xet7 joined #nim
17:03:57*marenz quit (Ping timeout: 264 seconds)
17:04:53skrylarmeh. auto-serialization is half done :\
17:05:16*happycoder joined #nim
17:11:00*claudiuinberlin joined #nim
17:16:15*happycoder quit (Ping timeout: 248 seconds)
17:16:43*marenz joined #nim
17:51:54*yglukhov quit (Remote host closed the connection)
18:04:47*sendell joined #nim
18:12:47*gangstacat quit (Quit: Ĝis!)
18:22:18*yglukhov joined #nim
18:24:05*gangstacat joined #nim
18:25:45*solitudesf quit (Ping timeout: 268 seconds)
18:27:01*yglukhov quit (Ping timeout: 260 seconds)
18:41:00*sendell quit (Remote host closed the connection)
18:41:47*Arrrr joined #nim
18:46:18*cspar joined #nim
18:53:46*natrys joined #nim
18:58:00Arrrrpull request queue is shrinking
18:58:32*sendell joined #nim
18:59:25sendellis there a way to print call site line in callstacks?
18:59:58skrylarwritestackstrace()?
19:01:17sendelli mean on SIGSEV on unchatched exceptions
19:01:58sendelluncatched* :)
19:02:41dom96Just don't compile with -d:release
19:02:57sendellprinted line numbers seems to be called proc first line, not call site line
19:04:13sendellmy question was about line numbers, not enabling or printing call stacks ahah, sorry if unclear :)
19:05:13Araqthat's just a bug, I think
19:06:06sendelloh it might be, I was surprised to not have noticed it earlier
19:09:05sendellworks as expected on a simple example, so yeah it's a bug
19:10:57*yglukhov joined #nim
19:11:36sendellis it a known bug? should I try to report it?
19:12:06Araqyeah that would be nice
19:13:09sendelli'll try to do that :)
19:13:16sendellbrb
19:13:31*sendell quit (Remote host closed the connection)
19:15:44*yglukhov quit (Remote host closed the connection)
19:16:02*yglukhov joined #nim
19:19:30dom96I wonder why there is so much kitchen sink spam: https://i.imgur.com/NxW5hmN.png
19:20:36*yglukhov quit (Read error: Connection reset by peer)
19:21:12*yglukhov joined #nim
19:21:45*cspar quit (Ping timeout: 256 seconds)
19:32:51federico3that would be a good name for the pkg directory
19:33:30dom96hah
19:33:37dom96That's true :)
19:41:36FromGitter<mratsim> @Araq will we have ``opt`` in 0.18?
19:47:04Arrrr"keep up the great work" that's encouraging
19:47:15ArrrrI need motivational spam in my life
19:55:26*solitudesf joined #nim
20:03:10*sendell joined #nim
20:04:01*scriptum joined #nim
20:04:37Araqdom96, probably because one of my blog posts uses 'sink'
20:06:48Araqmratsim, no.
20:07:22YardanicoAraq, btw, will 1.0 be after 0.18.0? after new year it seems?
20:07:42FromGitter<mratsim> ok
20:07:59YardanicoWell 1.0 doesn't really matter for me, I'm just asking
20:08:34FromGitter<tim-st> Is there a way I can use namedtuple B which has all named fields like namedtuple A but more types than namedtuple A for a proc that takes only namedtuple of type A ?
20:09:12dom96Yardanico: Even Araq doesn't know an answer to this.
20:09:29dom96not 100% at least :)
20:09:51dom96tim-st: nope
20:10:05FromGitter<tim-st> hm, ok, thanks.
20:10:05Yardanicodom96, yeah, I know, there's too many different things that need to be taken into consideration
20:11:00FromGitter<tim-st> @dom96 Is that a feature, or not implemented yet? atleast it should work, or not?
20:11:12YardanicoI don't think it should work
20:11:36FromGitter<tim-st> That would allow easy inheritance for final types
20:11:36dom96It shouldn't work.
20:11:40Araqsubtyping only really works with pointers, tuples are not pointers
20:11:56Yardanicotim-st: tuple is just a struct at C level
20:11:58dom96You can write a macro that makes it work if you wish
20:12:46FromGitter<tim-st> @Yardanico yes, I know, that make me wonder why my scenario didn't work, now I need inherited object, which is not constant
20:13:46dom96The reason primarily is that Nim is statically and strongly typed
20:14:40FromGitter<tim-st> @dom96 Ok, that was my assumption, but it could work at least in theory
20:15:27*natrys quit (Ping timeout: 248 seconds)
20:15:33Araqyeah FP languages tend to support it
20:24:59*Vladar quit (Quit: Leaving)
20:26:33FromGitter<nitely> @tim-st you can always have just one tuple and a `kind` field for storing the sub "type". That's if you really need const
20:28:38*natrys joined #nim
20:28:40FromGitter<nitely> just fill the expected fields for each `kind`
20:30:10dom96You can also just use a hash table
20:30:57FromGitter<nitely> kinda like having a object variant, except those don't work with const AFAIK
20:31:09*Yardanico quit (Quit: Leaving)
20:31:34*Yardanico joined #nim
20:36:27skrylari remember somenoe made a spec for "rebol object notation"
20:36:47skrylarit was kind of neat.
20:36:58FromGitter<tim-st> ok, thanks will try it; yes object variants cannot be const. I had an idea how my scenario could be supported: if all fields in tuple B are in tuple A than the proc can take tuple B too, when the compiler copies internally the proc with type A and just changes the type to tuple B, like internal overloading
20:38:41dom96Are you sure object variants cannot be const?
20:39:20FromGitter<tim-st> yes, I tried it. Otherwise I wouldnt switch from object to tuple
20:39:28FromGitter<nitely> I tried and they work in the global scope but not inside procs if IIRC
20:39:33GitDisc<NopeDK> Is there any way to have inheritance in the project.nim.cfg files? I am thinking something like an include statement or multiple files so you can separate changeable parameters from dynamically created ones.
20:41:10Araquse project.nims and Nim's include statement
20:43:01GitDisc<NopeDK> Thanks, will look into those.
20:43:29sendellshouldnt consts behave exactly the same in global and proc scopes? the only difference being visibility restrictions
20:45:45FromGitter<nitely> AFAIK yes. I'll try again on devel. Maybe I tried on stable where objects didn't work at all...
20:46:03FromGitter<nitely> *for consts
20:46:44FromGitter<tim-st> are const objects supported in a development release?
20:47:50FromGitter<tim-st> I mean const inherited objects, const object without inheritance work
20:48:08*marenz quit (Ping timeout: 252 seconds)
20:48:39FromGitter<nitely> I just tried it on devel and I get `Error: invalid type for const`, so object variant can't be consts
20:49:02FromGitter<tim-st> Yes, I got the same error when I tried it
20:49:34Yardanicoyes, they still can't be constants and there's an issue about that on github
20:50:55FromGitter<tim-st> For me it would be good enough if "tuple inheritance" as described would work
20:51:12FromGitter<nitely> @tim-st when I say devel I mean the unreleased/in development version of Nim. That version supports object const
20:51:25sendellbtw what would be the practical differences if using a let object instead of const object?
20:51:38sendellof using*
20:51:46FromGitter<tim-st> @nitely Yes, I know, I took the wrong word unfortunately
20:51:54Yardanicosendell, https://nim-lang.org/docs/manual.html#statements-and-expressions-const-section
20:52:05Yardanicoabout constants :)
20:52:08sendellthx
20:52:25Yardanicowell for example compiler can inline a lot of things
20:53:11Yardanicodocs are a bit outdated though (because they're for 0.17.2)
20:54:41dom96why do you even need a const for this?
20:57:08FromGitter<nitely> In my case, I want to compile regexes at compile time. And store the AST as a seq of Nodes (use indices for children nodes)
20:57:32*nsf joined #nim
21:01:41sendellYardanico: ok for compile time evaluation, that's a requirement. But I guess the compiler could inline let object too?
21:01:47*marenz joined #nim
21:02:28Yardanicosendell, "let" means that object is constructed at runtime AFAIK
21:02:46Yardanicowell C compiler can inline a lot of things too
21:07:07sendellyeah but its adress is known at compile time, so member addresses can be inlined, whether its constructed at compile or runtime. I might have missunderstood what you meant by "inlining"
21:09:03*xkapastel quit (Quit: Connection closed for inactivity)
21:09:37dom96nitely: that's a good use case, and we should ping Araq about it
21:10:19dom96nitely: how is the regex engine going otherwise?
21:10:28dom96Is the source code in a repo somewhere?
21:10:42FromGitter<nitely> almost done
21:10:50FromGitter<nitely> nop
21:11:48Yardaniconitely: so it's pure nim?
21:11:51FromGitter<nitely> I mean almost in usable state :D
21:12:09FromGitter<nitely> yes, it's pure nim
21:12:29Yardanicowow, nice
21:13:07*xkapastel joined #nim
21:14:06Araqhmm? what feature? I don't understand
21:14:55YardanicoAraq, compile-time object variants
21:14:59*scriptum quit (Quit: Leaving)
21:15:03YardanicoI mean constants
21:17:10FromGitter<nitely> btw, I don't really need those, I can use plain objects or tuples. They would be nice though
21:19:23GitDisc<NopeDK> The question is, what benefit does regex have over the already pure pegs? (Except syntax and non greedy behavior)
21:21:23Yardanicopeople are used to regexes :P
21:21:30Araq^^ yup.
21:22:58FromGitter<alehander42> I really hate that there hasn't been solidified some kind of semi standard grammar syntax
21:23:20FromGitter<alehander42> each parser generator and parser lib uses its own dsl or dialect of something kinda like ebnf
21:23:54GitDisc<NopeDK> Good point. Was actually gunning for pegs to remain semi pure in my wip module but if regex is what the people want and use...
21:23:58*sendell quit (Remote host closed the connection)
21:27:55Araqregexes really suck though, does '.' match a newline or not, why can't I use spaces to make things more readable ugh, I cannot even match balanced brackets
21:29:10FromGitter<alehander42> that's one of the things I liked about perl6, they had some kind of grammar literals
21:29:17FromGitter<alehander42> maybe if they had them in 1990
21:29:23FromGitter<alehander42> people would be more open
21:38:41radagast Policy based design (Traits) and Curiously Recurring Template Patterns are the two weapons for solving the overhead involving dynamic dispatch
21:53:18dom96ooh, the elapsed time shown in testament is sexy
21:56:08*Yardanico quit (Read error: Connection reset by peer)
21:56:25*Arrrr quit (Quit: Leaving.)
21:56:30dom96nitely: do you plan on making the source code available?
21:59:24FromGitter<nitely> yes!
22:00:40FromGitter<nitely> next week probably
22:02:23*vlad1777d_ joined #nim
22:03:01dom96awesome, ping me when you do :)
22:08:31FromGitter<Varriount> radagast: I dare you to say "Curiously Recurring Template Patterns" 10 time fast. :P
22:15:53GitDisc<NopeDK> Any pics of testament's output?
22:19:25*Jesin quit (Quit: Leaving)
22:20:32dom96you can see it here https://travis-ci.org/nim-lang/Nim/jobs/320402543#L2566
22:20:50dom96I love it
22:24:35GitDisc<NopeDK> Damn, that is indeed nice looking
22:29:01*nsf quit (Quit: WeeChat 1.9.1)
22:29:53*solitudesf quit (Ping timeout: 256 seconds)
22:33:58*arthurz quit (Quit: Leaving)
22:38:46*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:42:44*Trustable quit (Remote host closed the connection)
22:43:48*SenasOzys quit (Remote host closed the connection)
22:50:09radagast@Varriount CRTP CRTP CRTP CRTP CRTP CRTP CRTP CRTP CRTP CRTP :D
23:11:48*happycoder joined #nim
23:12:07GitDisc<NopeDK> So with a project.nims I can define a "task build" with whatever I want in the body for switches and when someone runs "Nim build"(or does it need " project"?) it would execute the script and underlying commands? And end it with "setCommand c" for it to automatically compile the project?
23:36:37dom96you might want to consider using Nimble for that.
23:39:57*MJCaley joined #nim
23:40:12*MJCaley quit (Client Quit)
23:53:27*happycoder quit (Ping timeout: 240 seconds)
23:57:46*marenz quit (Ping timeout: 260 seconds)
23:58:53*derlafff quit (Remote host closed the connection)
23:59:33*derlafff joined #nim