<< 19-07-2019 >>

00:02:05*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:02:28*shomodj joined #nim
00:02:51*shomodj quit (Client Quit)
00:17:22*theelous3 quit (Ping timeout: 246 seconds)
00:20:52*sentreen quit (Ping timeout: 272 seconds)
00:26:18*yeetcannon quit (Remote host closed the connection)
00:26:25*yeetcannon joined #nim
00:30:35*yeetcannon quit (Remote host closed the connection)
00:36:13*theelous3 joined #nim
00:39:36*yeetcannon joined #nim
00:48:39*AmbitiousSparrow joined #nim
00:54:17*AmbitiousSparrow left #nim ("Leaving...")
01:14:49*dgreen joined #nim
01:44:11*yeetcannon quit (Remote host closed the connection)
01:44:22*yeetcannon joined #nim
02:05:39*snuffdtek quit (Remote host closed the connection)
02:30:07FromGitter<awr1> question: can a `set[T]` (given that `T` is an enum set to an appropiate `{.size.}`) be safely used for C interop in lieu of or'ed bit flags
02:31:34*dddddd quit (Read error: Connection reset by peer)
02:33:59*dgreen quit (Remote host closed the connection)
02:38:29FromGitter<awr1> http://ix.io/1OSe/nim
02:38:30FromGitter<awr1> hm
02:38:43FromGitter<awr1> both are false
02:42:36FromGitter<awr1> wait i'm stupid, enums should start at 0
03:08:41*lritter quit (Ping timeout: 268 seconds)
03:09:20*lritter joined #nim
03:15:35FromGitter<jwollen> yes, that works as expected. but you need to specify `{.size.}` on the `set`type. on the `enum` won't affect the set
03:17:34*lritter quit (Ping timeout: 272 seconds)
03:40:36FromGitter<jwollen> but your enum values will not correspond to the bits set. they will get remapped to some bit depending on the min/max and holes in your enum. the safest way is to not use explicit values. with `enum A, B, C`, the bits will be the 1st, 2nd 3rd respectively (corresponding to bitmasks 0x1, 0x2, 0x4 in the set)
03:45:05FromGitter<jwollen> (so on the nim side don't use `or` on the ordinal values. use `{ A, B, C }` and pass the set to C directly)
04:04:12*nsf joined #nim
04:09:03*lritter joined #nim
04:21:29*fjellfras joined #nim
04:24:45FromGitter<awr1> yeah it seems to be just used a shifting value
04:28:01*dgreen joined #nim
04:36:05FromGitter<awr1> https://nim-lang.org/docs/system.html#%40%2Carray%5BIDX%2CT%5D
04:36:16FromGitter<awr1> i don't get why `string` works here
04:36:29FromGitter<awr1> shouldn't it only accept `array[]`
04:55:32*xet7 quit (Quit: Leaving)
05:21:00*snuffdtek joined #nim
05:38:49*solitudesf joined #nim
05:39:28Araqawr1: so strange... agreed
05:40:22Araqproc `@`*[T](a: openArray[T]): seq[T] # reason this works
05:47:32*cornfeedhobo quit (Ping timeout: 245 seconds)
05:48:40*bozaloshtsh quit (Read error: Connection reset by peer)
05:48:47*oz quit (Ping timeout: 245 seconds)
05:48:48*bozaloshtsh_ joined #nim
05:48:55*oz joined #nim
05:49:22*narimiran joined #nim
05:49:37*Summertime quit (Ping timeout: 245 seconds)
05:50:09*absolutejam joined #nim
05:51:08*Summertime joined #nim
06:16:06*cornfeedhobo joined #nim
06:25:40leorizeawr1: https://nim-lang.org/docs/manual.html#set-type-bit-fields
06:29:22*theelous3 quit (Ping timeout: 248 seconds)
06:30:49*actuallybatman quit (Ping timeout: 246 seconds)
06:32:24FromGitter<awr1> thanks
06:34:05*brakmic joined #nim
06:37:55*brakmic quit (Remote host closed the connection)
06:38:35*brakmic joined #nim
06:44:19*dgreen quit (Remote host closed the connection)
06:48:25*absolutejam quit (Ping timeout: 258 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:03:57Zevvleorize here?
07:04:02*absolutejam joined #nim
07:04:02Zevvoh yes just 2 msg up :)
07:04:06leorizeo/
07:04:35*gmpreussner joined #nim
07:05:04Zevvso, this vim stuff. I did some vimscript plugins many years ago. The scar tissue has finally settled so I should be able to touch that stuff again.
07:05:27ZevvI'm basically only interested in the nimsuggest jump-to-definition stuff. Indenting already works like a charm, and code formatting is for pussies.
07:05:51ZevvWhat would be the way to go - just put the stuff in vim8 and see where the smoke comes out?
07:06:11leorizeso first you'd need to port the querying function over
07:06:15Zevvs/formatting/highlighting/
07:06:20leorizeit's in autoload/nim/suggest/utils.vim
07:06:24Zevvok
07:06:40leorizeyou should look at nim#suggest#utils#Query
07:07:19leorizeah, not that easy yet :P
07:07:50ZevvI didn't expect it to be easy :)
07:07:50leorizethe first magic is in autoload/nim/suggest.vim
07:07:58leorizeyou need to port the sockconnect() over
07:08:04leorizein nim#suggest#Connect
07:08:20leorizenot sure what's the equivalent in vim
07:08:26leorizehas('nvim') is your key here
07:08:40Zevvright. I can stub some python in if needed for the socket stuff
07:08:41*krux02 joined #nim
07:08:49leorizenope
07:09:09Zevvwhy not? I can just call python from vimscript iirc?
07:09:16ZevvI did it with Lua anyway
07:09:20Zevvassume python is similar
07:09:35leorizeI don't have experience w python and I'd like to keep the deps down
07:09:45leorizealso nvim and vim's socket interface is nice
07:10:29leorizemost of the response processing code is already in vimscript
07:10:41Zevvok, that should get me started
07:10:43narimiranZevv: come on, just use neovim :)
07:10:43Zevvthanks
07:11:03ZevvI can't, I'm dutch
07:12:38leorizeis there any vim8 docs online?
07:13:23Zevvhttps://vimhelp.org/
07:13:32leorizethanks
07:13:53leorizenarimiran: there are more stubborn vim users that I thought :p
07:15:55*Vladar joined #nim
07:16:07Zevvq:
07:17:08*ng0 quit (Quit: Alexa, when is the end of world?)
07:17:33leorizedamn, vim got some goodies here
07:17:49leorizetheir channel interface is definitely better
07:17:57Zevvsee :)
07:23:15leorizeZevv: alright, so nim#suggest#Connect() is just a thin wrapper over whatever connect channel there's
07:23:45leorizefor vim use ch_open()
07:23:55Zevvsweet
07:24:09Zevvok, need to work first, but will pick that up later today. thanks so far!
07:24:28leorizenp
07:24:35narimiranleorize: oh come on, don't help him with his silliness, make him see the light and start using nvim :P :D
07:25:28narimiran...and then later on you can join the forces and make even better nvim plugin, instead of having two similar ones
07:25:49ZevvLike I said, I can't: I'm dutch. So is Bram.
07:26:06leorizenarimiran: it's just a few conditionals (hopefully) :p
07:26:34leorizebut Zevv will have to maintain it 3:)
07:26:50ZevvI can maintain a few conditionals I guess \o/
07:26:52leorizeand if he got tired of that he can use nvim instead :)
07:27:12Zevvnvim is just silly. I put in my default .vimrc and stuff is just different
07:27:13FromGitter<alehander42> oh docker and ci is such a thing, i dont look forward to it, but its like "fun" when you get into it
07:27:37narimiranZevv: s/different/better
07:27:52Zevv09:17 < leorize> damn, vim got some goodies here
07:28:03leorizejust in the channel interface :P
07:28:35leorizetheir codebase is still a mess
07:29:20ZevvVim is like pigeons - all dinos went extinct, but pigeons just adapt like flying rats. They stick, carry nasty diseases and steal your food, but they know how to keep on going
07:29:38Zevv/stick/stink/
07:31:59Zevvok, I will give nvim one more try then. one more.
07:43:47*lritter quit (Ping timeout: 245 seconds)
07:45:34*absolutejam quit (Read error: Connection reset by peer)
07:45:47*absolutejam2 joined #nim
07:52:35*Jjp137 quit (Read error: Connection reset by peer)
07:53:18*Jjp137 joined #nim
08:08:24FromGitter<alehander42> i love pigeons
08:15:58FromGitter<mratsim> btw @Araq, any ideas why I needed new type hints for closure for 0.20 compat? https://github.com/mratsim/Arraymancer/pull/349/files
08:19:35narimiran@mratsim btw, i think i remember that part of the code, it broke when i tried to remove long time ago deprecated `map` :)
08:20:07narimiranbasically, that is the only reason why the deprecated `map` is still in the stdlib :)
08:20:16FromGitter<mratsim> The display is one of the worse part
08:20:31*floppydh joined #nim
08:20:51FromGitter<mratsim> I want to rework it in a much nicer way
08:22:05FromGitter<mratsim> The best way to display tensors I have found is in hTensor, in page 3: http://dis.um.es/profesores/alberto/material/hTensor.pdf
08:22:38FromGitter<mratsim> However I read the Haskell code and was lost the various function compositions :D
08:23:19FromGitter<mratsim> maybe I should compile the Haskell code to C ...
08:34:15Araqwe changed the compilation pipeline
08:34:33*NimBot joined #nim
08:39:38*shomodj joined #nim
09:03:35*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:22:51krux02@mratsim: do your tensors have compile time information about the dimensions?
09:23:03FromGitter<mratsim> no
09:24:54FromGitter<mratsim> That was actually one of the main reason I started Arraymancer over linalg, see very old discussion here: https://github.com/unicredit/linear-algebra/issues/5#issuecomment-302961247, section "Why no static parameter or array in the type"
09:25:33FromGitter<mratsim> I did try, and raised plenty of `static` bugs for @zah's delight at the time
09:27:12krux02yea
09:27:15krux02that is sad
09:27:31krux02I did a tensor contraction library in the past as well
09:29:02FromGitter<mratsim> For contraction, Arraymancer now has einsum thanks to @Vindaar: https://github.com/mratsim/Arraymancer/blob/master/tests/tensor/test_einsum.nim#L45
09:29:10krux02mratsim: that is the code I was working on http://ix.io/1OTc
09:29:20FromGitter<mratsim> ^ example of Matrix Vector as a einsum contraction
09:30:09krux02yes I can see
09:30:14FromGitter<mratsim> Ah I see
09:30:29FromGitter<mratsim> I also needed `:=` operator at one point
09:30:54FromGitter<alehander42> what doe sit do
09:30:59krux02but for those complex examples it was necessary to know the (approximate) tensor dimensions at compile time, because you want to avoid to span big intermediate tensors
09:31:26FromGitter<mratsim> I'm generalizing einsum at the moment, that's what my compiler project is doing: https://github.com/numforge/laser/blob/master/laser/lux_compiler/lux_dsl.nim#L52-L71
09:31:33krux02yea I see it as a failed project
09:31:39FromGitter<mratsim> @alehander42 it automatically creates loop
09:31:47krux02too many bugs in Nim at the time. But the idea is solid though
09:32:08AraqI'm still not sold on the idea
09:32:22FromGitter<alehander42> huh, i see
09:32:28Araqtensors work better when you ignore their ranks
09:32:42FromGitter<mratsim> you can check that @alehander42: https://www.researchgate.net/figure/A-3x3-blur-filter-in-Halide-with-scheduling-examples-Resulting-loop-nests-are-shown-as_fig1_319383345/download
09:32:58FromGitter<mratsim> basically you only mention the loop indices and it creates the loop for you
09:33:05*shomodj joined #nim
09:33:12FromGitter<alehander42> i see, the syntax confused me
09:33:31FromGitter<alehander42> as usually `:=` introduces a new variable as an alternative to `<spec> <name> = `
09:33:43FromGitter<alehander42> thanks for the link!
09:34:04FromGitter<mratsim> I put some example here as well: https://github.com/numforge/laser/tree/master/laser/lux_compiler/core#note-on-function-vs-tensors
09:34:12krux02yea I introduced that syntax, because it is my DSL
09:34:34krux02let W[b,m,j,e] = ... is not valid nim syntax
09:35:43krux02the reason wy you should know the dimensions at compile time for optimizations is simple
09:36:18krux02rowVector ⋅ columnVector ⋅ rowVector
09:37:30krux02you want the optimizer to know that ((rowVector ⋅ columnVector) ⋅ rowVector) uses much less intermediate memory than (rowVector ⋅ (columnVector ⋅ rowVector))
09:38:44FromGitter<mratsim> Now beyond the einstein summation / easy tensor contraction. The real interesting part is facilitating optimization like multithreading, vectorization, caching intermediate result, fusing loop, using GPU. ⏎ ⏎ For example, here is an advanced blur filter with pure CPU, CPU + caching intermediate result, GPU computing: https://github.com/halide/Halide/blob/7b971be4bcb61ffab0d5cc
09:38:44FromGitter... fe56ca264d2dddc014/apps/blur/halide_blur_generator.cpp#L40-L65
09:41:24FromGitter<mratsim> And in terms of performance, the Halide DSL allows to reach the speed of hand-tuned assembly from Intel or Nvidia.
09:41:36FromGitter<mratsim> but in a couple dozens of line or so.
09:41:40*fjellfras quit (Read error: Connection reset by peer)
09:42:01*fjellfras joined #nim
09:43:30krux02yea, that one exceeds my knowledge in GPU computing
09:56:43*absolutejam2 quit (Ping timeout: 245 seconds)
09:59:40*stefanos82 joined #nim
10:05:12*fjellfras quit (Read error: Connection reset by peer)
10:05:17*fjellfras_ joined #nim
10:10:38*absolutejam2 joined #nim
10:37:06*fjellfras_ quit (Quit: Leaving)
10:52:31*theelous3 joined #nim
10:59:53*solitudesf quit (Ping timeout: 258 seconds)
11:07:43narimiran"<Zevv> ok, I will give nvim one more try then. one more." ...and we never heard back from him :)
11:13:39lqdev[m]maybe he couldn't exit vim :kappa:
11:17:33narimiran:P
11:26:59ZevvI gave up. It is folding on indent by default and I have *no clue* where this come froms
11:27:32Zevvlqdev[m]: This has been my email signature for the last 20 years:
11:27:34Zevv---
11:27:34Zevv--
11:27:34Zevv:wq
11:27:35Zevv^X^Cy^K^X^C^C^C^C
11:47:37Zevvok ok ok I switched
11:47:59narimirando we need to congratulate now?
11:48:06Zevvyes please
11:48:15narimiranZevv: congrats on your switch!
11:48:32*Zevv refuses to say "thank you"
11:48:33Zevvthis is hard
11:48:37Zevvyou know
11:49:03Zevvstrange things happening in my life these days. Yesterday I spent coding C++, and I was having fun.
11:49:08Zevvnot sure if I'm really ok
11:50:21FromGitter<alehander42> c++ can be nice if you use a subset
11:50:36FromGitter<alehander42> (disclaimer: opinion of a guy that doesnt really get c++ )
11:50:36FromGitter<ahcm> Only which subset? ;-)
11:50:59FromGitter<alehander42> a suprising one
11:51:01narimiranonly the first plus
11:51:12FromGitter<alehander42> yea
11:51:15FromGitter<alehander42> :)
11:51:33*dddddd joined #nim
11:54:19*PrimHelios quit (Ping timeout: 258 seconds)
11:56:09*PrimHelios joined #nim
11:56:12*Cea joined #nim
11:56:58*clyybber joined #nim
11:57:09CeaUploaded file: https://uploads.kiwiirc.com/files/fae73057e4ae743a5a69d288819a0dbe/pasted.txt
11:57:12Cea@shashlick Here's my templite.nim
11:57:45*clyybber quit (Client Quit)
12:02:08*clyybber joined #nim
12:19:17*nsf quit (Quit: WeeChat 2.4)
12:29:31clyybberAraq: Regarding your proposal from yesterday, is it really memory safe to do that?
12:29:49clyybberIt works here: http://ix.io/1OTt/c, but I don't know if thats defined behaviour
12:30:16clyybberI'm talking about never passing the right argument of `=` by ref
12:33:42clyybberUgh, wrong link, this is the one: http://ix.io/1OTM/c
12:42:59Zevvleorize: Ha! https://forum.nim-lang.org/t/5029 :)
12:43:35narimiranZevv: yeah, i thought that might be you. but this was posted after you said you made the switch :)
12:43:52ZevvMe and my alter ego
12:44:59Araqclyybber, that C code is bonkers
12:45:10AraqNIM_NIL is not for 'int'
12:47:55Araqclyybber, also, sorry, but I think we should stop working on =move
12:48:22Araq=sink can be fixed and is good enough for v1
12:49:18Araqand the spec should follow the reality, not mandate something that wasn't tested as much
12:51:37FromGitter<zah> what is the difference between =sink and =move, I've missed the discussions. Any links?
12:52:42Araqdoc/destructors discusses the problem with =sink
12:53:17Araqin a nutshell, =sink cannot propagate the piece of information "this was a self assignment"
12:53:36Araqso self assignments shouldn't be transformed to moves
12:54:35clyybberAraq: I don't think we should stop working on =move without doing benchmarks and seeing if its worth it
12:55:09clyybberAraq: Yeah, that code is bunkers, but it illustrates the issue.
12:55:24clyybberAraq: How can =sink be fixed?
12:56:16Araq=sink is not produced for self-assignments
12:56:45clyybberI believe that was my original proposition before starting to work on =move
12:57:13Araqwell I don't know. 'x = x' is easy enough to simply forbid
12:57:32Araqswap(x, x) is not mapped to moves anyway.
12:57:44Araqthat leaves us with 'x = f(x, ...)'
12:58:20Araqwhich uses some temporary in practice and so it works (not sure if I remember correctly)
12:58:56Araq=move is more elegant though, at least in the spec
12:59:03clyybberI agree
12:59:04Araqfewer rewrite rules and no magic 'wasMoved' state
12:59:18Araqso ok, work on benchmarks then ;-)
12:59:38Araq=move also maps exactly to C++, but it shouldn't matter much
12:59:49clyybberYep, thats what I'm gonna do, right after I fix that NIM_NIL issue
13:00:02clyybberAraq: Yeah, it generates pretty clean CPP code
13:00:17Araqbut in the meantime the spec doesn't reflect reality and I don't like that
13:01:21clyybberJust add "newruntime is still in flux, and things will and can change until the design is fleshed out.
13:01:36clyybberand tell people to *not* actually use it yet
13:03:05Araqpeople should use it, we won't find all the bugs otherwise
13:03:16Araqit's quite simple to do
13:03:24clyybberafter its ready, I can assure you, my implementation will have enough bugs :p
13:03:29Araqwhen defined(nimMoves):
13:03:37Araq proc `=move`
13:03:38Araqelse:
13:03:42Araq proc `=sink`
13:04:14Araqmoves are important but you don't really write them, they are composed out of existing moves
13:12:46*tiorock joined #nim
13:12:46*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
13:12:46*tiorock is now known as rockcavera
13:12:46*rockcavera quit (Changing host)
13:12:46*rockcavera joined #nim
13:28:40disruptekZevv: does npeg know how to import a peg from another type, or is it only able to consume the grammar as nim source constructed with the macro?
13:28:57disrupteki'm trying to avoid transcribing a grammar.
13:30:01Zevvdisruptek: if i understand right, you want to reuse a peg as a building block in another peg, right?
13:31:51disruptekyeah, i'd like to parse yaml with it, but i'd rather use someone else's grammar definition.
13:32:19FromGitter<mratsim> parsing yaml is quite involved
13:32:21*synshroud quit (Quit: ZNC 1.7.4 - https://znc.in)
13:32:22disruptekand, i'm aware there's a nim yaml -- i cannot use it at compile time.
13:32:39disruptekmratsim: hence my desire to leverage. ;-)
13:32:50Zevvdisruptek: yaml is indent-based, which is not trivially peggable
13:33:04FromGitter<arnetheduck> it's very simple - you convert yaml to json, then parse json :)
13:33:25FromGitter<mratsim> but to convert yaml to json you need a compile-time yaml parser :p
13:33:25disruptekthere's a pegex written for it -- i believe by the original yaml author, a perl guy.
13:33:34Zevvlink?
13:33:46Zevvanyway, npeg supports npeg syntax, which is not any other syntax
13:33:50disruptekhttps://github.com/ingydotnet/yaml-pegex-pm/blob/master/share/yaml-pgx/yaml.pgx.json
13:33:56ZevvI could add additional parsers, but that kind of defeats the purpose
13:34:24clyybberdisruptek: Why does it not work at CT?
13:34:36disruptekoh, i dunno, there seems to be a use-case. but, maybe it won't be so hard to write a pegex parser. :-P
13:35:00disruptekclyybber: the author answered that question in an issue 3 weeks ago; please hold for link. :-)
13:35:02FromGitter<arnetheduck> `gorge("yq . filename.yaml")`
13:35:21disruptekhttps://github.com/flyx/NimYAML/issues/70
13:35:33Zevvleorize: discuss nim.nvim here or somewhere else?
13:35:33disruptekarnetheduck: yeah, i know.
13:35:39clyybberdisruptek: Ah, I found it
13:36:43FromGitter<arnetheduck> nilyaml looks pretty dead though, by the commit list.. no activity by author in 6 months except a merge of some tiny fixes
13:36:56disruptekit's not ideal, no.
13:37:02FromGitter<mratsim> flyx said that it's maintenance mode and people are free to take over
13:37:10clyybberIt also looks a bit misdesigned, if it can't work at CT. Theres better ways to write an efficient lexer
13:37:29FromGitter<mratsim> The issue is that streams don't work at compile-time
13:37:36clyybberThey do now afaik
13:37:56FromGitter<mratsim> but Nim is probably the only language where people say that something not working at compile-time is misdesigned :P
13:38:15disrupteki know, right?
13:38:52clyybberOk, I should rephrase.. Its not misdesigned, but not designed with this change in mind: https://github.com/nim-lang/Nim/pull/10746
13:40:40disruptekitym not designed with nim in mind.
13:48:46krux02I think eventually we might get away from representing values as Nodes at compile time, giving them the exact same layout as at runtime
13:49:33krux02it is not being worked on right now, but I think it is possible
13:49:45krux02then all pointer based interfaces will also work at compile time.
13:49:55disruptekkrux02: you're blowing my mind right now.
13:50:11*noonien joined #nim
13:52:20krux02hey it is not a promise
13:52:27krux02it is just something that I think should be done
13:52:54clyybberkrux02: Like running C code at CT with tinyc ?
13:53:53krux02I don't really know if that is comparable
13:54:04clyybberIt would have the same effect
13:54:19krux02AFAIK tinyc is just a small C compiler, not a C interpreter
13:54:36clyybberYeah, but it can be used as such, because its compile time is so fast
13:54:41krux02the nimvm will stay a bytecode interpreter
13:54:57krux02it is just the way how object values are layed out in memory that I would change
13:55:25disruptekthat's how i feel about my brain.
13:55:33krux02currently they are stored as NimNode, coming directly from what the parser/semchecker returns
13:55:41krux02I think it was used, because it was easy
13:55:48disruptekditto.
13:56:03krux02but because the memory layout is so different I don't think we should continue to do so forever.
13:56:37krux02At some point I just think it is worth to pay the price and try to mimic the memory layout of C.
13:56:55krux02I didn't write the offsetof/alignof for nothing
13:57:40krux02as long as we don't directly import types from C headers, we know the memory layout of all objects.
13:58:08disruptekit'd be hard to make this thing work if we didn't.
13:58:55clyybberBut why use addr and the like at CT at all?
13:59:19clyybberIts never necessary, the language is turing complete without it
13:59:20krux02clyybber: what do you mean?
13:59:37krux02that is such a theoretical argument.
14:00:04krux02the answer is of coures, because you want to run code at compile time that was designed to be executed at runtime
14:00:10FromGitter<arnetheduck> been thinking about something like that for nlvm - ie ripping out the nimvm and using llvm jit instead - that would be a very practical way to get the same layout without quirks :)
14:00:37krux02nope not with me on board
14:00:38disruptekthat's a neat idea.
14:00:58krux02I really don't like the idea to rip out the idea of the nimvm. I think it would break too many things.
14:01:12FromGitter<arnetheduck> it's fine, it's nlvm and not nimc
14:02:14disruptekdifferent strokes. how hard would it be?
14:02:26FromGitter<arnetheduck> it would simplify a lot of things I suspect : you'd have to clean up and create a layer/api between what is computation and what is ast manipulation.
14:02:57krux02I have no experience in nlvm, also I am not a fan of introducing more dependencies to the compiler.
14:04:00FromGitter<arnetheduck> it's probably not a good idea for the upstream compiler, no, but it's one way that compile-time could be made faster and perhaps simpler because now there's only one IR to execute instead of two
14:04:41disrupteki think it's a really cool concept worth noodling with.
14:04:52FromGitter<arnetheduck> ie it would make sense if you have an llvm backend already - no need to have to IR's in there - but nimc doesn't so it's a non-starter there
14:05:49noonienhello folks!
14:06:00noonienare there any example of udp client/servers using async UDP?
14:06:05FromGitter<arnetheduck> disruptek, I'll take that patch any day :)
14:06:24disruptekwere it that easy. :-(
14:09:16disruptekthe problem with having a syntax like `makeMeAnOpenAPI: "somefile.yaml"` is that you can't actually see any of the generated symbols in your editor, right?
14:10:01FromGitter<arnetheduck> that's the problem with all macros: to understand them, *you* have to become the MV
14:13:16krux02disruptek, not really
14:14:04krux02all my (more complex) macros have a debug argument to print all symbols they generate
14:15:15krux02I have seen a c++ code editor that was able to show macro expansions in the editor (KDevelop). This could be done in Nim as well.
14:16:53disruptekwell, source code is a great way to convey syntax and semantics to programmers, so i guess this is going to be "not designed with nim in mind" also.
14:21:41Cadeywere concepts removed from tne nim manual?
14:23:02dom96move into the experimental manual
14:24:08Cadeyi can't find it. link?
14:25:01FromGitter<kaushalmodi> https://nim-lang.github.io/Nim/manual_experimental.html#concepts
14:28:54disruptekbut is the current thinking that concepts are broken?
14:29:54krux02yes
14:33:48noonienis there a SockAddr outside winlean?
14:33:59noonienor does asyncdispatch.recvFromInto only support windows?
14:34:27*sealmove joined #nim
14:36:05sealmoveHi... I can't get existsFile() to work. It always returns false. The file and its parent directory have sufficient permissions but the directory is in /root, meaning its grand-parent directory does not have sufficient permissions. Is that an issue? What else could go wrong with existsFile()?
14:37:06disrupteksealmove: how do you think it should work?
14:37:42disruptekpermissions are access controls that permit or deny access.
14:38:04sealmoveAs documentation says, if file exists then it should return true, but it doesn't..
14:38:31disruptekyou're leaking information if you let the process discover whether the file (or a parent directory) exists when it should not have permission to access that information.
14:38:56disruptekergo, permissions are correctly doing their job and preventing you from determining the existence of the file.
14:39:29sealmoveBut the parent dir and the file do have sufficient permission, just not the grand-parent dir
14:40:14sealmoveDo I need to have sufficient permission in all ancestor dirs recursively?
14:40:41disruptekdirectory permissions of `read` allow one to enumerate the contents of the directory. without that, you shouldn't be able to see what's inside the directory. the `execute` bit allows traversal. without that, you cannot pass through the directory on your way to greener, more friendlier, pastures.
14:41:14sealmoveI've set the x bit for the directory
14:41:33disruptekwell, no one can say you aren't a badass.
14:44:45sealmoveis it possible to make a single file in /root accessible from other users without changing the permissions of /root dir?
14:45:06FromGitter<mratsim> @arnetheduck so how would that work? I need macros but I will need a LLVM backend (probably starting with a JIT so might be different)
14:45:07*Cthalupa quit (Quit: ZNC 1.6.6+deb1ubuntu0.1 - http://znc.in)
14:46:05disrupteksealmove: it depends on the access of the users and the permissions and ownership of the directory, right?
14:46:34krux02mratsim: I don't think replacing the NimVM simply with LLVM is not feasible right now.
14:46:59FromGitter<mratsim> I like the NimVM
14:47:08krux02I do like it, too.
14:47:09FromGitter<mratsim> even though I raise many bugs against it.
14:47:27krux02yea, there are (were) many bugs in it
14:47:29FromGitter<mratsim> and it's actually surprisingly fast
14:48:08krux02well I think it should be as fast as python
14:48:14FromGitter<mratsim> I'll have to see when my compiler is more fleshed out but it seems good.
14:50:01Araqfact: Most VM bugs are caused by the mismatch between the symbolic representation and 'addr' and the like
14:50:49*absolutejam2 quit (Read error: Connection reset by peer)
14:52:12noonienare there any async UDP examples?
14:52:22*absolutejam2 joined #nim
14:54:31*Cthalupa joined #nim
14:58:50*floppydh quit (Quit: WeeChat 2.5)
15:00:41CeaI'm trying to make a wrapper for Quickjs using nimterop but am having issues with a embeded union type `JSCFunctionListEntry` could anyone help me out?
15:00:45CeaUploaded file: https://uploads.kiwiirc.com/files/fd6ebb122436dd2105005f6be2ae667b/pasted.txt
15:01:38clyybberAraq: What does {.nodestroy.} actually do?
15:02:25AraqCea, ping shashlick
15:02:38Araqclyybber, it prevents destructor injections
15:02:56CeaI'll try again he didn't respond earlier :'( shashlick
15:03:14shashlickI was sleeping
15:03:23shashlickAnd am at work now, but will take a look
15:03:41CeaAh, thank you!
15:05:27*absolutejam2 quit (Ping timeout: 245 seconds)
15:06:35clyybberAraq: Ah ok. Umm so for non-ref objects =move is the same as = right? And =destroy stays as is?
15:06:58clyybberI'm trying to figure out if I need to adapt tbintree2 to the new spec, or if my implementation is still buggy
15:07:24*solitudesf joined #nim
15:09:25FromGitter<mratsim> reminds me that I have stumbled across another VM issue with ref object. ⏎ ⏎ If you have the sym of a ref variable in one macro, and then pass it to another macro, the new Nim Node are not considered the same instance anymore
15:10:24disruptekwrong of seven versions of sameTree, i'm afraid.
15:12:02*hoijui joined #nim
15:12:56Araqclyybber, I don't see why tbintree2 should be changed :P
15:14:03clyybberAraq: Ok, then the error is on my side.. damn :D
15:27:56clyybberbbl
15:27:57*clyybber quit (Quit: WeeChat 2.5)
15:37:38Araqhttps://github.com/nim-lang/Nim/issues/11165 really?
15:40:36*jmiven quit (Quit: reboot)
15:41:26*jmiven joined #nim
15:46:53shashlickFun stuff
15:47:55*yeetcannon quit (Remote host closed the connection)
15:48:54*yeetcannon joined #nim
15:51:18AraqI don't think it's reasonable to support this. For a start, I don't even know how to write a test for this.
15:51:35Araqdon't delete files that Nim is running.
15:51:58disruptekso many rules. :-(
15:54:16Araqit's not a rule, it's simply common sense
15:55:17disruptekit's just another example of The Man tryin' to cramp my style, man.
15:56:09dom96bah, is this why Nimble copies all files to /tmp now?
15:58:56*Cea quit (Remote host closed the connection)
16:09:01shashlickWell even if you run with a non existent file name you get a random error
16:09:26shashlick@dom96 that's a different nimble c issue
16:11:46*dgreen joined #nim
16:19:53dom96btw I was thinking it might make sense to allow `>= #commithash` in Nimble
16:20:06dom96would be slow though :(
16:20:50dom96but would probably be possible to optimise it by reimplementing some Git/Hg logic
16:20:52disruptekthose who want it are willing to pay for it.
16:21:39*hoijui quit (Ping timeout: 264 seconds)
16:21:47shashlick@dom96 - do you mean in the require statement? isn't that already allowed? oh you mean >=, right now it is hard coded
16:22:14dom96yes, right now you can only depend on a specific commit hash
16:24:08disrupteknow just add negation and you will have implemented my rfc.
16:25:11shashlickwill it help with lock files?
16:28:58*leorize_ joined #nim
16:31:56*leorize quit (Ping timeout: 260 seconds)
16:35:53Araqdisruptek, who is it "your style"? do you remove files nilly willy when you're bored?
16:35:56Araq*how
16:38:11disrupteki'm being sarcastic. seems unreasonable to support it to me too. it's silly.
16:38:26disrupteki've always had a penchant for removing files, though.
16:40:13dom96shashlick won't really help lock files
16:42:29shashlickI don't think issue #11165 is understood correctly - the way to reproduce is not the use case
16:42:45shashlickfact is that if you run `nim e` with a bad filename, you get a ridiculous error and it isn't clear what happened
16:43:14shashlickwhat does `(1, 21) Error: undeclared identifier: 'a'` have to do with the filename
16:43:29shashlickit acts as if there's a problem in the file contents
16:45:48*actuallybatman joined #nim
16:47:01Araqwell then say that in the issue?
16:47:18*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:47:32shashlickya, it's poorly written and distracts from the real issue
16:49:37shashlickwell, on second thought, this @genotrance guy did find a real issue 🙂
16:49:51shashlickif the file is deleted while running, it does fail that way
16:50:22shashlickbut if a file doesn't exist at all also it fails the same way
16:51:15*ng0 joined #nim
16:52:01shashlickanyway, i've made some updates to the issue
16:52:19*yeetcannon quit (Remote host closed the connection)
16:52:28*yeetcannon joined #nim
17:12:18Araqty
17:19:26*elrood joined #nim
17:20:02FromGitter<alehander42> are you genotrance
17:20:08FromGitter<alehander42> i am so confused
17:20:18lqdev[m]yes
17:20:23lqdev[m]shashlick == genotrance
17:20:44*shomodj joined #nim
17:21:27FromGitter<alehander42> mama mia
17:21:34FromGitter<alehander42> ok
17:21:39FromGitter<alehander42> updating my own human-dns records
17:22:06shashlickkeep people on their feet 😄
17:22:49FromGitter<alehander42> yes, people walk too slowly on their hands
17:23:21shashlickindeed
17:23:54shashlickwho is niv
17:24:04shashlickare they on irc
17:24:36FromGitter<alehander42> maybe we are all genotrance
17:28:47AraqI'm Negan
17:29:30*stefanos82 quit (Quit: Quitting for now...)
17:30:25disrupteki'm sorry... :-(
17:30:43dom96Am I genotrance?
17:32:03*Cea joined #nim
17:33:15Ceashashlick any luck with the embeded union?
17:34:21shashlicknope, snippet sites are blocked from work, will take a look later today
17:34:52shashlickwhat timezone are you in
17:35:57CeaCentral, I can post it to a different site if you like?
17:43:20*Cea quit (Remote host closed the connection)
17:43:34*Cea joined #nim
17:55:46FromGitter<brentp> ```code paste, see link``` ⏎ ⏎ on nim version: 6d8913ee1422143baebd438f7526208193c0bd5e [https://gitter.im/nim-lang/Nim?at=5d320422b2db751dab92ccb9]
17:58:48*arecaceae joined #nim
18:01:10*lritter joined #nim
18:03:43*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:07:05*absolutejam2 joined #nim
18:09:36FromGitter<mratsim> This project probably has one fo the most appealing presentation and github readme ever: https://cpp-taskflow.github.io/#/
18:10:54Zevvso what is this taskflow, and can we have it in Nim
18:11:34disruptekthat's a cute piece of software.
18:11:47Zevvquick, no one is looking, port it and put it in the stdlib!
18:11:53FromGitter<brentp> wow. that is nice
18:11:58Zevvit has dot graphs. I love dot graphs. it must be good
18:13:38dgreen@mratsim do you have a moment?
18:13:48FromGitter<mratsim> yep
18:14:25FromGitter<mratsim> @Zevv, I think I'll pass my weekend on Task parallelism and give my take at the threadpool revamp :p
18:14:36dgreenI made a comment on an arraymancer issue the other day, can you take a quick look for me? https://github.com/mratsim/Arraymancer/issues/298#issuecomment-512133277
18:14:54Zevvmratsim: inspired? :)
18:15:19FromGitter<mratsim> not sure, it's a big field, have a look: https://github.com/numforge/laser/blob/master/research/runtime_threads_tasks_allocation_NUMA.md
18:15:29FromDiscord_<kodkuce> hmm, is compiler troling me or soemthing changed in 0.20
18:15:31FromDiscord_<kodkuce> proc send_activation_mail(id,email:string){.gcsafe, async.}=
18:15:48disruptekcould be a little of both.
18:16:12FromDiscord_<kodkuce> Error: 'send_activation_mailIter' is not GC-safe as it accesses 'secret_jwt' which is a global using GC'ed memory
18:16:48FromDiscord_<kodkuce> shoudent .gcsafe oweride this compile error
18:16:54disrupteki think i just ran into that yesterday.
18:17:05FromGitter<mratsim> @dgreen, good question, no idea. SGD with momentum fused with SGD is fine, for nesterov I might want a separate type but I actually don't really have any preference
18:17:38dgreenOk, thanks, I have one more question to add if I may
18:17:57disrupteksecret_jwt truly is global, right? because that works for me, or at least, it works if it's in a scope above. i'm not sure about top-level, but i think it works there.
18:18:09FromDiscord_<kodkuce> yep its global
18:18:24FromDiscord_<kodkuce> it worked before in 19 for sure
18:18:24FromGitter<mratsim> @kodkuce, no, it's probably both. We also have new GC-safe issues popping up in 0.20.x at Status: https://github.com/status-im/nim-json-rpc/issues/63
18:18:37disruptekwhat really chafes my hide is that if i declare it as a var argument to the proc, which seems more explicit to me, it actually doesn't work.
18:18:39dgreenIn order to store previous moments the update() proc requires a variable parameter. I'm worried that requiring this would break previous code that depends on declaring `let optim`
18:20:01dgreenExample 2 (and others) for instance: let optim = model.optimizerSGD(learning_rate = 0.01'f32)
18:21:06FromGitter<mratsim> the new parameter can be optional parameters with a default value at the end
18:21:33FromGitter<mratsim> the update proc shouldn't need any param, I don't use them for Adam: https://github.com/mratsim/Arraymancer/blob/master/src/nn/optimizers/optimizers.nim#L80
18:21:35FromDiscord_<kodkuce> so should i w8 masters fix it or waht
18:22:26dgreenOh right, I'm talking about the optimizer object itself being mutable, my bad. In your ADAM definition it's (self: var Adam) but SGD is (self: Sgd)
18:23:06FromGitter<mratsim> mmmh the var is actually unnecessary
18:23:23dgreenIs it?
18:23:38FromGitter<mratsim> the optimizeFoo declaration is still in flux, I don't really like the current name/syntax: https://github.com/mratsim/Arraymancer/blob/master/src/nn/optimizers/optimizers.nim#L114-L115
18:23:50dgreenTrying to do something like apply2_inline(self.first_moments[i], v.grad): would require self to be var wouldn't it?
18:23:53FromGitter<mratsim> ah yes it's needed, Adam is not a ref object
18:24:32FromGitter<mratsim> yes
18:24:57dgreenAh ok. So then if I changed it to add momentum though, I'd need to change self: SGD to self: var SGD, which would break backwards compatibility
18:25:26dgreenPerhaps I should move "with momentum" to be a new type?
18:25:28FromGitter<mratsim> so you can introduce a new type SGDMomentum, with an optional flag for nesterov
18:25:54sealmovejeez, what exactly is `pattern` in walkDirs? does it search relative to the executable's path?
18:26:02dgreenOk I'll do that, I think that's the best option
18:26:10FromGitter<mratsim> sounds good, thank you
18:26:12dgreenThank you :)
18:27:56FromGitter<mratsim> github notifications are real bad
18:28:05FromGitter<mratsim> I only see like the last 5
18:29:23dgreenOh no worries I figured as much which is why I tracked you down on the irc
18:30:18FromGitter<mratsim> btw, I see that you're writing a chess engine, here is my Zobrist hash implementation (but for Go) https://github.com/mratsim/golem-prime/blob/master/src/montecarlo/mc_zobristhash.nim
18:32:06dgreenOh awesome thanks!
18:32:17dgreenZobrist hashing caused me a lot of headache when I was first implementing it
18:32:33dgreenYour implementation is a lot more elegant though
18:33:52shashlick@mratsim if you use slack, check out notipy
18:34:24FromGitter<mratsim> so I create a slack team for me alone?
18:34:33shashlickBrings my github notifications into slack
18:34:47shashlickCan sort into different channels
18:35:05shashlickWell if you use it already, then can just put it in a channel you create
18:35:17FromGitter<kaushalmodi> Araq: looking at https://github.com/nim-lang/Nim/commit/dc38b88f7ecd2d690d22cd107388cf95122c9eb0 ..
18:35:19shashlickIf not then ya, use it how I have
18:35:53*dgreen quit (Remote host closed the connection)
18:36:09FromGitter<kaushalmodi> why not define those warn enums as: ⏎ ⏎ ```warnUnusedImportX = "UnusedImport"``` ⏎ ⏎ and so on [https://gitter.im/nim-lang/Nim?at=5d320d995ea6e644ece396cd]
18:36:19shashlickI'm a team of one
18:36:32shashlickIf you want I can invite you into this team
18:37:04FromGitter<mratsim> :D
18:38:37FromGitter<mratsim> I think I saw a project with a CLI that just received all github updates
18:39:00FromGitter<mratsim> or it could even be a terminal frontend, like something for termux
18:40:19FromGitter<mratsim> maybe this: http://nodegh.io
18:41:24shashlickI'll send you a screenshot of how it looks
18:41:44dom96All these tools should be written in Nim
18:43:32FromGitter<kaushalmodi> I know one nimble package that deals with GitHub API: https://github.com/kdheepak/github-release
18:43:33FromGitter<kaushalmodi> it
18:43:39FromGitter<kaushalmodi> it's pretty neat
18:43:52*nsf joined #nim
18:44:41*narimiran quit (Remote host closed the connection)
18:47:02FromGitter<brentp> with websocket (https://github.com/niv/websocket.nim) installed via nimble and then running: nim c ~/.nimble/pkgs/websocket-0.4.0/websocket/client.nim
18:47:12FromGitter<brentp> I see: ```
18:47:18FromGitter<brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d321036a0351b1a8c61b796]
18:47:21FromGitter<brentp> bah
18:47:46dom96nimble install websocket@#head
18:48:25FromGitter<brentp> cheers.
18:50:10FromGitter<alehander42> i dont even write parallel software
18:50:16FromGitter<alehander42> but now i plan to use cpp taskflow
18:50:25disrupteklol
18:51:22Cadeyis there an either type in the standard library?
18:51:47dom96Not as far as I'm aware, would be nice to have though
18:51:51sealmovewow strscans is awesome!
18:52:32*dgreen joined #nim
18:52:55Cadeyhow should I go about making an Either?
18:53:31dom96object variant
18:53:39dom96similar to how we implement Option[T]
18:53:57dom96may as well put it in options module as well
18:53:59Cadeywhat type is SomePointer?
18:55:09FromGitter<mratsim> @dom96, "All those tools should be made in Nim" > Need time, and manpower
18:55:26FromGitter<alehander42> щея
18:55:27FromGitter<alehander42> yes
18:55:34FromGitter<alehander42> but this is something we should do
18:55:39FromGitter<mratsim> @Cadey: https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim#L12-L21
18:55:44FromGitter<alehander42> nice libs and tools are what is going to get mindshare
18:55:53FromGitter<alehander42> at least as much as nice language features
18:55:56FromGitter<alehander42> if not even more
18:56:00Cadeyinteresting
18:56:01FromGitter<alehander42> at this phase
18:56:20FromGitter<mratsim> If you look at the Rust community, people are complaining for the past 4 years about the lack of machine learning / deep learning stuff beyon wrapping Tensorflow so your mileage may vary :P
18:57:02Araq> Error: 'send_activation_mailIter' is not GC-safe as it accesses 'secret_jwt' which is a global using GC'ed memory
18:57:16Araqseems to me the compiler is now corect and previously it wasn't
18:58:15FromGitter<mratsim> btw, in new_runtime, are closures working? If I want to write a task scheduler that supports nested parallelism, I probably don't want GC interference when a tasks spawns a new task
18:59:27disruptekAraq: maybe, but it's inconsistent in its warnings and doesn't even issue a warning in `nim check` though it will fail to compile in `nim c`.
18:59:47FromGitter<kaushalmodi> Araq: Any comment about https://irclogs.nim-lang.org/19-07-2019.html#18:36:09 ?
19:00:17shashlickI would have made notipy in Nim expect for htmlslacker py module
19:01:35dom96mratsim: So I'm working on a game that's similar to agar.io and I'll need some AI, what would you suggest?
19:02:04FromGitter<mratsim> how much time do you have to sink? :p
19:02:17dom96not a lot :)
19:02:25dom96I'd prefer something simple/quick but effective
19:02:59FromGitter<mratsim> use an "expert system", like heuristics about size, surroundings, your speed
19:03:02dom96I've built a basic AI already where I just came up with some rules for it, but it would be nice to set something up and let the AI evolve into something better
19:03:03shashlickAraq: I've run into an issue with my shared seq poc
19:03:48dom96Expert system seems to be basically what I have already heh
19:03:49shashlickEven if I am allocating shared memory for the data in my shared seq
19:04:15FromGitter<mratsim> for evolution, genetic algorithms are well documented
19:04:23shashlickWhen I want to copy a string, a deep copy is still going to use gc memory right?
19:04:23FromGitter<mratsim> this might save you time: https://github.com/toshikiohnogi/nimga
19:04:23dom96yeah, that's what I was thinking
19:04:45dom96I wrote a GA in Python a really loooong time ago
19:05:27shashlickCause I don't really copy over any ref or ptr data being pointed to
19:05:28Araqmratsim: closures do work and nothing "triggers" the GC cause there ain't any
19:05:34FromGitter<mratsim> otherwise, the library that seems to be on the rise for RL is Ray: https://ray.readthedocs.io/en/latest/example-rl-pong.html
19:05:39dom96mratsim: ever watched Code Bullet on YouTube? He seems to like Q learning
19:06:19Araqkaushalmodi: good point, the reason it was done this way was pure legacy
19:06:23FromGitter<mratsim> never watched
19:06:33Araqand now that I made a mistake with it, it's time to change it
19:06:37dom96btw this needs to be reasonably fast too, I want to run 100s of these (and possibly on phones too)
19:06:44disruptekwow, i was looking for ga in nim and never found anything.
19:07:12FromGitter<mratsim> I'm pretty sure there is another one, because I remember starring one
19:07:20disruptekoh, i guess this is new.
19:07:24dom96Do you really need a library for GA? From what I remember it seems easier to just create something yourself
19:07:47FromGitter<mratsim> here you go: https://github.com/peheje/nim_genetic
19:07:54FromGitter<mratsim> I think it's easy
19:08:08FromGitter<mratsim> see: https://github.com/peheje/nim_genetic/blob/master/GeneticAlgorithm/nim_genetic.nim
19:08:12disruptekthere are a lot of little methods that are handy to leverage if someone else has already transcribed them.
19:08:15*yeetcannon quit (Remote host closed the connection)
19:08:21shashlickAraq: https://github.com/genotrance/shared/blob/master/shared/seq.nim#L64
19:08:29*yeetcannon joined #nim
19:10:20FromGitter<mratsim> one day I plan to have a RL library with plenty of functions that you can just pick here: https://github.com/numforge/agent-smith/
19:10:41FromGitter<mratsim> but for now you can use it to test those on pongs, space invaders, and the like
19:11:09FromGitter<mratsim> trying to implement those led me to find bottlenecks in Arraymancer that I want to fix first
19:11:34krux02sdl1?
19:12:44FromGitter<mratsim> yes :/, dependency of the underlying C++ library
19:46:06*PrimHelios quit (Quit: ZNC - https://znc.in)
19:46:25*PrimHelios joined #nim
19:50:21Araqshashlick, what's the question? you can't copy stuff like that
19:50:24Araquse deepCopy
19:56:02shashlickEven if I use deep copy which I am in local code
19:56:14shashlickIt won't recurse into pointers right?
19:56:38shashlickAnd if it does, it will still use thread local memory
19:57:22shashlickLike a Nim string is an integer and pointer to the string data
19:57:29Araqit does recurse, that's the point of the word 'deep'
19:57:48Araqbut it uses the threadlocal allocator for construction, yes
19:58:17shashlickSo there's no way to really do this generically
19:58:40shashlickIn shared string, I'm copying every char so that's working fine
19:59:42Araqcopy over to what? to something that uses 'allocShared'?
19:59:51shashlickYes
20:00:33shashlickSo adding to a shared seq is copying over T to shared memory
20:01:08shashlickBut that T can only be non gc primitives or objects without refs or ptr fields recursively
20:01:52shashlickSo sizeof(T) should give me all the contents
20:02:47shashlickNow another question, if an object field is another object, is it stored inline? Not ref or ptr
20:02:53*dgreen quit (Read error: Connection timed out)
20:03:12shashlickThen sizeof will continue to work correctly, and so will deep copy
20:03:27shashlickOr even copy mem for that matter
20:04:46shashlickI still have no solution for ptr or ref content though
20:05:51Araqyes, it is stored inline
20:06:08shashlickUnless I write my own deep copy that uses shared memory instead
20:06:31shashlickAny suggestions?
20:07:36Araquse a macro over getType() to implement a sharedDeepCopy
20:07:54shashlickOk I'll look at how deep copy is implemented
20:08:09Araqdon't, it's old stuff that uses RTTI
20:08:44AraqgetType() is usually much better as it encourages you to write the performant version of things
20:08:48shashlickOk, I'll also have to write code to recursively free the memory but will leverage the same algorithm
20:09:36shashlickThis code with some modifications is only 70x slower than Nim proper so there is hope for a more performant implementation
20:09:42Araqyou should give --newruntime a try
20:10:26shashlickWill do - how would all this change with new runtime?
20:10:48Araqit's not ready yet but you have Araq on your side then, it's the one thing I'm allowed to work on aside from bugfixes :P
20:11:11Araqyeah, it will all change with --newruntime.
20:11:20Araqyou can throw away most of your code then
20:11:24Araq:-)
20:12:16*yeetcannon quit (Remote host closed the connection)
20:12:43*xet7 joined #nim
20:14:40shashlickwoot
20:16:26Araqit uses shared memory for strings and seqs then
20:17:02shashlickperfect - i'm happy to throw this out, good mental exercise but not something i want to maintain
20:17:11*yeetcannon joined #nim
20:25:13Araqgood night
20:26:53shashlick@Cea - taking a look
20:44:51*hoijui joined #nim
20:45:05*jjido joined #nim
20:45:15*shomodj joined #nim
21:01:18*actuallybatman quit (Ping timeout: 245 seconds)
21:04:09*dgreen joined #nim
21:07:52*hoijui quit (Ping timeout: 264 seconds)
21:12:06*S4ms0n joined #nim
21:15:05S4ms0nAnyone got some example code for doing anonymous memory maps on Linux?
21:21:41*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:22:39*shomodj_ joined #nim
21:23:17*Vladar quit (Remote host closed the connection)
21:25:44*shomodj quit (Ping timeout: 268 seconds)
21:30:22*yeetcannon quit (Remote host closed the connection)
21:30:32*yeetcannon joined #nim
21:31:36*rayman22201 is happy Araq convinced Shashlick to use newruntime :-P
21:33:28*yeetcannon quit (Excess Flood)
21:34:13FromGitter<awr1> what are anonymous mmaps
21:34:19*yeetcannon joined #nim
21:35:40FromGitter<awr1> b/c i'm googling and i'm getting confused descriptions
21:35:58FromGitter<awr1> one says "memory that's totally in RAM" which makes me just think of pinned pages
21:35:59*jjido joined #nim
21:36:06FromGitter<awr1> *virtual memory
21:36:17FromGitter<awr1> *always in RAM
21:37:05FromGitter<awr1> but some other site says it's like "reserving RAM" which makes me think of VirtualAlloc with MEM_RESERVE
21:38:37S4ms0nExactly
21:39:25S4ms0nYour using the posix mmap() system call instead of the break()/sbrk() system calls.
21:39:47*jjido quit (Client Quit)
21:40:07S4ms0nWith mmap() you can just munmap() the memory when your done, thereby returning it to the system.
21:40:47S4ms0nWith brk()/sbrk() the memory just hangs around in your process until it exits.
21:41:30*noonien quit (Quit: Connection closed for inactivity)
21:42:44lqdev[m]what's the easiest way of converting a uint8 to a char without causing overflow errors?
21:43:02*yeetcannon quit (Remote host closed the connection)
21:45:47lqdev[m]I suppose `cast[char](x)`?
21:46:28FromGitter<brentp> is a RangeError when e.g. a uint goes < 0?
21:54:16lqdev[m]no, but it's a range error if an integer over- or underflows
21:57:35*sentreen joined #nim
22:08:02*solitudesf quit (Ping timeout: 248 seconds)
22:18:05*nsf quit (Quit: WeeChat 2.4)
22:31:11sealmove:DDD https://github.com/fish-shell/fish-shell/issues/862
22:31:47sealmove@timotheecour
22:32:49shashlick@Cea - here's a working quickjs wrapper - http://ix.io/1OWi/nim
22:33:05*elrood quit (Remote host closed the connection)
22:33:39shashlickunfortunately there's many manual changes needed after generating the nim code so there's no automatic method
22:37:17FromGitter<brentp> hadn't heard of quickjs. how's it compare to duktape?
22:37:52*sealmove quit (Quit: WeeChat 2.5)
22:38:24FromGitter<brentp> oh. it was released 10 days ago.
22:38:35*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:40:37shashlick@Cea - here's the nimterop wrapper i ended up with - http://ix.io/1OWl/nim - needs a few changes in the generated nim code from c2nim
22:41:02shashlick@brentp - i've not really tried either out - i'm just the wrapper guy 😄
22:42:30FromGitter<brentp> heh. ok. I'm using a duktape wrapper that was built with nimgen. would be nice to have all the >ES5 features that duktape does not support.
22:44:10*rockcavera quit (Remote host closed the connection)
22:45:15dom96Offtopic: So I've got a website, and I really want to find its owner, are there any tools that can search a website for anything that resembles contact info?
22:46:52disruptekdom96: whois?
22:47:15dom96only a vague name there and an email to abuse@
22:48:30shashlickperhaps some intense googling looking for someone using that url in a personal context
22:51:15dom96So frustrating. I can see the page in archive.org
22:51:43dom96it's some product page, but there is no contact info or any names or anything
22:51:55dom96There is a zapier hook link though, which might still work I guess
23:16:05*actuallybatman joined #nim
23:21:06*absolutejam2 quit (Ping timeout: 248 seconds)
23:33:09FromGitter<Varriount> Araq: Does newruntime need to be enabled for destructors, move procedures, and the like to work?
23:45:51*krux02_ joined #nim
23:49:37*krux02 quit (Ping timeout: 245 seconds)
23:52:17*brakmic quit ()
23:56:23*fjellfras joined #nim
23:56:43*fjellfras quit (Max SendQ exceeded)
23:57:13*fjellfras joined #nim
23:57:51*fjellfras quit (Max SendQ exceeded)
23:58:18*fjellfras joined #nim
23:58:46*fjellfras quit (Max SendQ exceeded)
23:59:16*fjellfras joined #nim