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:07 | FromGitter | <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:29 | FromGitter | <awr1> http://ix.io/1OSe/nim |
02:38:30 | FromGitter | <awr1> hm |
02:38:43 | FromGitter | <awr1> both are false |
02:42:36 | FromGitter | <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:35 | FromGitter | <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:36 | FromGitter | <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:05 | FromGitter | <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:45 | FromGitter | <awr1> yeah it seems to be just used a shifting value |
04:28:01 | * | dgreen joined #nim |
04:36:05 | FromGitter | <awr1> https://nim-lang.org/docs/system.html#%40%2Carray%5BIDX%2CT%5D |
04:36:16 | FromGitter | <awr1> i don't get why `string` works here |
04:36:29 | FromGitter | <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:28 | Araq | awr1: so strange... agreed |
05:40:22 | Araq | proc `@`*[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:40 | leorize | awr1: 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:24 | FromGitter | <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:57 | Zevv | leorize here? |
07:04:02 | * | absolutejam joined #nim |
07:04:02 | Zevv | oh yes just 2 msg up :) |
07:04:06 | leorize | o/ |
07:04:35 | * | gmpreussner joined #nim |
07:05:04 | Zevv | so, 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:27 | Zevv | I'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:51 | Zevv | What would be the way to go - just put the stuff in vim8 and see where the smoke comes out? |
07:06:11 | leorize | so first you'd need to port the querying function over |
07:06:15 | Zevv | s/formatting/highlighting/ |
07:06:20 | leorize | it's in autoload/nim/suggest/utils.vim |
07:06:24 | Zevv | ok |
07:06:40 | leorize | you should look at nim#suggest#utils#Query |
07:07:19 | leorize | ah, not that easy yet :P |
07:07:50 | Zevv | I didn't expect it to be easy :) |
07:07:50 | leorize | the first magic is in autoload/nim/suggest.vim |
07:07:58 | leorize | you need to port the sockconnect() over |
07:08:04 | leorize | in nim#suggest#Connect |
07:08:20 | leorize | not sure what's the equivalent in vim |
07:08:26 | leorize | has('nvim') is your key here |
07:08:40 | Zevv | right. I can stub some python in if needed for the socket stuff |
07:08:41 | * | krux02 joined #nim |
07:08:49 | leorize | nope |
07:09:09 | Zevv | why not? I can just call python from vimscript iirc? |
07:09:16 | Zevv | I did it with Lua anyway |
07:09:20 | Zevv | assume python is similar |
07:09:35 | leorize | I don't have experience w python and I'd like to keep the deps down |
07:09:45 | leorize | also nvim and vim's socket interface is nice |
07:10:29 | leorize | most of the response processing code is already in vimscript |
07:10:41 | Zevv | ok, that should get me started |
07:10:43 | narimiran | Zevv: come on, just use neovim :) |
07:10:43 | Zevv | thanks |
07:11:03 | Zevv | I can't, I'm dutch |
07:12:38 | leorize | is there any vim8 docs online? |
07:13:23 | Zevv | https://vimhelp.org/ |
07:13:32 | leorize | thanks |
07:13:53 | leorize | narimiran: there are more stubborn vim users that I thought :p |
07:15:55 | * | Vladar joined #nim |
07:16:07 | Zevv | q: |
07:17:08 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
07:17:33 | leorize | damn, vim got some goodies here |
07:17:49 | leorize | their channel interface is definitely better |
07:17:57 | Zevv | see :) |
07:23:15 | leorize | Zevv: alright, so nim#suggest#Connect() is just a thin wrapper over whatever connect channel there's |
07:23:45 | leorize | for vim use ch_open() |
07:23:55 | Zevv | sweet |
07:24:09 | Zevv | ok, need to work first, but will pick that up later today. thanks so far! |
07:24:28 | leorize | np |
07:24:35 | narimiran | leorize: oh come on, don't help him with his silliness, make him see the light and start using nvim :P :D |
07:25:28 | narimiran | ...and then later on you can join the forces and make even better nvim plugin, instead of having two similar ones |
07:25:49 | Zevv | Like I said, I can't: I'm dutch. So is Bram. |
07:26:06 | leorize | narimiran: it's just a few conditionals (hopefully) :p |
07:26:34 | leorize | but Zevv will have to maintain it 3:) |
07:26:50 | Zevv | I can maintain a few conditionals I guess \o/ |
07:26:52 | leorize | and if he got tired of that he can use nvim instead :) |
07:27:12 | Zevv | nvim is just silly. I put in my default .vimrc and stuff is just different |
07:27:13 | FromGitter | <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:37 | narimiran | Zevv: s/different/better |
07:27:52 | Zevv | 09:17 < leorize> damn, vim got some goodies here |
07:28:03 | leorize | just in the channel interface :P |
07:28:35 | leorize | their codebase is still a mess |
07:29:20 | Zevv | Vim 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:38 | Zevv | /stick/stink/ |
07:31:59 | Zevv | ok, 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:24 | FromGitter | <alehander42> i love pigeons |
08:15:58 | FromGitter | <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:35 | narimiran | @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:07 | narimiran | basically, that is the only reason why the deprecated `map` is still in the stdlib :) |
08:20:16 | FromGitter | <mratsim> The display is one of the worse part |
08:20:31 | * | floppydh joined #nim |
08:20:51 | FromGitter | <mratsim> I want to rework it in a much nicer way |
08:22:05 | FromGitter | <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:38 | FromGitter | <mratsim> However I read the Haskell code and was lost the various function compositions :D |
08:23:19 | FromGitter | <mratsim> maybe I should compile the Haskell code to C ... |
08:34:15 | Araq | we 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:51 | krux02 | @mratsim: do your tensors have compile time information about the dimensions? |
09:23:03 | FromGitter | <mratsim> no |
09:24:54 | FromGitter | <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:33 | FromGitter | <mratsim> I did try, and raised plenty of `static` bugs for @zah's delight at the time |
09:27:12 | krux02 | yea |
09:27:15 | krux02 | that is sad |
09:27:31 | krux02 | I did a tensor contraction library in the past as well |
09:29:02 | FromGitter | <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:10 | krux02 | mratsim: that is the code I was working on http://ix.io/1OTc |
09:29:20 | FromGitter | <mratsim> ^ example of Matrix Vector as a einsum contraction |
09:30:09 | krux02 | yes I can see |
09:30:14 | FromGitter | <mratsim> Ah I see |
09:30:29 | FromGitter | <mratsim> I also needed `:=` operator at one point |
09:30:54 | FromGitter | <alehander42> what doe sit do |
09:30:59 | krux02 | but 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:26 | FromGitter | <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:33 | krux02 | yea I see it as a failed project |
09:31:39 | FromGitter | <mratsim> @alehander42 it automatically creates loop |
09:31:47 | krux02 | too many bugs in Nim at the time. But the idea is solid though |
09:32:08 | Araq | I'm still not sold on the idea |
09:32:22 | FromGitter | <alehander42> huh, i see |
09:32:28 | Araq | tensors work better when you ignore their ranks |
09:32:42 | FromGitter | <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:58 | FromGitter | <mratsim> basically you only mention the loop indices and it creates the loop for you |
09:33:05 | * | shomodj joined #nim |
09:33:12 | FromGitter | <alehander42> i see, the syntax confused me |
09:33:31 | FromGitter | <alehander42> as usually `:=` introduces a new variable as an alternative to `<spec> <name> = ` |
09:33:43 | FromGitter | <alehander42> thanks for the link! |
09:34:04 | FromGitter | <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:12 | krux02 | yea I introduced that syntax, because it is my DSL |
09:34:34 | krux02 | let W[b,m,j,e] = ... is not valid nim syntax |
09:35:43 | krux02 | the reason wy you should know the dimensions at compile time for optimizations is simple |
09:36:18 | krux02 | rowVector ⋅ columnVector ⋅ rowVector |
09:37:30 | krux02 | you want the optimizer to know that ((rowVector ⋅ columnVector) ⋅ rowVector) uses much less intermediate memory than (rowVector ⋅ (columnVector ⋅ rowVector)) |
09:38:44 | FromGitter | <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:44 | FromGitter | ... fe56ca264d2dddc014/apps/blur/halide_blur_generator.cpp#L40-L65 |
09:41:24 | FromGitter | <mratsim> And in terms of performance, the Halide DSL allows to reach the speed of hand-tuned assembly from Intel or Nvidia. |
09:41:36 | FromGitter | <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:30 | krux02 | yea, 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:43 | narimiran | "<Zevv> ok, I will give nvim one more try then. one more." ...and we never heard back from him :) |
11:13:39 | lqdev[m] | maybe he couldn't exit vim :kappa: |
11:17:33 | narimiran | :P |
11:26:59 | Zevv | I gave up. It is folding on indent by default and I have *no clue* where this come froms |
11:27:32 | Zevv | lqdev[m]: This has been my email signature for the last 20 years: |
11:27:34 | Zevv | --- |
11:27:34 | Zevv | -- |
11:27:34 | Zevv | :wq |
11:27:35 | Zevv | ^X^Cy^K^X^C^C^C^C |
11:47:37 | Zevv | ok ok ok I switched |
11:47:59 | narimiran | do we need to congratulate now? |
11:48:06 | Zevv | yes please |
11:48:15 | narimiran | Zevv: congrats on your switch! |
11:48:32 | * | Zevv refuses to say "thank you" |
11:48:33 | Zevv | this is hard |
11:48:37 | Zevv | you know |
11:49:03 | Zevv | strange things happening in my life these days. Yesterday I spent coding C++, and I was having fun. |
11:49:08 | Zevv | not sure if I'm really ok |
11:50:21 | FromGitter | <alehander42> c++ can be nice if you use a subset |
11:50:36 | FromGitter | <alehander42> (disclaimer: opinion of a guy that doesnt really get c++ ) |
11:50:36 | FromGitter | <ahcm> Only which subset? ;-) |
11:50:59 | FromGitter | <alehander42> a suprising one |
11:51:01 | narimiran | only the first plus |
11:51:12 | FromGitter | <alehander42> yea |
11:51:15 | FromGitter | <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:09 | Cea | Uploaded file: https://uploads.kiwiirc.com/files/fae73057e4ae743a5a69d288819a0dbe/pasted.txt |
11:57:12 | Cea | @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:31 | clyybber | Araq: Regarding your proposal from yesterday, is it really memory safe to do that? |
12:29:49 | clyybber | It works here: http://ix.io/1OTt/c, but I don't know if thats defined behaviour |
12:30:16 | clyybber | I'm talking about never passing the right argument of `=` by ref |
12:33:42 | clyybber | Ugh, wrong link, this is the one: http://ix.io/1OTM/c |
12:42:59 | Zevv | leorize: Ha! https://forum.nim-lang.org/t/5029 :) |
12:43:35 | narimiran | Zevv: yeah, i thought that might be you. but this was posted after you said you made the switch :) |
12:43:52 | Zevv | Me and my alter ego |
12:44:59 | Araq | clyybber, that C code is bonkers |
12:45:10 | Araq | NIM_NIL is not for 'int' |
12:47:55 | Araq | clyybber, also, sorry, but I think we should stop working on =move |
12:48:22 | Araq | =sink can be fixed and is good enough for v1 |
12:49:18 | Araq | and the spec should follow the reality, not mandate something that wasn't tested as much |
12:51:37 | FromGitter | <zah> what is the difference between =sink and =move, I've missed the discussions. Any links? |
12:52:42 | Araq | doc/destructors discusses the problem with =sink |
12:53:17 | Araq | in a nutshell, =sink cannot propagate the piece of information "this was a self assignment" |
12:53:36 | Araq | so self assignments shouldn't be transformed to moves |
12:54:35 | clyybber | Araq: I don't think we should stop working on =move without doing benchmarks and seeing if its worth it |
12:55:09 | clyybber | Araq: Yeah, that code is bunkers, but it illustrates the issue. |
12:55:24 | clyybber | Araq: How can =sink be fixed? |
12:56:16 | Araq | =sink is not produced for self-assignments |
12:56:45 | clyybber | I believe that was my original proposition before starting to work on =move |
12:57:13 | Araq | well I don't know. 'x = x' is easy enough to simply forbid |
12:57:32 | Araq | swap(x, x) is not mapped to moves anyway. |
12:57:44 | Araq | that leaves us with 'x = f(x, ...)' |
12:58:20 | Araq | which uses some temporary in practice and so it works (not sure if I remember correctly) |
12:58:56 | Araq | =move is more elegant though, at least in the spec |
12:59:03 | clyybber | I agree |
12:59:04 | Araq | fewer rewrite rules and no magic 'wasMoved' state |
12:59:18 | Araq | so ok, work on benchmarks then ;-) |
12:59:38 | Araq | =move also maps exactly to C++, but it shouldn't matter much |
12:59:49 | clyybber | Yep, thats what I'm gonna do, right after I fix that NIM_NIL issue |
13:00:02 | clyybber | Araq: Yeah, it generates pretty clean CPP code |
13:00:17 | Araq | but in the meantime the spec doesn't reflect reality and I don't like that |
13:01:21 | clyybber | Just add "newruntime is still in flux, and things will and can change until the design is fleshed out. |
13:01:36 | clyybber | and tell people to *not* actually use it yet |
13:03:05 | Araq | people should use it, we won't find all the bugs otherwise |
13:03:16 | Araq | it's quite simple to do |
13:03:24 | clyybber | after its ready, I can assure you, my implementation will have enough bugs :p |
13:03:29 | Araq | when defined(nimMoves): |
13:03:37 | Araq | proc `=move` |
13:03:38 | Araq | else: |
13:03:42 | Araq | proc `=sink` |
13:04:14 | Araq | moves 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:40 | disruptek | Zevv: 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:57 | disruptek | i'm trying to avoid transcribing a grammar. |
13:30:01 | Zevv | disruptek: if i understand right, you want to reuse a peg as a building block in another peg, right? |
13:31:51 | disruptek | yeah, i'd like to parse yaml with it, but i'd rather use someone else's grammar definition. |
13:32:19 | FromGitter | <mratsim> parsing yaml is quite involved |
13:32:21 | * | synshroud quit (Quit: ZNC 1.7.4 - https://znc.in) |
13:32:22 | disruptek | and, i'm aware there's a nim yaml -- i cannot use it at compile time. |
13:32:39 | disruptek | mratsim: hence my desire to leverage. ;-) |
13:32:50 | Zevv | disruptek: yaml is indent-based, which is not trivially peggable |
13:33:04 | FromGitter | <arnetheduck> it's very simple - you convert yaml to json, then parse json :) |
13:33:25 | FromGitter | <mratsim> but to convert yaml to json you need a compile-time yaml parser :p |
13:33:25 | disruptek | there's a pegex written for it -- i believe by the original yaml author, a perl guy. |
13:33:34 | Zevv | link? |
13:33:46 | Zevv | anyway, npeg supports npeg syntax, which is not any other syntax |
13:33:50 | disruptek | https://github.com/ingydotnet/yaml-pegex-pm/blob/master/share/yaml-pgx/yaml.pgx.json |
13:33:56 | Zevv | I could add additional parsers, but that kind of defeats the purpose |
13:34:24 | clyybber | disruptek: Why does it not work at CT? |
13:34:36 | disruptek | oh, 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:00 | disruptek | clyybber: the author answered that question in an issue 3 weeks ago; please hold for link. :-) |
13:35:02 | FromGitter | <arnetheduck> `gorge("yq . filename.yaml")` |
13:35:21 | disruptek | https://github.com/flyx/NimYAML/issues/70 |
13:35:33 | Zevv | leorize: discuss nim.nvim here or somewhere else? |
13:35:33 | disruptek | arnetheduck: yeah, i know. |
13:35:39 | clyybber | disruptek: Ah, I found it |
13:36:43 | FromGitter | <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:56 | disruptek | it's not ideal, no. |
13:37:02 | FromGitter | <mratsim> flyx said that it's maintenance mode and people are free to take over |
13:37:10 | clyybber | It also looks a bit misdesigned, if it can't work at CT. Theres better ways to write an efficient lexer |
13:37:29 | FromGitter | <mratsim> The issue is that streams don't work at compile-time |
13:37:36 | clyybber | They do now afaik |
13:37:56 | FromGitter | <mratsim> but Nim is probably the only language where people say that something not working at compile-time is misdesigned :P |
13:38:15 | disruptek | i know, right? |
13:38:52 | clyybber | Ok, I should rephrase.. Its not misdesigned, but not designed with this change in mind: https://github.com/nim-lang/Nim/pull/10746 |
13:40:40 | disruptek | itym not designed with nim in mind. |
13:48:46 | krux02 | I 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:33 | krux02 | it is not being worked on right now, but I think it is possible |
13:49:45 | krux02 | then all pointer based interfaces will also work at compile time. |
13:49:55 | disruptek | krux02: you're blowing my mind right now. |
13:50:11 | * | noonien joined #nim |
13:52:20 | krux02 | hey it is not a promise |
13:52:27 | krux02 | it is just something that I think should be done |
13:52:54 | clyybber | krux02: Like running C code at CT with tinyc ? |
13:53:53 | krux02 | I don't really know if that is comparable |
13:54:04 | clyybber | It would have the same effect |
13:54:19 | krux02 | AFAIK tinyc is just a small C compiler, not a C interpreter |
13:54:36 | clyybber | Yeah, but it can be used as such, because its compile time is so fast |
13:54:41 | krux02 | the nimvm will stay a bytecode interpreter |
13:54:57 | krux02 | it is just the way how object values are layed out in memory that I would change |
13:55:25 | disruptek | that's how i feel about my brain. |
13:55:33 | krux02 | currently they are stored as NimNode, coming directly from what the parser/semchecker returns |
13:55:41 | krux02 | I think it was used, because it was easy |
13:55:48 | disruptek | ditto. |
13:56:03 | krux02 | but because the memory layout is so different I don't think we should continue to do so forever. |
13:56:37 | krux02 | At some point I just think it is worth to pay the price and try to mimic the memory layout of C. |
13:56:55 | krux02 | I didn't write the offsetof/alignof for nothing |
13:57:40 | krux02 | as long as we don't directly import types from C headers, we know the memory layout of all objects. |
13:58:08 | disruptek | it'd be hard to make this thing work if we didn't. |
13:58:55 | clyybber | But why use addr and the like at CT at all? |
13:59:19 | clyybber | Its never necessary, the language is turing complete without it |
13:59:20 | krux02 | clyybber: what do you mean? |
13:59:37 | krux02 | that is such a theoretical argument. |
14:00:04 | krux02 | the answer is of coures, because you want to run code at compile time that was designed to be executed at runtime |
14:00:10 | FromGitter | <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:37 | krux02 | nope not with me on board |
14:00:38 | disruptek | that's a neat idea. |
14:00:58 | krux02 | I really don't like the idea to rip out the idea of the nimvm. I think it would break too many things. |
14:01:12 | FromGitter | <arnetheduck> it's fine, it's nlvm and not nimc |
14:02:14 | disruptek | different strokes. how hard would it be? |
14:02:26 | FromGitter | <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:57 | krux02 | I have no experience in nlvm, also I am not a fan of introducing more dependencies to the compiler. |
14:04:00 | FromGitter | <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:41 | disruptek | i think it's a really cool concept worth noodling with. |
14:04:52 | FromGitter | <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:49 | noonien | hello folks! |
14:06:00 | noonien | are there any example of udp client/servers using async UDP? |
14:06:05 | FromGitter | <arnetheduck> disruptek, I'll take that patch any day :) |
14:06:24 | disruptek | were it that easy. :-( |
14:09:16 | disruptek | the 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:01 | FromGitter | <arnetheduck> that's the problem with all macros: to understand them, *you* have to become the MV |
14:13:16 | krux02 | disruptek, not really |
14:14:04 | krux02 | all my (more complex) macros have a debug argument to print all symbols they generate |
14:15:15 | krux02 | I 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:53 | disruptek | well, 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:41 | Cadey | were concepts removed from tne nim manual? |
14:23:02 | dom96 | move into the experimental manual |
14:24:08 | Cadey | i can't find it. link? |
14:25:01 | FromGitter | <kaushalmodi> https://nim-lang.github.io/Nim/manual_experimental.html#concepts |
14:28:54 | disruptek | but is the current thinking that concepts are broken? |
14:29:54 | krux02 | yes |
14:33:48 | noonien | is there a SockAddr outside winlean? |
14:33:59 | noonien | or does asyncdispatch.recvFromInto only support windows? |
14:34:27 | * | sealmove joined #nim |
14:36:05 | sealmove | Hi... 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:06 | disruptek | sealmove: how do you think it should work? |
14:37:42 | disruptek | permissions are access controls that permit or deny access. |
14:38:04 | sealmove | As documentation says, if file exists then it should return true, but it doesn't.. |
14:38:31 | disruptek | you'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:56 | disruptek | ergo, permissions are correctly doing their job and preventing you from determining the existence of the file. |
14:39:29 | sealmove | But the parent dir and the file do have sufficient permission, just not the grand-parent dir |
14:40:14 | sealmove | Do I need to have sufficient permission in all ancestor dirs recursively? |
14:40:41 | disruptek | directory 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:14 | sealmove | I've set the x bit for the directory |
14:41:33 | disruptek | well, no one can say you aren't a badass. |
14:44:45 | sealmove | is it possible to make a single file in /root accessible from other users without changing the permissions of /root dir? |
14:45:06 | FromGitter | <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:05 | disruptek | sealmove: it depends on the access of the users and the permissions and ownership of the directory, right? |
14:46:34 | krux02 | mratsim: I don't think replacing the NimVM simply with LLVM is not feasible right now. |
14:46:59 | FromGitter | <mratsim> I like the NimVM |
14:47:08 | krux02 | I do like it, too. |
14:47:09 | FromGitter | <mratsim> even though I raise many bugs against it. |
14:47:27 | krux02 | yea, there are (were) many bugs in it |
14:47:29 | FromGitter | <mratsim> and it's actually surprisingly fast |
14:48:08 | krux02 | well I think it should be as fast as python |
14:48:14 | FromGitter | <mratsim> I'll have to see when my compiler is more fleshed out but it seems good. |
14:50:01 | Araq | fact: 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:12 | noonien | are 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:41 | Cea | I'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:45 | Cea | Uploaded file: https://uploads.kiwiirc.com/files/fd6ebb122436dd2105005f6be2ae667b/pasted.txt |
15:01:38 | clyybber | Araq: What does {.nodestroy.} actually do? |
15:02:25 | Araq | Cea, ping shashlick |
15:02:38 | Araq | clyybber, it prevents destructor injections |
15:02:56 | Cea | I'll try again he didn't respond earlier :'( shashlick |
15:03:14 | shashlick | I was sleeping |
15:03:23 | shashlick | And am at work now, but will take a look |
15:03:41 | Cea | Ah, thank you! |
15:05:27 | * | absolutejam2 quit (Ping timeout: 245 seconds) |
15:06:35 | clyybber | Araq: Ah ok. Umm so for non-ref objects =move is the same as = right? And =destroy stays as is? |
15:06:58 | clyybber | I'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:25 | FromGitter | <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:24 | disruptek | wrong of seven versions of sameTree, i'm afraid. |
15:12:02 | * | hoijui joined #nim |
15:12:56 | Araq | clyybber, I don't see why tbintree2 should be changed :P |
15:14:03 | clyybber | Araq: Ok, then the error is on my side.. damn :D |
15:27:56 | clyybber | bbl |
15:27:57 | * | clyybber quit (Quit: WeeChat 2.5) |
15:37:38 | Araq | https://github.com/nim-lang/Nim/issues/11165 really? |
15:40:36 | * | jmiven quit (Quit: reboot) |
15:41:26 | * | jmiven joined #nim |
15:46:53 | shashlick | Fun stuff |
15:47:55 | * | yeetcannon quit (Remote host closed the connection) |
15:48:54 | * | yeetcannon joined #nim |
15:51:18 | Araq | I 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:35 | Araq | don't delete files that Nim is running. |
15:51:58 | disruptek | so many rules. :-( |
15:54:16 | Araq | it's not a rule, it's simply common sense |
15:55:17 | disruptek | it's just another example of The Man tryin' to cramp my style, man. |
15:56:09 | dom96 | bah, is this why Nimble copies all files to /tmp now? |
15:58:56 | * | Cea quit (Remote host closed the connection) |
16:09:01 | shashlick | Well even if you run with a non existent file name you get a random error |
16:09:26 | shashlick | @dom96 that's a different nimble c issue |
16:11:46 | * | dgreen joined #nim |
16:19:53 | dom96 | btw I was thinking it might make sense to allow `>= #commithash` in Nimble |
16:20:06 | dom96 | would be slow though :( |
16:20:50 | dom96 | but would probably be possible to optimise it by reimplementing some Git/Hg logic |
16:20:52 | disruptek | those who want it are willing to pay for it. |
16:21:39 | * | hoijui quit (Ping timeout: 264 seconds) |
16:21:47 | shashlick | @dom96 - do you mean in the require statement? isn't that already allowed? oh you mean >=, right now it is hard coded |
16:22:14 | dom96 | yes, right now you can only depend on a specific commit hash |
16:24:08 | disruptek | now just add negation and you will have implemented my rfc. |
16:25:11 | shashlick | will it help with lock files? |
16:28:58 | * | leorize_ joined #nim |
16:31:56 | * | leorize quit (Ping timeout: 260 seconds) |
16:35:53 | Araq | disruptek, who is it "your style"? do you remove files nilly willy when you're bored? |
16:35:56 | Araq | *how |
16:38:11 | disruptek | i'm being sarcastic. seems unreasonable to support it to me too. it's silly. |
16:38:26 | disruptek | i've always had a penchant for removing files, though. |
16:40:13 | dom96 | shashlick won't really help lock files |
16:42:29 | shashlick | I don't think issue #11165 is understood correctly - the way to reproduce is not the use case |
16:42:45 | shashlick | fact 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:14 | shashlick | what does `(1, 21) Error: undeclared identifier: 'a'` have to do with the filename |
16:43:29 | shashlick | it acts as if there's a problem in the file contents |
16:45:48 | * | actuallybatman joined #nim |
16:47:01 | Araq | well then say that in the issue? |
16:47:18 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:47:32 | shashlick | ya, it's poorly written and distracts from the real issue |
16:49:37 | shashlick | well, on second thought, this @genotrance guy did find a real issue 🙂 |
16:49:51 | shashlick | if the file is deleted while running, it does fail that way |
16:50:22 | shashlick | but if a file doesn't exist at all also it fails the same way |
16:51:15 | * | ng0 joined #nim |
16:52:01 | shashlick | anyway, 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:18 | Araq | ty |
17:19:26 | * | elrood joined #nim |
17:20:02 | FromGitter | <alehander42> are you genotrance |
17:20:08 | FromGitter | <alehander42> i am so confused |
17:20:18 | lqdev[m] | yes |
17:20:23 | lqdev[m] | shashlick == genotrance |
17:20:44 | * | shomodj joined #nim |
17:21:27 | FromGitter | <alehander42> mama mia |
17:21:34 | FromGitter | <alehander42> ok |
17:21:39 | FromGitter | <alehander42> updating my own human-dns records |
17:22:06 | shashlick | keep people on their feet 😄 |
17:22:49 | FromGitter | <alehander42> yes, people walk too slowly on their hands |
17:23:21 | shashlick | indeed |
17:23:54 | shashlick | who is niv |
17:24:04 | shashlick | are they on irc |
17:24:36 | FromGitter | <alehander42> maybe we are all genotrance |
17:28:47 | Araq | I'm Negan |
17:29:30 | * | stefanos82 quit (Quit: Quitting for now...) |
17:30:25 | disruptek | i'm sorry... :-( |
17:30:43 | dom96 | Am I genotrance? |
17:32:03 | * | Cea joined #nim |
17:33:15 | Cea | shashlick any luck with the embeded union? |
17:34:21 | shashlick | nope, snippet sites are blocked from work, will take a look later today |
17:34:52 | shashlick | what timezone are you in |
17:35:57 | Cea | Central, 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:46 | FromGitter | <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:36 | FromGitter | <mratsim> This project probably has one fo the most appealing presentation and github readme ever: https://cpp-taskflow.github.io/#/ |
18:10:54 | Zevv | so what is this taskflow, and can we have it in Nim |
18:11:34 | disruptek | that's a cute piece of software. |
18:11:47 | Zevv | quick, no one is looking, port it and put it in the stdlib! |
18:11:53 | FromGitter | <brentp> wow. that is nice |
18:11:58 | Zevv | it has dot graphs. I love dot graphs. it must be good |
18:13:38 | dgreen | @mratsim do you have a moment? |
18:13:48 | FromGitter | <mratsim> yep |
18:14:25 | FromGitter | <mratsim> @Zevv, I think I'll pass my weekend on Task parallelism and give my take at the threadpool revamp :p |
18:14:36 | dgreen | I 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:54 | Zevv | mratsim: inspired? :) |
18:15:19 | FromGitter | <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:29 | FromDiscord_ | <kodkuce> hmm, is compiler troling me or soemthing changed in 0.20 |
18:15:31 | FromDiscord_ | <kodkuce> proc send_activation_mail(id,email:string){.gcsafe, async.}= |
18:15:48 | disruptek | could be a little of both. |
18:16:12 | FromDiscord_ | <kodkuce> Error: 'send_activation_mailIter' is not GC-safe as it accesses 'secret_jwt' which is a global using GC'ed memory |
18:16:48 | FromDiscord_ | <kodkuce> shoudent .gcsafe oweride this compile error |
18:16:54 | disruptek | i think i just ran into that yesterday. |
18:17:05 | FromGitter | <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:38 | dgreen | Ok, thanks, I have one more question to add if I may |
18:17:57 | disruptek | secret_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:09 | FromDiscord_ | <kodkuce> yep its global |
18:18:24 | FromDiscord_ | <kodkuce> it worked before in 19 for sure |
18:18:24 | FromGitter | <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:37 | disruptek | what 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:39 | dgreen | In 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:01 | dgreen | Example 2 (and others) for instance: let optim = model.optimizerSGD(learning_rate = 0.01'f32) |
18:21:06 | FromGitter | <mratsim> the new parameter can be optional parameters with a default value at the end |
18:21:33 | FromGitter | <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:35 | FromDiscord_ | <kodkuce> so should i w8 masters fix it or waht |
18:22:26 | dgreen | Oh 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:06 | FromGitter | <mratsim> mmmh the var is actually unnecessary |
18:23:23 | dgreen | Is it? |
18:23:38 | FromGitter | <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:50 | dgreen | Trying to do something like apply2_inline(self.first_moments[i], v.grad): would require self to be var wouldn't it? |
18:23:53 | FromGitter | <mratsim> ah yes it's needed, Adam is not a ref object |
18:24:32 | FromGitter | <mratsim> yes |
18:24:57 | dgreen | Ah 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:26 | dgreen | Perhaps I should move "with momentum" to be a new type? |
18:25:28 | FromGitter | <mratsim> so you can introduce a new type SGDMomentum, with an optional flag for nesterov |
18:25:54 | sealmove | jeez, what exactly is `pattern` in walkDirs? does it search relative to the executable's path? |
18:26:02 | dgreen | Ok I'll do that, I think that's the best option |
18:26:10 | FromGitter | <mratsim> sounds good, thank you |
18:26:12 | dgreen | Thank you :) |
18:27:56 | FromGitter | <mratsim> github notifications are real bad |
18:28:05 | FromGitter | <mratsim> I only see like the last 5 |
18:29:23 | dgreen | Oh no worries I figured as much which is why I tracked you down on the irc |
18:30:18 | FromGitter | <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:06 | dgreen | Oh awesome thanks! |
18:32:17 | dgreen | Zobrist hashing caused me a lot of headache when I was first implementing it |
18:32:33 | dgreen | Your implementation is a lot more elegant though |
18:33:52 | shashlick | @mratsim if you use slack, check out notipy |
18:34:24 | FromGitter | <mratsim> so I create a slack team for me alone? |
18:34:33 | shashlick | Brings my github notifications into slack |
18:34:47 | shashlick | Can sort into different channels |
18:35:05 | shashlick | Well if you use it already, then can just put it in a channel you create |
18:35:17 | FromGitter | <kaushalmodi> Araq: looking at https://github.com/nim-lang/Nim/commit/dc38b88f7ecd2d690d22cd107388cf95122c9eb0 .. |
18:35:19 | shashlick | If not then ya, use it how I have |
18:35:53 | * | dgreen quit (Remote host closed the connection) |
18:36:09 | FromGitter | <kaushalmodi> why not define those warn enums as: ⏎ ⏎ ```warnUnusedImportX = "UnusedImport"``` ⏎ ⏎ and so on [https://gitter.im/nim-lang/Nim?at=5d320d995ea6e644ece396cd] |
18:36:19 | shashlick | I'm a team of one |
18:36:32 | shashlick | If you want I can invite you into this team |
18:37:04 | FromGitter | <mratsim> :D |
18:38:37 | FromGitter | <mratsim> I think I saw a project with a CLI that just received all github updates |
18:39:00 | FromGitter | <mratsim> or it could even be a terminal frontend, like something for termux |
18:40:19 | FromGitter | <mratsim> maybe this: http://nodegh.io |
18:41:24 | shashlick | I'll send you a screenshot of how it looks |
18:41:44 | dom96 | All these tools should be written in Nim |
18:43:32 | FromGitter | <kaushalmodi> I know one nimble package that deals with GitHub API: https://github.com/kdheepak/github-release |
18:43:33 | FromGitter | <kaushalmodi> it |
18:43:39 | FromGitter | <kaushalmodi> it's pretty neat |
18:43:52 | * | nsf joined #nim |
18:44:41 | * | narimiran quit (Remote host closed the connection) |
18:47:02 | FromGitter | <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:12 | FromGitter | <brentp> I see: ``` |
18:47:18 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d321036a0351b1a8c61b796] |
18:47:21 | FromGitter | <brentp> bah |
18:47:46 | dom96 | nimble install websocket@#head |
18:48:25 | FromGitter | <brentp> cheers. |
18:50:10 | FromGitter | <alehander42> i dont even write parallel software |
18:50:16 | FromGitter | <alehander42> but now i plan to use cpp taskflow |
18:50:25 | disruptek | lol |
18:51:22 | Cadey | is there an either type in the standard library? |
18:51:47 | dom96 | Not as far as I'm aware, would be nice to have though |
18:51:51 | sealmove | wow strscans is awesome! |
18:52:32 | * | dgreen joined #nim |
18:52:55 | Cadey | how should I go about making an Either? |
18:53:31 | dom96 | object variant |
18:53:39 | dom96 | similar to how we implement Option[T] |
18:53:57 | dom96 | may as well put it in options module as well |
18:53:59 | Cadey | what type is SomePointer? |
18:55:09 | FromGitter | <mratsim> @dom96, "All those tools should be made in Nim" > Need time, and manpower |
18:55:26 | FromGitter | <alehander42> щея |
18:55:27 | FromGitter | <alehander42> yes |
18:55:34 | FromGitter | <alehander42> but this is something we should do |
18:55:39 | FromGitter | <mratsim> @Cadey: https://github.com/vegansk/nimfp/blob/master/src/fp/either.nim#L12-L21 |
18:55:44 | FromGitter | <alehander42> nice libs and tools are what is going to get mindshare |
18:55:53 | FromGitter | <alehander42> at least as much as nice language features |
18:55:56 | FromGitter | <alehander42> if not even more |
18:56:00 | Cadey | interesting |
18:56:01 | FromGitter | <alehander42> at this phase |
18:56:20 | FromGitter | <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:02 | Araq | > Error: 'send_activation_mailIter' is not GC-safe as it accesses 'secret_jwt' which is a global using GC'ed memory |
18:57:16 | Araq | seems to me the compiler is now corect and previously it wasn't |
18:58:15 | FromGitter | <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:27 | disruptek | Araq: 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:47 | FromGitter | <kaushalmodi> Araq: Any comment about https://irclogs.nim-lang.org/19-07-2019.html#18:36:09 ? |
19:00:17 | shashlick | I would have made notipy in Nim expect for htmlslacker py module |
19:01:35 | dom96 | mratsim: 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:04 | FromGitter | <mratsim> how much time do you have to sink? :p |
19:02:17 | dom96 | not a lot :) |
19:02:25 | dom96 | I'd prefer something simple/quick but effective |
19:02:59 | FromGitter | <mratsim> use an "expert system", like heuristics about size, surroundings, your speed |
19:03:02 | dom96 | I'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:03 | shashlick | Araq: I've run into an issue with my shared seq poc |
19:03:48 | dom96 | Expert system seems to be basically what I have already heh |
19:03:49 | shashlick | Even if I am allocating shared memory for the data in my shared seq |
19:04:15 | FromGitter | <mratsim> for evolution, genetic algorithms are well documented |
19:04:23 | shashlick | When I want to copy a string, a deep copy is still going to use gc memory right? |
19:04:23 | FromGitter | <mratsim> this might save you time: https://github.com/toshikiohnogi/nimga |
19:04:23 | dom96 | yeah, that's what I was thinking |
19:04:45 | dom96 | I wrote a GA in Python a really loooong time ago |
19:05:27 | shashlick | Cause I don't really copy over any ref or ptr data being pointed to |
19:05:28 | Araq | mratsim: closures do work and nothing "triggers" the GC cause there ain't any |
19:05:34 | FromGitter | <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:39 | dom96 | mratsim: ever watched Code Bullet on YouTube? He seems to like Q learning |
19:06:19 | Araq | kaushalmodi: good point, the reason it was done this way was pure legacy |
19:06:23 | FromGitter | <mratsim> never watched |
19:06:33 | Araq | and now that I made a mistake with it, it's time to change it |
19:06:37 | dom96 | btw this needs to be reasonably fast too, I want to run 100s of these (and possibly on phones too) |
19:06:44 | disruptek | wow, i was looking for ga in nim and never found anything. |
19:07:12 | FromGitter | <mratsim> I'm pretty sure there is another one, because I remember starring one |
19:07:20 | disruptek | oh, i guess this is new. |
19:07:24 | dom96 | Do you really need a library for GA? From what I remember it seems easier to just create something yourself |
19:07:47 | FromGitter | <mratsim> here you go: https://github.com/peheje/nim_genetic |
19:07:54 | FromGitter | <mratsim> I think it's easy |
19:08:08 | FromGitter | <mratsim> see: https://github.com/peheje/nim_genetic/blob/master/GeneticAlgorithm/nim_genetic.nim |
19:08:12 | disruptek | there 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:21 | shashlick | Araq: https://github.com/genotrance/shared/blob/master/shared/seq.nim#L64 |
19:08:29 | * | yeetcannon joined #nim |
19:10:20 | FromGitter | <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:41 | FromGitter | <mratsim> but for now you can use it to test those on pongs, space invaders, and the like |
19:11:09 | FromGitter | <mratsim> trying to implement those led me to find bottlenecks in Arraymancer that I want to fix first |
19:11:34 | krux02 | sdl1? |
19:12:44 | FromGitter | <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:21 | Araq | shashlick, what's the question? you can't copy stuff like that |
19:50:24 | Araq | use deepCopy |
19:56:02 | shashlick | Even if I use deep copy which I am in local code |
19:56:14 | shashlick | It won't recurse into pointers right? |
19:56:38 | shashlick | And if it does, it will still use thread local memory |
19:57:22 | shashlick | Like a Nim string is an integer and pointer to the string data |
19:57:29 | Araq | it does recurse, that's the point of the word 'deep' |
19:57:48 | Araq | but it uses the threadlocal allocator for construction, yes |
19:58:17 | shashlick | So there's no way to really do this generically |
19:58:40 | shashlick | In shared string, I'm copying every char so that's working fine |
19:59:42 | Araq | copy over to what? to something that uses 'allocShared'? |
19:59:51 | shashlick | Yes |
20:00:33 | shashlick | So adding to a shared seq is copying over T to shared memory |
20:01:08 | shashlick | But that T can only be non gc primitives or objects without refs or ptr fields recursively |
20:01:52 | shashlick | So sizeof(T) should give me all the contents |
20:02:47 | shashlick | Now 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:12 | shashlick | Then sizeof will continue to work correctly, and so will deep copy |
20:03:27 | shashlick | Or even copy mem for that matter |
20:04:46 | shashlick | I still have no solution for ptr or ref content though |
20:05:51 | Araq | yes, it is stored inline |
20:06:08 | shashlick | Unless I write my own deep copy that uses shared memory instead |
20:06:31 | shashlick | Any suggestions? |
20:07:36 | Araq | use a macro over getType() to implement a sharedDeepCopy |
20:07:54 | shashlick | Ok I'll look at how deep copy is implemented |
20:08:09 | Araq | don't, it's old stuff that uses RTTI |
20:08:44 | Araq | getType() is usually much better as it encourages you to write the performant version of things |
20:08:48 | shashlick | Ok, I'll also have to write code to recursively free the memory but will leverage the same algorithm |
20:09:36 | shashlick | This code with some modifications is only 70x slower than Nim proper so there is hope for a more performant implementation |
20:09:42 | Araq | you should give --newruntime a try |
20:10:26 | shashlick | Will do - how would all this change with new runtime? |
20:10:48 | Araq | it'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:11 | Araq | yeah, it will all change with --newruntime. |
20:11:20 | Araq | you can throw away most of your code then |
20:11:24 | Araq | :-) |
20:12:16 | * | yeetcannon quit (Remote host closed the connection) |
20:12:43 | * | xet7 joined #nim |
20:14:40 | shashlick | woot |
20:16:26 | Araq | it uses shared memory for strings and seqs then |
20:17:02 | shashlick | perfect - 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:13 | Araq | good night |
20:26:53 | shashlick | @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:05 | S4ms0n | Anyone 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:13 | FromGitter | <awr1> what are anonymous mmaps |
21:34:19 | * | yeetcannon joined #nim |
21:35:40 | FromGitter | <awr1> b/c i'm googling and i'm getting confused descriptions |
21:35:58 | FromGitter | <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:06 | FromGitter | <awr1> *virtual memory |
21:36:17 | FromGitter | <awr1> *always in RAM |
21:37:05 | FromGitter | <awr1> but some other site says it's like "reserving RAM" which makes me think of VirtualAlloc with MEM_RESERVE |
21:38:37 | S4ms0n | Exactly |
21:39:25 | S4ms0n | Your using the posix mmap() system call instead of the break()/sbrk() system calls. |
21:39:47 | * | jjido quit (Client Quit) |
21:40:07 | S4ms0n | With mmap() you can just munmap() the memory when your done, thereby returning it to the system. |
21:40:47 | S4ms0n | With 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:44 | lqdev[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:47 | lqdev[m] | I suppose `cast[char](x)`? |
21:46:28 | FromGitter | <brentp> is a RangeError when e.g. a uint goes < 0? |
21:54:16 | lqdev[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:11 | sealmove | :DDD https://github.com/fish-shell/fish-shell/issues/862 |
22:31:47 | sealmove | @timotheecour |
22:32:49 | shashlick | @Cea - here's a working quickjs wrapper - http://ix.io/1OWi/nim |
22:33:05 | * | elrood quit (Remote host closed the connection) |
22:33:39 | shashlick | unfortunately there's many manual changes needed after generating the nim code so there's no automatic method |
22:37:17 | FromGitter | <brentp> hadn't heard of quickjs. how's it compare to duktape? |
22:37:52 | * | sealmove quit (Quit: WeeChat 2.5) |
22:38:24 | FromGitter | <brentp> oh. it was released 10 days ago. |
22:38:35 | * | shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:40:37 | shashlick | @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:02 | shashlick | @brentp - i've not really tried either out - i'm just the wrapper guy 😄 |
22:42:30 | FromGitter | <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:15 | dom96 | Offtopic: 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:52 | disruptek | dom96: whois? |
22:47:15 | dom96 | only a vague name there and an email to abuse@ |
22:48:30 | shashlick | perhaps some intense googling looking for someone using that url in a personal context |
22:51:15 | dom96 | So frustrating. I can see the page in archive.org |
22:51:43 | dom96 | it's some product page, but there is no contact info or any names or anything |
22:51:55 | dom96 | There 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:09 | FromGitter | <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 |