<< 11-06-2018 >>

00:18:20*dddddd quit (Remote host closed the connection)
00:28:22*CodeVance quit (Ping timeout: 268 seconds)
00:44:30*SenasOzys quit (Ping timeout: 256 seconds)
02:04:15*SenasOzys joined #nim
02:12:33*thomasross joined #nim
02:13:44*CodeVance joined #nim
02:29:54*CodeVance quit (Ping timeout: 256 seconds)
02:31:12*CodeVance joined #nim
02:37:05CodeVancehow do I report a bug for the nim-lang forums?
02:52:30FromGitter<Varriount> CodeVance: In the NimForum GitHub repository
03:05:56CodeVancedone :|
03:46:56*girvo quit (Ping timeout: 268 seconds)
03:47:35*girvo joined #nim
03:55:44*felx joined #nim
03:57:37FromGitter<Varriount> Araq: Any opinion on critbit trees?
04:00:09*felx quit (Ping timeout: 260 seconds)
04:02:12FromGitter<data-man> @Varriount: What problems with CBT?
04:02:48FromGitter<Varriount> No problems, I just want to know how it compares to, for example, searching a table or doing sequential comparison.
04:02:58FromGitter<Varriount> I'm writing a parser, and need to map strings to enum values
04:04:59FromGitter<data-man> binarySearch & upperBound?
04:05:22FromGitter<Varriount> Hm?
04:07:02FromGitter<data-man> ```type ⏎ record = tuple[s: string, v: enumType] ⏎ records = seq[record]``` [https://gitter.im/nim-lang/Nim?at=5b1df566a09ae108e61577af]
04:07:11shashlickvarriount: is it possible to -d:xyz in a .nim file? I want to -d:usePcreHeader in a nimble library
04:09:08FromGitter<Varriount> shashlick: You could probably do it through nimscript, however I'm not aware of a way to do it in code that is being compiled.
04:09:49FromGitter<Varriount> I mean, you have no guarantee that, by the time you call whatever proc would `-d` something, the module hasn't already been parsed/loaded by the compiler.
04:10:00FromGitter<kayabaNerve> @Varriount We don't have a define pragma? Weird..
04:10:35FromGitter<kayabaNerve> I just looked through all the pragmas for something to do this. Doesn't exist...
04:12:12CodeVancehow to make a ref int and set its value at the same time :|
04:13:39FromGitter<kayabaNerve> var a: ref int = new(int); a = 6
04:14:09FromGitter<kayabaNerve> *a[] = 6
04:14:38FromGitter<Varriount> @kayabaNerve How would such a pragma work? `-d` symbols need to be known before compilation starts, so that all modules have the same set of defines.
04:15:29FromGitter<kayabaNerve> Fair enough. I'm not saying it's a good idea. I'm saying I'm surprised we didn't have one. Now I'm not surpised
04:17:11FromGitter<kayabaNerve> CodeVance: `var a: ref int = new(int); a[] = 6` That's the best you can do. Not just resending it because you didn't respond. Resending because I didn't ping you and I made a typo and I want to clear it all up.
04:17:28FromGitter<kayabaNerve> But I'm basically and truly just saying you can't.
04:17:47FromGitter<kayabaNerve> Just like you can't use malloc and set it at the same time
04:17:49CodeVanceOk thanks kayaba. Cause I wasn't sure whether the was a better way
04:17:59FromGitter<kayabaNerve> There is. Don't use one line
04:18:18CodeVanceyeah. I'll make a proc if I **really** need to do it
04:18:45CodeVanceprob with your oneliner is that it doesn't work in a var block
04:18:45FromGitter<data-man> ``` usePcreHeader {.intdefine.} = 0```
04:18:46FromGitter<Varriount> @kayabaNerve That's usually my answer when someone asks, "How can I do X in one line?".
04:19:24FromGitter<Varriount> @data-man That binds a `-d` value to a variable.
04:19:31FromGitter<kayabaNerve> @Varriount So are we code answer brother now? Wanna just... hang out sometime?
04:20:04FromGitter<kayabaNerve> Ref to XKCD 165 https://xkcd.com/165/
04:20:58FromGitter<data-man> @Varriount I know. Maybe I misunderstood what he wanted. :)
04:21:01CodeVancehahah
04:22:52FromGitter<kayabaNerve> @data-man I saw that. That means you can setup a bool and maybe use when with the compileTime pragma
04:22:57FromGitter<kayabaNerve> But you're still passing -d:
04:23:15FromGitter<kayabaNerve> Except now you have a default value that doesn't work as #define
04:23:24FromGitter<kayabaNerve> And would take a long time to get working if it could work
04:25:20FromGitter<data-man> define for C compiler?
04:25:43FromGitter<kayabaNerve> I assume whatever they're doing ends up as a #define
04:25:46FromGitter<kayabaNerve> No actual idea
04:27:07FromGitter<data-man> emit pragma?
04:28:31FromGitter<kayabaNerve> Missed that; good to remember
04:28:54FromGitter<kayabaNerve> Apparently this is to fix a static program bug with GLibC?
04:29:01FromGitter<kayabaNerve> https://forum.nim-lang.org/t/2236
04:38:06FromGitter<Varriount> @kayabaNerve Moving Linux binaries across distributions is usually a big no-no.
04:38:30FromGitter<Varriount> Not unless one distribution advertises "binary compatibility" with another.
04:40:17*Tanger quit (Remote host closed the connection)
04:44:56FromGitter<kayabaNerve> Depends on the dependencies
04:45:06FromGitter<kayabaNerve> As in what dynamic libs it requires
04:45:23FromGitter<kayabaNerve> Or what APIs it interfaces with
04:54:27*Electrux joined #nim
04:57:03FromGitter<Varriount> Hm, a wishlist feature: On signature mismatch, have Nim recommend imports that might resolve the mismatch.
04:59:09*Electrux quit (Ping timeout: 264 seconds)
04:59:33CodeVanceMe 2
05:01:00*Electrux joined #nim
05:16:56*yglukhov[i] joined #nim
05:24:27*Electrux quit (Ping timeout: 265 seconds)
05:27:44shashlicksorry was away
05:27:57shashlicki tried that data-man, didn't work
05:28:42shashlickI'm this close to creating nimpcre - which will compile in pcre so you don't need the dll anymore
05:29:30shashlicknimble install, import nimpcre and that's it
05:29:57shashlickonly hold out is the usePcreHeader - have to pass it with a nim.cfg so that's extra work for the consumer
05:30:19*nsf joined #nim
05:34:47*yglukhov[i] quit (Ping timeout: 276 seconds)
05:38:12*CodeVance left #nim (#nim)
05:46:53*Electrux joined #nim
05:54:17*Electrux quit (Ping timeout: 255 seconds)
05:56:19*Electrux joined #nim
05:57:13*jjido joined #nim
06:15:05*yglukhov[i] joined #nim
06:29:45*xkapastel quit (Quit: Connection closed for inactivity)
06:33:22*yglukhov[i] quit (Read error: Connection reset by peer)
06:34:01*yglukhov[i] joined #nim
06:45:43*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:46:21*yglukhov[i] quit (Read error: Connection reset by peer)
06:46:59*yglukhov[i] joined #nim
06:49:10FromGitter<alehander42> yeah, who uses mutable json :O
06:50:04FromGitter<alehander42> I usually try to iterate on json, or directly convert it to a lang structure, and change that
06:50:35*xkapastel joined #nim
06:54:50*yglukhov[i] quit (Ping timeout: 265 seconds)
06:55:38shashlickhttps://github.com/genotrance/nimpcre - you no longer need to be averse to using PCRE
07:02:40*yglukhov[i] joined #nim
07:02:57*PMunch joined #nim
07:08:45*girvo quit (Ping timeout: 264 seconds)
07:09:03*girvo joined #nim
07:11:27*girvo quit (Client Quit)
07:11:52*girvo joined #nim
07:13:41*Sembei quit (Ping timeout: 265 seconds)
07:22:29*arecaceae quit (Remote host closed the connection)
07:22:52*arecaceae joined #nim
07:24:00*Sembei joined #nim
07:24:59*jjido joined #nim
07:25:14*yglukhov[i] quit (Remote host closed the connection)
07:25:48*yglukhov[i] joined #nim
07:27:59*yglukhov[i] quit (Read error: Connection reset by peer)
07:30:26*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:30:30*girvo quit (Ping timeout: 260 seconds)
07:30:54*girvo joined #nim
08:01:32*Vladar joined #nim
08:01:40*dddddd joined #nim
08:02:27*gmpreussner_ quit (Ping timeout: 240 seconds)
08:05:23*gmpreussner joined #nim
08:11:57*Arrrr joined #nim
08:15:08*yglukhov[i] joined #nim
08:19:23*yglukhov[i] quit (Remote host closed the connection)
08:19:37*yglukhov[i] joined #nim
08:20:30*floppydh joined #nim
08:22:20FromGitter<diegogub> hi guys, I still have a issue with a project.. I can built it with no problem in mac, but while building it on linux I have to do it like : nimble build -l:-pthread
08:27:19*Arrrr left #nim (#nim)
08:27:24*Arrrr joined #nim
08:40:42*lainon quit (Remote host closed the connection)
08:50:51FromGitter<dom96> --threads:on?
09:13:41*yglukhov_ joined #nim
09:16:30*yglukhov[i] quit (Ping timeout: 245 seconds)
09:18:00*user1101 joined #nim
09:19:50user1101Hello, What's the best way to get a 1-indexed seq in Nim? I know it's easy to get arrays, var arr: array[1 .. 100, int] and I would use it but I do not know the length ahead of time. Thanks.
09:22:09FromGitter<Vindaar> Hey! You can simply define a seq like `var s: seq[int] = @[]`, which has size 0. Then just use the `add` proc to add elements to it
09:25:54user1101Thanks but I forgot to mention, I want it to be space-efficient. The seq will contain big objects and I do not want a default initialized object to be allocated to sit at 0.
09:25:57*girvo quit (Ping timeout: 240 seconds)
09:26:39*girvo joined #nim
09:30:19FromGitter<andreaferretti> Nim is now at 5000 starr!
09:30:24FromGitter<andreaferretti> stars!
09:30:27FromGitter<andreaferretti> :-)
09:31:12Arrrrtry var s:seq[1..10]
09:31:37PMunchArrrr, but he didn't know the size ahead of time
09:31:39FromGitter<andreaferretti> and 666 forks :-P
09:32:10ArrrrAh, that's right
09:32:13PMunchWill var s: seq[0..int.high, <type>] actually allocate anything?
09:32:33FromGitter<diegogub> @dom96 tried, not working..but why would it change between OSX and Linux?
09:32:46PMunchWell 1..int.high if you want it 1 indexed
09:34:32user1101Thanks, PMunch. Also, why does idiomatic Nim (Nim from the standard library) choose to pick `int` instead of `uint` for container size types? Any special reasons? I am too used to `ulong` or even `usize`
09:34:33PMunchOh wait, that doesn't work for seqs..
09:34:47user1101yup
09:34:51PMunchWell, using uints is kinda error prone..
09:34:54FromGitter<dom96> Yeah... You can't do that with seqs
09:35:36FromGitter<dom96> @diegogub because they are different platforms. What are you trying to do?
09:37:27FromGitter<diegogub> just a Makefile..but failed under linux
09:40:54PMunchHmm, I tried something like this: http://ix.io/1cZa/ but it's still 0 indexed
09:41:16PMunchYou could do it with a distinct type, but then you'd have to borrow all the stuff you wanted to use
09:42:15PMunchYou could of course create your own access procedure
09:42:53*krux02 joined #nim
09:43:00user1101Yeah, I think I'll just go and make a container wrapped around seq
09:43:17FromGitter<ephja> that's actually just a type alias
09:44:58PMunchephja, yeah I realised
09:45:01krux02user1101, I just joined, and I am on IRC so I don't have history. But often when you would do a container wrapper, you could also just add the procs the the seq type itself, then you have still all the features of a normal seq inherited (maybe that is exactly what you want to avoid)
09:50:28FromGitter<ephja> "no field symbol" interesting (not internal) error message :p
10:02:32*zahary joined #nim
10:02:48zaharyHey, we'll hit 5000 stars on Github today :)
10:03:40zaharyback when I was a CTO of a small company, I considered 5000 stars the point where I'll be able to push Nim as a mainstream technology to the company owners
10:06:13FromGitter<mratsim> This is history
10:06:19FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/8n4b/2018-06-11_12-05-40.png)
10:06:21krux02zahary: well at least be honest about Nim
10:07:02krux02as soon as companies with money invest in a technology they push it to not break mistakes from the past
10:10:13user1101Check again, Nim is not 5k stars! :)
10:10:21user1101now*
10:10:26Yardanicouser1101, why did you do that? :( :P
10:12:04livcdI wonder if MS invests some money in Ruby now that they acquired github. but i doubt it
10:12:38Entropiclivcd: nah
10:12:48Yardanicolivcd, they will rewrite it in C# :D
10:13:18PMunchMaybe we'll get VB git-hooks :P
10:13:40FromGitter<andreaferretti> it was definitely 5000 stars a few minutes ago
10:14:21livcdi see it's 5001
10:14:58Yardanicolivcd, people unstarring and starring nim repo for fun :)
10:19:05krux02Araq: I have a question about getImpl on a proc
10:19:29krux02for me this output here is very surprising: http://ix.io/1cZl
10:20:02krux02the proc def has a lot of ident nodes in it, no symbols are resolved
10:20:14krux02but then in the body of the node, there are symbols used
10:20:54krux02especially the arg symbol in the body of the implementation does not equal to the arg identifier in the formal params
10:21:25krux02but it is equal to the arg symbol from the procTy node that I get from getImpl
10:21:58*SenasOzys quit (Ping timeout: 264 seconds)
10:22:00krux02I this this is very strange and surprising
10:22:48krux02I thought that a typed node is cleared to have all identifiers resolved, but this is clearly not the case here
10:23:07krux02so I wonder the design decisions behind it, of it it is just Historic growth
10:29:33*BitPuffin joined #nim
10:35:10*user1101 quit (Ping timeout: 268 seconds)
10:38:21dom96The number of watchers is far more valuable
10:38:43dom96250 is pretty good
10:39:51*xkapastel quit (Quit: Connection closed for inactivity)
10:42:04*Vladar quit (Quit: Leaving)
10:43:01FromGitter<alehander42> it seems it's usually ~ 5% of the stars
10:43:08FromGitter<alehander42> when I look at other lang repos
10:44:06krux02not always
10:44:32Yardanicodepends, e.g. there's a lot of "hyped" js projects which have A LOT of starts
10:44:34Yardanico*stars
10:45:25krux02much more important than 5000 stars, are the 666 forks
10:47:41krux02Yardanico, I tried to understand this phonomenon "javascript" for quite some time now. I can't think differently that js is quite a bad and broken language. But still there are countless people Heavily invested in it who will always defend it. They even get excited about when you say that something is developed in javascript.
10:47:52krux02I mean it's the same here in Nim as well.
10:48:16PMunchWell, JS grew big because it was the only option for web
10:48:42PMunchThen all the web-devs realised they could do backend programming with node. And from there it just kinda snowballed into what it is today
10:49:01krux02when you put on the feature list "fully developed in Nim" it will make you happy when you are a Nim developer. Even though technically who cares if it is done in any other language under the hood as long as on the surface it is very usable
10:49:17PMunchJS had very low bar of entry as well, just type something in a file and open it in your browser. No need to install anything, set up a compiler, or anything like that.
10:49:35Yardanicoyeah, I think A LOT of devices in the world can run JS
10:49:44krux02PMunch: that is what basic was supposed to be
10:49:48krux02and bash
10:50:00PMunchAnd they are, for their platforms
10:50:54PMunchThe beauty of JS is that it caught on with all the major browsers, so you could do things no matter what OS you have
10:51:09kinkinkijkinI don't like bash or js, but basic is okay for its time
10:51:10krux02it's not just that
10:51:33krux02there is also a lot of phsychology why people love this objectively bad Language
10:51:39*Vladar joined #nim
10:51:52Yardanicojust an example of (probably) a bit "hyped" project - https://github.com/klauscfhq/signale :)
10:51:55PMunchPlus it's very graphical. Before you started programming you probably only used graphical applications, so that is what you want to create. And GUIs in any language is terrible, but the HTML+JS is at least easy to work with (to some extent)
10:51:59Yardanico>5k stars, <100 watchers
10:53:16PMunchBash is decent and the language with great composability because of how shell programs works on Linux. But it's syntax is very strict and seems a bit arbitrary
10:53:17*user0 joined #nim
10:54:17dom96Yardanico: It would be pretty interesting to calculate a stars/watchers ratio for popular projects
10:54:18kinkinkijkinbash relies mostly on system tools, which I really don't like, and is purely interpreted, which I also really don't like
10:55:25krux02kinkinkijkin, well bash is designed as the bridge between the user and the system tools
10:55:30FromGitter<alehander42> I think JS is not so bad, yeah, it has some bad stuff , but with discipline and using a good subset of it, + tools/type systems like typescript it can be perfectly fine
10:55:38kinkinkijkinevery time I write something most people would write a bash script for, like bar configuration and stuff like that, I just write a bin in nim
10:55:47krux02it's intended to glue together system tools, not to writen them
10:55:56FromGitter<alehander42> at least if's flexible enough, compared to e.g. Go, where the language is just too limited for some things
10:56:05kinkinkijkinyeah I get that, but I also don't like bash's syntax
10:56:07kinkinkijkinit's weird
10:56:30PMunchYeah, bash is weird :P
10:56:31Yardanicohttps://github.com/freeCodeCamp/freeCodeCamp almost 300k stars
10:56:39Yardanicois it the most starred project on github?
10:56:55FromGitter<alehander42> actually with preprocessors go could be extended as well, so not sure if that's a good point
10:57:13krux02alehander42 typescript is not javasript. It's just another laguage that compiles to js
10:57:44FromGitter<alehander42> yeaah, but in reality it's basically a dialect of javascript with type checking
10:58:22FromGitter<alehander42> compared to e.g. Nim, Elm etc
10:58:24dom96oooh, http://www.timqian.com/star-history/#nim-lang/nim
10:58:25dom96pretty nice growth
10:59:32FromGitter<alehander42> also, I guess with wasm becoming more mainstream, languages compiling to it will become more mainstream and js will slowly lose it's "monopol"
10:59:53FromGitter<alehander42> in a similar way to how scala/clojure/kotlin keep cutting away from Java's share of the JVM
11:00:12Yardanicoyeah, kotlin has native version which is not dependent on JVM
11:01:13PMunchWhat happened in the beginning of 2015?
11:02:02YardanicoPMunch, maybe this website has incomplete data
11:02:14FromGitter<alehander42> is kotlin native compatible with android? or do they still translate the bytecode AOT
11:02:23euantorLast time I saw any benchmarks of Kotlin Native it was really slow
11:02:31euantorThey may have improved though
11:02:33Yardanicoit seems it is compatible with android
11:02:34Yardanicohttps://kotlinlang.org/docs/reference/native-overview.html
11:02:40Yardanico(Android (arm32 and arm64))
11:03:23dom96PMunch: Slashdot
11:03:45YardanicoAlso, about wahtcing a repo - I think that people may be annoyed by a lot of notifications from such big repos like Nim
11:03:49FromGitter<alehander42> :D wow I dont remember the slashodtting times
11:03:51Yardanicoa lot of PRs/issues/comments
11:04:05Yardanico*watching
11:05:16dom96yep, but that makes watchers super valuable
11:05:28dom96if people are willing to put up with the notifications then they really value the project
11:11:01Yardanicoof course, I read almost all my notifications :P
11:13:55kinkinkijkinI get to have the fun soon of porting all of my system's tools over to ARM, shouldn't be too hard since they're all written in nim and have no ASM or any heckery
11:14:04kinkinkijkinmoving to an ARM dev board as a main computer for a while
11:14:19kinkinkijkinI'll make sure to complain if they don't work as intended
11:33:21FromGitter<ephja> asm is also nice if you generate it :p
11:35:57FromGitter<ephja> most languages are fine if you don't have to use it directly
11:37:12FromGitter<ephja> s/it/them
11:41:56*Arrrr quit (Quit: Arrrr)
11:44:45krux02kinkinkijkin, that sounds like an interesting project to do.
11:45:14krux02Not what I would want to do currently, because time. But it has potential to reduce the electricity bill.
11:55:30*yglukhov_ quit (Remote host closed the connection)
11:55:50kinkinkijkinwell, I'm switching to an ARM SBC for my main pc
11:56:01kinkinkijkinbecause it can be put on a battery and my job is in audio
11:57:37krux02well then there is still the problem of the display to use a lot of battery
11:57:56kinkinkijkinI have a separate monitor
11:58:03kinkinkijkinI only need the computer itself on a battery
11:58:37krux02why would you want to have the main computer on battery, when you have to be wired anyway?
11:59:12kinkinkijkinpower isolation for the usb ports
11:59:32kinkinkijkininterface is a travel interface without external power or I'd just give that a battery and call it a day
12:01:12kinkinkijkinpower isolation tends to be expensive unless you come up with unique ideas because audiophiles drive up the price on everything
12:01:12krux02well do what you think works best for you, but I think it's a weired to put one device on a battery when the entire system has to be powered anyway. I could understand it as a backup solution if the external power supply isn't reliable
12:01:28krux02interesting
12:01:42kinkinkijkinonly the recording interface needs to actually be isolated, but it gets power from the computer
12:01:46kinkinkijkinwhich is isolatable by doing this
12:01:48krux02can you hear the difference?
12:01:50kinkinkijkinyes
12:01:54kinkinkijkinit's actually really loud
12:02:25krux02do you need to be taught about the difference to notice it?
12:02:49kinkinkijkinthe best experience I had was on my laptop on battery, plugged in it would make a very loud buzzing into the interface
12:02:51kinkinkijkinno
12:03:07kinkinkijkinyou have to have a good ear but I noticed it before I learned what it was
12:03:32kinkinkijkinmy laptop is dead now btw
12:03:37kinkinkijkinwhich is why I don't just use that for recording
12:03:47krux02my laptop is almost dead now.
12:04:00kinkinkijkinlaptop was the first time I wrote tools in nim for prettification
12:04:28kinkinkijkinI wrote an extremely simple and fast file sync checker which output a single int to stdout
12:04:49kinkinkijkinwhich I integrated into my lemonbar on the laptop to tell me when I've forgotten to save my schoolwork
12:05:47kinkinkijkinpeople said it was "interesting" and "cool" and now I have no more use for it smh
12:06:21krux02well often people say it is cool and interesting to be nice.
12:06:36kinkinkijkinyeah
12:06:48krux02when you ask them why they don't use it, then they can't even tell you why
12:07:01kinkinkijkinI mean, it feels great to have something unique to your setup that people like, even if they don't want to use it
12:07:03kinkinkijkinis what I mean
12:07:29kinkinkijkinI can't use it anymore because I don't have any more use for it, so it's just kinda
12:07:30kinkinkijkingone
12:07:53krux02what is audio are you actually doing?
12:08:00kinkinkijkinrecording and mixing
12:08:09kinkinkijkincurrently for two large-scale metal projects
12:08:19kinkinkijkin+ freelance
12:08:29krux02so you are the one who uploads all the synth mixtapes up to youtube? :P
12:08:34kinkinkijkinnah
12:09:05*yglukhov[i] joined #nim
12:09:06krux02audio is surely interesting, and with hard realtime constraints
12:09:51krux02I never wrote real audio applications other than "play this sample"
12:10:11kinkinkijkinI write non-realtime audio tools too, like I'm currently in the process of porting a pseudo-mml compiler from C# to nim
12:10:19kinkinkijkinthe original is kind of...
12:10:20kinkinkijkincrap
12:10:24kinkinkijkinboth are of my writing
12:10:33krux02mml?
12:10:36kinkinkijkinI'm pretty much just rewriting it from the ground up
12:10:40kinkinkijkinmusic macro language
12:11:18kinkinkijkinI lost my rewrite of the compiler from a few months ago though
12:11:20user0I am iterating through a file using sourceFile.lines() I need to work with only line 1 and 3 of each 4 lines I process. Does the iterator `lines()` have any proc like `next()` or something like that? I doesn't seem so.
12:11:49kinkinkijkinuse a block
12:12:02kinkinkijkindetect if you're on the correct line and if not, break
12:12:37user0Hmm, thanks
12:13:15FromGitter<gogolxdong> Hi @Varriount , did you implement aws presigned URL authorization? Authorization headers is difficult to debug, for now we have some APIs work ,some don't.
12:15:41*Arrrr joined #nim
12:16:07*nsf quit (Quit: WeeChat 2.1)
12:27:11FromGitter<ephja> a lot of iterators don't have variations that also yield indexes, in which case you might have to declare an index variable before the loop
12:27:47FromGitter<ephja> maybe this could be handled automatically if there was a 'next' and so on for iterators
12:28:58yglukhovgogolxdong: just in case: https://github.com/aidansteele/aws_sdk.nim/tree/master/aws_sdk
12:35:43dom96hrm, can anybody remember the forum thread where Araq agreed to implement a new module import syntax (using `@` IIRC)
12:36:14dom96oh I think I found it https://forum.nim-lang.org/t/3783
12:36:20dom96NimForum's search is pretty sweet
12:38:24*zahary quit (Quit: Leaving.)
12:43:05FromGitter<ephja> we don't have a 'unicode character -> category' mapping, right?
12:46:51FromGitter<ephja> https://github.com/nitely/nim-unicodedb
12:47:38*geocar joined #nim
12:51:19Yardanicoshashlick, if you want nimgen to be NEP-1 compatible - don't use ALL_CAPS for variables, just a suggestion :)
12:52:01Araqephja: we have "for loop macros" that gave us "enumerate"
12:54:26*Arrrr quit (Quit: Arrrr)
12:54:41Araqshould probably be moved to sugar.nim
12:55:33Araqdom96, please note that my proposal does without any new syntax
12:55:55dom96Araq: How does it work then?
12:56:03dom96Also it should be moved to a GitHub issue so we can track it
12:56:03Araqread what I wrote?
12:56:07dom96heh ok
12:56:43Araqcould write an RFC for it but we have plenty of RFCs that are kinda slowly moving already
12:57:41FromGitter<ephja> the macro is just in a documentation code block for now, right? anyway, neat
12:59:52dom96Araq: Yeah, but it'll get lost otherwise
12:59:55dom96I'll create one
12:59:58*zahary joined #nim
13:00:19FromGitter<Varriount> @gogolxdong Presigned Authentication is in-progress, however it's not going to be any different than header Authentication with regards to initial bugs. The best thing you can do to help me is make similar http requests using boto3 with debug logging turned on, add echo statements to the Nim code, and compare the pieces of data at each step.
13:00:20dom96I want to foster a discussion around this anyway, since people are still complaining about it on HN
13:00:25dom96Varriount: Hey!
13:00:27dom96Check your PMs
13:01:35FromGitter<Varriount> I did.
13:02:31dom96Did you see my PM?
13:07:33kinkinkijkinhmm, what's faster, ''if line.startsWith('/'): if line.startsWith("/wav")'' or ''if line.startsWith('/'): if line.continuesWith("wav", 1)'' ?
13:07:53kinkinkijkinI'd think the latter would be faster since less to compare with
13:08:04kinkinkijkinbut maybe the former because it doesn't have to seek into a string first
13:08:23kinkinkijkinboth are equally readable
13:08:25kinkinkijkinimo
13:08:32Araqshould all be pretty much the same, subject to backend optimization
13:08:41dom96if line[0] == '/'
13:08:57AraqstartsWith can be inlined and does the check for '/' in the same way you're doing it manually
13:09:13Araqdom96, that's sadly now if line.len > 0 and line[0] == '/'
13:10:50kinkinkijkinI'm grouping all of the block markers (/env, /wav, /fm, /muX where X is a number) under one statement in the preparser, so it doesn't iterate through all of them if it's not a block marker
13:11:29kinkinkijkinshould result in a hefty speedup in preparsing large files and be more readable
13:11:31kinkinkijkinat the same time!
13:12:11FromGitter<alehander42> do you generate a node tree as a result, or do you directly interpret the result somehow
13:14:28kinkinkijkinit's a bit of a mix, all of the blocks except the /mu blocks (where most of the code is anyways) are dumped into seqs to be reinterpreted later into something useful for compilation, idk what I'm doing with the /mu blocks yet
13:18:24*clyybber joined #nim
13:30:02dom96Araq: :'(
13:33:35shashlickyardanico: yep, need to fix that
13:37:26FromGitter<kaushalmodi> @Yardanico I couldn't help.. sorry.. "ALL_CAPS" is not all caps.. it has an underscore in there :P
13:38:36Araqit's in all caps but it's not 'isUpper'
13:38:41Araq:P
13:40:44FromGitter<alehander42> I love my constants ALL_CAPS :[
13:42:17Araqafter all these years with C/C++/C#/Java I still dislike that convention
13:42:43Araqconstants are usually the thing that should take the least amount of notification
13:42:49shashlickaraq: is it possible to define -d:usePcreHeader within a nim file with a pragma?
13:42:56Araqand here they are SHOUTING AT ME
13:42:59shashlickthen nimpcre can be seamless
13:43:08Araqshashlick, no but I'm thinking about it.
13:43:19shashlickyay
13:43:21Araq{.define: foo.} used to be a pragma
13:43:33Araqbut was deprecated because incremental compilation can't deal with it
13:43:57Araqbut now that IC is more clear to me, maybe it's just another thing we need to "replay" the AST
13:45:30FromGitter<alehander42> I don't know, it's useful to easily spot if something is a constant, and we don't have a lot of choices in pure text
13:45:48shashlickcan someone who is using re/nre test out nimpcre and verify that it works without requiring pcre32.dll anymore?
13:47:53FromGitter<kaushalmodi> @alehander42 +1 ALL_CAPS constants are now ingrained in me (same convention across many languages). .. they simply mean.. constant! Don't modify.
13:48:10dom96ALL_CAPS constants suck
13:48:12krux02 Araq: I got used to this "ALL_CAPS" reading, but I dislike writing it.
13:48:24shashlickwell i've been using it for global vars so i'm in leftfield there
13:48:58krux02it's just easier to write just a single capital case letter
13:49:04krux02than all of them
13:49:21shashlickya but that's for class names
13:49:37subsetparkI like ALL_CAPS because I don't associate ALL_CAPS with modification, I associate it with "you should be vaguely alarmed because it's not obvious where this variable comes from"
13:49:46FromGitter<kaushalmodi> TIL: https://en.m.wikipedia.org/wiki/Out_of_left_field
13:50:04krux02I joined the Scala community when they just got rid of their last ALL_CAPS constants, and I really onjoyed programming in an environment without ALL_CAPS
13:50:10krux02didn.t miss anything
13:50:43FromGitter<alehander42> well NEP1 is useless without a linter/formatter anyway
13:51:06dom96no it isn't
13:51:20FromGitter<alehander42> it is, it's unenforceable and uncheckable
13:51:34dom96That doesn't make it useless
13:51:40dom96Humans can enforce it and check it
13:51:50*yglukhov[i] quit (Ping timeout: 260 seconds)
13:52:02FromGitter<alehander42> and history shows us this is a bad strategy :D
13:52:21Araqhistory also shows us it worked ok for Java, C#, ...
13:52:41FromGitter<alehander42> meh, I doubt their convention %
13:52:47FromGitter<alehander42> is even close to python/ruby/go
13:52:59*yglukhov[i] joined #nim
13:53:47Araqyou mean the Python with 'isupper' that should have been 'is_upper' ?
13:53:56FromGitter<alehander42> NEP1 is great, I just wanted to say that to be taken seriously it requires nim to have a basic linter or nimpretty working one day
13:54:29dom96yes, a linter is needed but certainly doesn't make it "useless"
13:54:37Araqnimpretty wouldn't enforce NEP1 just like "gofmt" doesn't rename freaking identifiers
13:55:03FromGitter<alehander42> yes, but it can simply give a warning
13:55:06AraqI'm tired that all is being mixed up all the time. Name your variable FOOBAR and see what gofmt does with it.
13:55:48FromGitter<alehander42> @dom96 I am not saying useless with bad feelings, I like it, I am just saying if there is not even a tool that checks code for NEP1 , a very low % of the wild nim code will actually follow it well
13:55:50Araqit cannot even rename it to Foobar for you because Foobar might also exist.
13:55:55Araq!!!!
13:55:55FromGitter<alehander42> that's all
13:56:56FromGitter<alehander42> @Araq that's true, so it's a bit blurry if it requires a linter or a formatter, but the semantics aren't so important, let's call it a tool that formats code and for the idents it can warn you/optionally rename stuff if you are optimistic
13:57:26Araqwell if you argue that "look at gofmt, it solves this properly" when it clearly DOES NOT
13:57:32Araqthen the details surely matter.
13:57:42Araqand I don't want to be "blurry".
13:58:27FromGitter<alehander42> no, I argue for "look at ruby, python, go , they have some kind of standard tools that warn for "style" errors and eventually format code and they solve this 90% properly"
13:58:40FromGitter<arnetheduck> look to rust then - the compiler spits out errors for stuff that doesn't comform
13:59:14FromGitter<alehander42> after all a standard that can be only confirmed manually wouldn't go far in programmer's world, we're lazy :D
13:59:23FromGitter<arnetheduck> and I'm with @alehander42 here - a style policy without a tool to help developers is next to useless
13:59:32kinkinkijkinthat sounds gross, should not every project be able to have their own code style and standards?
13:59:55FromGitter<alehander42> that's orthogonal: a style policy can be configurable to some extent
14:00:07kinkinkijkinlooking at rust I mean
14:01:10kinkinkijkinevery time I hear things about rust I like it just that little bit less, though I still like it more than most other C-like languages with similar scopes
14:01:49FromGitter<kaushalmodi> @kinkinkijkin I'm with @alehander42. A policy is a policy. The strict no-tabs and preference to 80 cols is one of the reasons that I like Nim.
14:02:34kinkinkijkinthere's an 80col (soft-)limit?
14:03:04kinkinkijkinI wouldn't know because I limit myself to ~48 anyways
14:03:14kinkinkijkinbut still that sounds a bit bleh if it's enforced
14:03:45FromGitter<alehander42> @dom96 a good example is, one day I decide to make sure all my libs follow NEP1, what should I do? hopefully not sit down and read every line of each file of each of them
14:04:19kinkinkijkinlike my only issue in nim is the weird suggested and enforced style collisions
14:04:48kinkinkijkinlike random little things enforcing off of the suggested style
14:05:00PMunchkinkinkijkin, it's not enforced by the compiler
14:05:01kinkinkijkinit's not a big issue but it gets me sometimes
14:05:25PMunchAnd how do you live with 48 :S Are you writing your code on a phone in portrait mode?
14:05:33FromGitter<alehander42> :D 48 is wild
14:05:42Araqkinkinkijkin, which are actually about *being able* to rename things via tooling as much as *being lax for people who value productivity moreso than cargo culting*
14:05:53kinkinkijkinwait no I do exactly 79
14:06:16kinkinkijkinmiscounted really hard
14:06:37Araqif foo_bar is different from fooBar can you rename foo_bar to fooBar automatically? no you don't. hence the style insensitivity
14:06:40FromGitter<arnetheduck> @kinkinkijkin style is the kind of useless crap that takes away cognitive power from actually solving problems.. a strict autoformatter is a godsend to productivity on all levels: when reading other peoples code (you quickly learn visual patterns), when writing code yourself (you just type randomly and the editor fixes it so you don't have to waste time on it), when reviewing (no arguments about it)... and when it's
14:06:40FromGitter... configurable and a little smart, you can use it to have your local style in your checkout (like git deals with newlines) and have the official repo carry the one true format for everyone elses pleasure
14:07:26kinkinkijkinyah it's not a big issue
14:07:42Araqwhen all the patterns are identical, how can you argue it speeds up the reading process.
14:07:55Araqdon't get me wrong, I actually agree with you on this one.
14:07:59kinkinkijkinit's just like, it's something that's come up in my experience and something that's gotten to a lot of people who jump langs a lot who I talk to
14:07:59PMunchHaha okay. 79 is a bit more usual :P
14:08:06Araqbut I would love to see some true research on this.
14:08:23FromGitter<alehander42> the local style vs normal style is a good idea indeed
14:08:36PMunchI like the style insensitivity, but it's a bit annoying that it breaks a regular text search
14:08:44PMunchWe should create NimGrep
14:09:02Araqare you serious?
14:09:10FromGitter<arnetheduck> @PMunch yeah, and fix every editor out there to use it :)
14:09:29kinkinkijkinthe main thing my friends complain about is mismatching implementation and suggested style stuff in nim, I think that at the least if any style should be occasionally enforced it should be the primary suggested style, but it's not a big issue and it seems like a hard fix
14:09:35kinkinkijkinand not something that needs to be fixed
14:09:58AraqPMunch, https://github.com/nim-lang/Nim/blob/devel/tools/nimgrep.nim it exists since forever, I use it 10x a day
14:10:17kinkinkijkinit just tends to happen with projects of large scope without thousands of people proofreading implementations against a style guide
14:10:24Araqbut not because it has that lovely -y switch but because the other tools are just bonkers anyway
14:11:00FromGitter<alehander42> but the style insensitivity for idents actually makes it easier for a formatter to reformat them
14:11:09FromGitter<alehander42> which was exactly one of your worries o.O
14:11:10Araqarnetheduck: the editors are getting more fuzzy in the search on a daily basis anyway
14:12:00PMunchOh it does exist already :P
14:12:16PMunchBut yeah, I could probably just configure Vim to search style insensitively
14:12:32kinkinkijkinI don't know, maybe I'm not reading into the suggested style right
14:13:18FromGitter<alehander42> sorry
14:13:45kinkinkijkinI don't stick heavily to it but often I run into errors with some procs, then I change them to the suggested style as I understand it and it throws an error, and then I change the styling to be extremely explicit to the point of redundance and it works
14:13:55FromGitter<alehander42> to call it useless, I just meant we(people) can and will diverge from it without a tool (I think it gave the wrong undertone to my problem with it)
14:14:48shashlickokay so CONFIG => gConfig, WILDCARD => gWildcard, etc. that's good for global vars?
14:15:15Araqit's what I used fwiw
14:15:25Araqbut I got rid of the globals :P
14:16:06dom96arnetheduck: alehander42: So I guess the people that spent their time writing NEP-1 wasted their time? Since it's so completely useless?
14:16:17dom96Seriously guys, these style guides come first and they also take time to write
14:16:21dom96They are not useless
14:16:32shashlickya i've moved to one global object for some projects
14:16:47FromGitter<alehander42> @dom96 in my last message I apologized for "useless", I didn't mean anything personally
14:16:52FromGitter<arnetheduck> @dom96 you're overinterpreting what we're saying and you know it
14:17:02kinkinkijkinglobals can be useful sometimes, I sometimes use them too much but they're not inherently slow or anything like a lot of people claim to me, at least as far as I understand how memory works, afaik it's a memory safety thing
14:17:11dom96arnetheduck: No, I'm asking you to use a better word.
14:17:14kinkinkijkinI should shut up about memory tho since I don't understand it very well
14:17:19dom96"Useless" is far too extreme, and you know it
14:17:21*Electrux quit (Ping timeout: 240 seconds)
14:17:42kinkinkijkinyes, he does know it, which is why he apologized for it
14:18:04dom96sure, alehander42 did
14:18:11dom96but then arnetheduck said he agreed that it's useless
14:18:12FromGitter<alehander42> @dom96 well I used it
14:18:19kinkinkijkinI don't know a better word for that situation personally
14:18:21FromGitter<alehander42> well, ok, our point is
14:18:30FromGitter<alehander42> we need a tool to make it really useful
14:18:42dom96There is no word. The document itself is sound.
14:18:48FromGitter<alehander42> it's not useless now, but it's just not as useful as it could be
14:18:57dom96Point to the fact that we have no tool to enforce it instead of complaining that the document is "useless"
14:20:24PMunchI like the style guide :)
14:20:33FromGitter<Varriount> :D
14:20:44FromGitter<alehander42> anyway, nobody else needs to apologize, I like to sometimes spur discussion by throwing words around and I have to improve in that
14:20:49PMunchBut I agree that a formatter would be really nice. And maybe some guidelines on where to break 80+ char lines.
14:21:36FromGitter<alehander42> yeah, the document is sound
14:21:49FromGitter<alehander42> I am not sure what is the plan for nimpretty anyway, @Araq ?
14:22:00FromGitter<alehander42> was it an improved renderer.nim ?
14:22:05*PMunch quit (Quit: Leaving)
14:23:07Araqyeah, but after this dicussion
14:23:16FromGitter<alehander42> I wanted to write a linter a while ago, https://forum.nim-lang.org/t/3730 , but I didn't get much feedback back then
14:23:17AraqI might add a --nep1 switch to the compiler
14:23:41Araqthat would be the "linter" aspect that just warns about wrong identifiers in a declaration context
14:23:43dom96FWIW nobody needed to apologise. Just acknowledge that it's not the right word to use.
14:23:58Araqas nimpretty should purely be about code formatting and not renamings IMO
14:24:00dom96Araq: nimpretty should default to NEP1
14:24:18Araqthese are separate things.
14:24:21dom96as in, all formatting should NEP-1 compatible
14:24:30Araqand are easier to tackle when kept separate.
14:24:32dom96If you add a --nep1 flag then it implies that is not the case
14:24:47Araq--nep1 is a compiler switch
14:24:52Araqnimpretty is a formatting tool
14:25:31Araqit's what I got out of this dicussion (thanks!) and I like it.
14:26:08shashlicknimpretty should warn about non-conformance and fix only whitespace issues - that would make it a linter and formatter
14:26:31FromGitter<alehander42> but still can't we have optional ident re-styling in one of those tools?
14:26:55FromGitter<alehander42> nim's insensitivity means that we can't have a clash so easily anyway
14:27:03Araqyeah but it's kinda hard and would delay the development further
14:27:19FromGitter<alehander42> and if that's so risky we can even list all the locations and wait for confirmation
14:28:01Araqwell be my guest
14:28:12dom96if it requires --nep1 switch then you may as well make it error
14:28:23AraqI know I can give you a --nep1 switch in an afternood as I wrote the code once
14:28:41dom96so what will it check? identifiers?
14:28:49dom96and error on snake_case?
14:28:52AraqI know 'nimpretty' also changing identifiers will delay nimpretty even further
14:29:10FromGitter<alehander42> well, if I look at my linter architecture, I'd just rename recursively variables modifiying the syntax tree and re-render it
14:29:19FromGitter<alehander42> but not sure how easy that would be in the compiler
14:29:19Araqdom96, it only *checks*, yes and is only concerned about identifier spellings
14:30:19dom96sure
14:30:40Araqalehander42: The problem is that nimpretty only works on an AST that is not sem'checked and so doesn't know if X refers to foo.X or bar.X
14:30:42dom96nimpretty should have a mode where it only checks
14:30:55Araqthat's not nimpretty's business at all, it's a formatter.
14:31:01dom96also, I have doubts about nimpretty's effectiveness if it works on the AST
14:31:23AraqI checked gofmt's implementation and it works on the AST too.
14:31:35Araqso your doubts are rather unfounded, I think.
14:31:54dom96Okay, good :)
14:32:08dom96but yeah, a check mode is necessary for CI
14:32:14Araqthough it might be the case that working just with the lexer might be easier
14:32:19dom96although I guess you could always run nimpretty and then do a diff
14:32:56dom96the reason I have doubts about using AST is because it will get rid of a lot of info
14:33:02dom96how do you handle extraneous whitespace
14:33:07dom96or comments?
14:33:19AraqI covered that in my life coding.
14:33:28Araqcomments are hard, extranous whitespace already implemented.
14:33:34kinkinkijkinhmm, does algorithm provide a proc to sort a seq of tuples based on a particular value of the tuple, then output a ref seq (or sort in place)?
14:33:41*yglukhov_ joined #nim
14:34:07dom96including the location in the original file for each AST node might be good
14:34:19Araqwe could also be more wild and write a parser generator that can produce a parser for Nim, so we get a alternative parser implementation and then we use this to format the code without an AST step
14:34:20dom96it's what the clang AST does
14:34:35Araqwe do that too for all I can tell.
14:34:39dom96and libclang exposes it so it's likely very important for these tools
14:34:39*Vladar quit (Quit: Leaving)
14:34:51dom96why are comments hard?
14:35:03Araqbecause they are not properly kept in the AST anymore
14:35:06*miran joined #nim
14:35:13dom96can't you just hack in a mode that keeps them in the AST? :)
14:35:51Araqthat's what I did but a day only has 24 hours
14:36:02dom96cool
14:36:16FromGitter<arnetheduck> I think the main reason not to use ast is because a code formatter is better if it can deal with slightly invalid code
14:36:25*yglukhov[i] quit (Ping timeout: 265 seconds)
14:36:54dom96True, but now that I think about it that could lead to strange formatting issues
14:37:01FromGitter<arnetheduck> ie you type some stuff and want it formatted to have a better look, without wanting to deal with all the pesky details
14:37:12Araqarnetheduck: it's unclear to me what the best solution is.
14:37:29AraqI would need to try both approaches in order to decide.
14:37:30*Vladar joined #nim
14:39:56FromGitter<arnetheduck> well, I'm handing you a use case that an ast-based one will struggle with, usually.. unless you introduce approximate nodes in the ast, which actually makes sense, kind of (for better error messages)
14:41:43FromGitter<arnetheduck> and fyi, clang has two tools as well - clang-format strictly for formatting (non-ast) and clang-analyzer for refactoring (ast) - the latter can do lots of nice things like upgrade from deprecated api etc etc.. really cool
14:43:15Araqok, so we might as well settle this. let's assume --nep1 works and is the default
14:43:32yglukhovAraq: pls have a look https://github.com/nim-lang/Nim/pull/8009
14:43:46Araqwe need a pragma to make the compiler shut up for names that violate nep1
14:43:53Araqlike 'int'
14:44:24Araqwhat should it be? .freeStyle ?
14:44:43Araqtype int {.freeStyle, magic.}
14:44:59Araqtemplate I_ENJOY_C {.freeStyle.} ?
14:45:53*Electrux joined #nim
14:46:09*cspar quit (Ping timeout: 268 seconds)
14:46:10FromGitter<arnetheduck> `#![allow(non_snake_case)]` is what rust does - ie allow the rules to suppress be specified - this is more future proof I think, given that you could allow other things as well that are not fully style related
14:47:08*cspar joined #nim
14:47:10shashlicknote that c2nim then needs to conform as well in the code it generates
14:47:27FromGitter<arnetheduck> a difference there is that the style rules are much more tightly bound to the language (they might even be part of the language spec, not just a recommended guide, but I'm not 100% on that)
14:47:29Araqc2nim has the --nep1 switch already
14:47:43shashlickhmm, I need to start using that in nimgen
14:48:16Araqarntheduck: seems overkill. all you need to be able to say is "I know better, thanks"
14:49:12Araqmuch like 'cast' is good enough and we don't need @trusted vs @system vs @safe
14:50:53Araqand we can always introduce 'style: Snake_Case_WITH_UPPERS' later
14:53:48sendell[m]@dom96 is there a way to install 64bit nim using choosenim on windows? default looks to be 32bit :/
14:54:31Yardanicosendell[m], you can install mingw-w64 manually and download a zip archive from official nim website (0.18.0), or latest devel version (if you want it)
14:54:44FromGitter<arnetheduck> @Araq, yeah, but what I'm saying is that it might pertain to things other than style.. ie rust warns about missing docs and other lint-like things, and you can write plugins for the compiler to warn about codebase-specific stuff as well
14:56:10FromGitter<arnetheduck> reminds me of cppstyle.py from google, that uses a `NOLINT` comment to disable checks
14:56:55sendell[m]yeah I know about installing it by hand but since I use choosenim on all platforms I'd like to stick with it :)
14:57:44FromGitter<arnetheduck> oh, and @alehander42 , once you have an autoformatter, it's actually very easy to enforce formatting as well - the formatter, instead of autoformatting can spit out a `patch`, and if it's empty, the file passes, if it's not, you get all the violations pointed out to you
14:58:17*yglukhov_ quit (Remote host closed the connection)
14:59:38*guest_ joined #nim
14:59:52*guest_ quit (Client Quit)
15:00:03FromGitter<arnetheduck> the linter-as-compiler-plugin thing is actually pretty nice - I can imagine us using it at status at some point, to disable some adventurous nim features or constructs locally in specific parts of the code
15:03:52Araqomg, I can't merge my branch. too many people fixing the compiler :P
15:04:00Araqand I keep getting new merge conflicts
15:04:55*nsf joined #nim
15:05:31dom96sendell[m]: Afraid not
15:06:08shashlicksendell[m] it is possible with my branch, still to be integrated
15:07:06shashlicksendell[m]: https://github.com/dom96/choosenim/pull/63
15:09:32shashlickis it possible to convert an object into a table?
15:10:44Araqsystem.fieldPairs iterator
15:11:09Araqso yeah, it takes an explicit loop but it's not much code
15:11:55dom96import json; (%obj).fields # Hacky but might work :P
15:12:30dom96So yay. My university results are out. I guess it's time to make my C/C++ Obfuscator public
15:12:30Araqargh, more merge conflicts
15:12:40sendell[m]@shashlick nice ! hope it gets integrated soon :)
15:12:50Araqpeople will never get the compiler-as-an-API
15:16:36*Electrux quit (Read error: Connection reset by peer)
15:17:40*Electrux joined #nim
15:18:49*xkapastel joined #nim
15:26:26shashlickaraq: fieldPairs is super neat
15:27:22*Electrux quit (Read error: Connection reset by peer)
15:27:25FromGitter<arnetheduck> @Araq, what about language-as-a-library?
15:28:05*Electrux joined #nim
15:28:27Araqhttps://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim just landed in devel
15:29:30Araqit's significantly cleaner than before though better marshalling from native Nim data to Nim ASTs could be added
15:32:10FromGitter<andreaferretti> @Araq cool!
15:32:22FromGitter<arnetheduck> oh, nice! does that mean all those ugly globals are gone?
15:32:22FromGitter<andreaferretti> But it seems more of an interpreter api!
15:32:42Araqarnetheduck: yep. except for a cache in ropes.nim that I still need to disable
15:33:16Araqok, well, yes, the use case is "don't want to use stinkin' Lua in my game engine"
15:34:57FromGitter<gogolxdong> @yglukhov thanks, is this your library ? wrapped nice.
15:35:15shashlickyay for test cases
15:37:25*elrood joined #nim
15:37:42FromGitter<gogolxdong> syntax feels like want to imitate boto3 python SDK, made it works with packedjson.
15:37:47shashlicknim makes refactoring super easy - no worries that i broke some code path with bad copy/paste stuff, like you can in Python
15:38:16shashlickcompiled languages ftw
15:38:29FromGitter<gogolxdong> plus the xmlnode to jsonnode transform ,it's complete.
15:38:38*Electrux quit (Read error: Connection reset by peer)
15:39:34FromGitter<turbolent> @Araq compiling the compiler directly (without koch) sped up iteration a lot, thank you for the suggestion. however, no matter what GC and other options I tried, the original error was thrown every time -- but once I commented out the `setControlCHook` forward declaration in `lib/system.nim:3216` I had a working compiler! Really nice to finally have Nim working, but I still wonder why the implementation in
15:39:34FromGitter... `lib/system/excpt.nim` isn't found and used 🤔
15:39:39*Electrux joined #nim
15:40:22AraqI wonder too.
15:41:38Araqdo you use --os:standalone ?
15:45:16FromGitter<turbolent> no, `os:macosx`
15:45:22kinkinkijkinI'm wondering, should I skip the line cache categorization step in my compiler and just build the render trees directly in the parsing loop or continue how I've already started (cache file, re-cache lines with categorization, sort categorized lines by channel with a sort of insertion sort, rebuild code lines as loop tree and instrument lines as instrument objects, render)
15:46:44kinkinkijkinI actually would probably be better to ask these questions to demoscene people, since mml compilers aren't normal compilers
15:49:02shashlickaraq: c2nim generates broken code with --nep1
15:49:19shashlicktype ICompressProgress* = iCompressProgress
15:49:44shashlickError: redefinition of 'ICompressProgress'
15:50:18Araqwell c2nim is never quite sure about the nature of any identifier
15:50:26*zahary quit (Quit: Leaving.)
15:50:30YardanicoAraq, is incremental compilation ready to be used (at least tested)?
15:50:33Araqnot sure how to solve that
15:51:02AraqYardanico, no, I'm taking a little break from it and fix some high priority bugs instead
15:51:56YardanicoAraq, that's ok! you're always doing a great job :)
15:52:28*Electrux quit (Read error: Connection reset by peer)
15:53:09*Electrux joined #nim
15:53:20*MyMind joined #nim
15:55:32*Sembei quit (Ping timeout: 276 seconds)
15:59:07shashlickwell, moving to --nep1 in nimgen will break every consumer of existing wrappers
15:59:20shashlicksince it renames everything
16:03:47*Electrux quit (Read error: Connection reset by peer)
16:04:39*Electrux joined #nim
16:07:46*Snircle joined #nim
16:08:11kinkinkijkinbut really, should I skip cache sorting or would that turn out really bad? I'm thinking of ways that cache sorting could be faster and easier to read than unsorted caching straight into compiler but cache sorting would let me make some assumptions which might reduce readability, and cache nonsorting would force me to write extra code to pseudo-sort the cache in read time which might make the process suck
16:20:22*nsf quit (Quit: WeeChat 2.1)
16:22:04*clyybber2 joined #nim
16:22:08*clyybber2 quit (Client Quit)
16:24:10*clyybber quit (Ping timeout: 256 seconds)
16:32:48*Trustable joined #nim
16:34:07*Electrux quit (Read error: Connection reset by peer)
16:35:01*Electrux joined #nim
16:42:27*miran quit (Ping timeout: 240 seconds)
16:45:15*Vladar quit (Quit: Leaving)
16:51:20*Vladar joined #nim
17:02:05*Arrrr joined #nim
17:02:38ArrrrIs incremental compilation ready for testing?
17:06:15Araqno. ask again in 4 days please.
17:09:58kinkinkijkinwhat is incremental compilation?
17:10:03Yardanicokinkinkijkin, ugh
17:10:14kinkinkijkin????
17:10:27Yardanicobasically you don't need to recompile modules which were not changed between two compiler runs
17:10:40kinkinkijkinah
17:13:03dom96Please don't 'ugh' at valid questions
17:13:11Yardanicodom96, I answered
17:13:33Yardanicobut that's not really a Nim question and it can be easily searched in the internet :)
17:13:55dom96So say that, politely
17:14:21*captainbland joined #nim
17:14:46Araqthe only ugh-worthy question is "where is parseJson declared? I cannot find anything" :P
17:16:32*captainbland_ joined #nim
17:17:44*captainbland_ quit (Remote host closed the connection)
17:18:01*captainbland_ joined #nim
17:18:17*riidom joined #nim
17:19:27*captainbland quit (Ping timeout: 256 seconds)
17:23:14*captainbland_ quit (Remote host closed the connection)
17:23:34*captainbland_ joined #nim
17:24:20dom96People wanting to further their knowledge shouldn't ever be "ugh"-worthy :)
17:25:29kinkinkijkineugh, I'm trying to figure out how to sort this cache
17:25:45kinkinkijkinall the entries are marked by channel number but I have to keep insertion order too
17:26:10kinkinkijkinso it goes all of one channel in insertion order, then onto the next channel
17:26:22kinkinkijkin(channels not being the modern programming concept, the older audio concept)
17:31:27Araqkinkinkijkin, I can only give you some "common wisdom"
17:31:36Araqkeep it simple, leave out cache sorting
17:31:45Araqwhatever that means.
17:32:26kinkinkijkinwell, because of how the renderer works, I have to either sort the cache or include a jumplist in the cache
17:32:36kinkinkijkinso the renderer can get to lines of one channel at a time
17:37:17kinkinkijkinor an alternative, which would be incredibly simple but also incredibly slow
17:37:33kinkinkijkinsearch the cache during render time
17:42:44*NoIdea joined #nim
17:47:17*Vladar quit (Quit: Leaving)
17:55:18*thomasross quit (Remote host closed the connection)
18:01:54*Vladar joined #nim
18:03:41*Arrrr quit (Quit: Arrrr)
18:10:46*Jesin joined #nim
18:17:30kinkinkijkinthis seems like a dumb question, I'm working with generics and want to return a seq of generics which may have different types, based on an input string, is this possible?
18:18:48Araqno, if you don't want to think about it, make it return JSON
18:19:27kinkinkijkinbut I don't want to do anything through a bridge of sorts
18:20:51kinkinkijkinI can't figure out how to do this even with json though, if my idea doesn't work
18:26:00*captainbland_ quit (Ping timeout: 265 seconds)
18:31:17*krux02 quit (Remote host closed the connection)
18:32:57FromDiscord<Generic> how about using object variants?
18:32:58FromDiscord<Generic> https://nim-lang.org/docs/manual.html#types-object-variants
18:36:46*jjido joined #nim
18:38:35*nsf joined #nim
18:38:43kinkinkijkininteresting
18:38:52kinkinkijkinI will look at this closely when I get back to code later
18:45:33*krux02 joined #nim
18:49:32m712i wonder why other languages don't have the f(type) -> type.f syntax sugar
18:49:42m712it seems pretty nice to me
18:49:56Yardanicosome of the do
18:50:00m712at least i haven't seen any that do
18:50:01Yardanico*of them
18:51:47m712if i were to design my own programming language (i am going to, as a pet project thing), i'd definitely add it
18:56:19*Trustable quit (Remote host closed the connection)
18:56:45ldleworkI mean, it has some consequences
19:05:09*NoIdea quit (Quit: Page closed)
19:08:45krux02m712, other languages do in fact have it to a certain extend
19:09:10krux02there is a proposal for c++ by Bjarne Stroustrup to add it to that language
19:09:26krux02and I think in haskell there it is a library feature
19:10:07krux02haskell has the dot operator that takes a value and a function with that value as a first argument and does stuff with it
19:13:10m712oh i'd love to see it in c++
19:13:30m712krux02: interesting one with haskell
19:26:10m712now i just gotta re-learn nim
19:33:11YardanicoAraq, by the way, new destructors don't need refcounting, right?
19:34:24*yglukhov[i] joined #nim
19:35:20*xet7 joined #nim
19:35:29*yglukhov[i] quit (Remote host closed the connection)
19:35:50*yglukhov[i] joined #nim
19:38:24*sz0 joined #nim
19:46:02yglukhovgogolxdong: it's not mine. i just added some bits to it
19:47:32Yardanicodom96, by the way, why there's no link to play.nim-lang.org on nim-lang.org ?
19:48:11dom96Yardanico: PRs welcome
19:48:26dom96Although I'm still waiting on zacharycarter to make it more reliable
20:03:10*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
20:06:13*captainbland joined #nim
20:12:53AraqYardanico, they enable refcounting but are far more general
20:13:09*Vladar quit (Quit: Leaving)
20:22:14*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
20:22:58*captainbland quit (Ping timeout: 265 seconds)
20:23:26*Electrux quit (Ping timeout: 276 seconds)
20:23:26*yglukhov[i] quit (Read error: Connection reset by peer)
20:36:42*captainbland joined #nim
20:37:34*Jesin quit (Quit: Leaving)
20:44:02*yglukhov[i] joined #nim
20:48:47*yglukhov[i] quit (Ping timeout: 276 seconds)
20:48:56*nsf quit (Quit: WeeChat 2.1)
21:00:09*Electrux joined #nim
21:04:47*Electrux quit (Ping timeout: 268 seconds)
21:14:41FromDiscord<2vg> rank 4 / 39 !!! :3
21:14:41FromDiscord<2vg> https://github.com/tbrand/which_is_the_fastest/blob/master/README.md#ranking-framework
21:14:52Yardanico@2vg good job!!!
21:15:26Araq2vg: tell me you're using packedjson ;-)
21:15:26Yardanico(who didn't know: authors of this benchmark added nim without "-d:release" flag, and it actually outperformed some other frameworks)
21:15:51Yardanicoand with -d:release it's of course much faster
21:16:01AraqYardanico, that's good because realistically it should use the -d:safeRelease switch that I'm working on
21:16:35YardanicoAraq, oh, and what's the difference with -d:safeRelease?
21:16:37Araqwhich will be release optimization with range and bounds checks enabled. and maybe overflow checks too
21:16:41Yardanicoah, ok
21:16:54Yardanicoand what it will be used for?
21:17:00Araqfor servers.
21:17:18AraqI no of no production server which uses -d:release
21:17:32Araqthey all value safety more than speed :-)
21:18:07Yardanicodid you do any benchmarks on how this can affect nim apps? just curious
21:18:12Araqbut no optimization whatsoever is overkill, so we should have a sane default
21:19:02AraqI don't have benchmarks but for Ada it was 20-30% slower with all runtime checks enabled
21:19:24AraqCPUs got faster at removing this overhead so 10% seems realistic
21:19:57Araqthat would be with overflow checking left on.
21:20:27Araqbut it's just an educated speculation :-)
21:20:31*yglukhov[i] joined #nim
21:25:05*yglukhov[i] quit (Ping timeout: 260 seconds)
21:28:12FromDiscord<2vg> @Araq The benchmark here measures only pure routing overhead!
21:28:12FromDiscord<2vg> The current mofuw routing macro is a little inefficient and will be rewritten!!
21:29:16Araqok, ensure we win these json benchmarks too :P
21:29:21Araqnice job!
21:30:53*captainbland quit (Remote host closed the connection)
21:30:57*zahary joined #nim
21:31:15*captainbland joined #nim
21:34:17FromGitter<Varriount> gokr: A friend of mine says that "smalltalk is the wierdest, quirkiest, old programming language". :D
21:36:55*captainbland quit (Ping timeout: 265 seconds)
21:38:01*zahary quit (Quit: Leaving.)
21:38:42*smt quit (Read error: Connection reset by peer)
21:38:57*smt joined #nim
21:57:08*thomasross joined #nim
21:58:39*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:09:12*Electrux joined #nim
22:13:40*Electrux quit (Ping timeout: 256 seconds)
22:16:05federico3"What Killed Smalltalk Could Kill Ruby" https://youtu.be/YX3iRjKj7C0?t=332
22:17:20*geocar quit (Quit: Connection closed for inactivity)
22:18:10Araqoh no not this guy again
22:18:31Araq"Clean Code" is easily the worst book I've ever read on programming
22:18:49Araqpseudo science.
22:19:25FromDiscord<treeform> Araq, what are you thoughts on arbitrary evaluations of params, i got bit doing foo(read(), read(), read())... turns out reads came in an random order, because c and c++ are allowed to do this. Do you think its a bad idea respect operand order? Was this a big decision to not respect it? Or you just did it because c/c++ does it?
22:20:11FromDiscord<treeform> With arbitrary evaluations c/c++ are free to optimize stuff more though.
22:20:48FromDiscord<treeform> Is it a logical vs speed trade off or some thing else?
22:21:56FromDiscord<treeform> Funny enough only MS VC++ complier does it for me, all other compilers work like you expect (although they don't have to).
22:22:06Araqactually the order of evaluation is left to right
22:22:30FromDiscord<treeform> Can I file it as a bug then?
22:22:38Araqbut I don't know if that holds for assignments, eval(b) before eval(a) in 'a = b' makes more sense IMO
22:22:47*Araq left #nim ("Leaving")
22:22:51FromDiscord<treeform> no only function calls
22:23:10*Araq joined #nim
22:23:37FromDiscord<treeform> In c/c++ "The order of evaluation of arguments is unspecified."
22:23:38*tyrion[m] joined #nim
22:23:54FromDiscord<treeform> The code that nim generates is foo(read(), read(), read())
22:23:59FromDiscord<treeform> but it needs to generate
22:24:08Araqbug report is tough, when generating C++ code introducing more temporaries than necessary is problematic given C++'s semantics
22:24:16FromDiscord<treeform> ```
22:24:16FromDiscord<treeform> a = read(); b = read(), c = read()
22:24:17FromDiscord<treeform> foo(a,b,c)
22:24:17FromDiscord<treeform> ```
22:24:33Araqbut without temporaries there is no way to enforce the order
22:24:41FromDiscord<treeform> yeah exaclty
22:24:55Araqtough nut :P
22:24:55FromDiscord<treeform> I guess right now the "unspecified" is a feature.
22:25:02Araqyeah...
22:25:03FromDiscord<treeform> It supposed to make code faster.
22:25:23FromDiscord<treeform> but LLVM and GCC don't do it, only VC++ in cpp mode.
22:25:34FromDiscord<treeform> but they could at any moment
22:25:41Araqwell not only faster, if the type has a private assignment we cannot use temporaries though with move semantics this should be much better than before
22:26:07Araqif you want to optimize, write an optimizer.
22:26:30AraqI don't think this should be left underspecified for optimization reasons
22:27:00*sz0 quit (Quit: Connection closed for inactivity)
22:27:10Araqand if you want to know how to write such an optimizer, buy my book :P
22:27:31FromDiscord<treeform> I just want to not be surprised...
22:27:49FromDiscord<treeform> or spend time debugging the C++ spec 😃
22:30:11FromGitter<kayabaNerve> @Varriount old? Isn't in still alive, alb
22:30:18FromGitter<kayabaNerve> *albeit in a new name
22:32:29FromGitter<kayabaNerve> https://squeak.org
22:32:31FromGitter<kayabaNerve> Bam
22:32:43FromGitter<kayabaNerve> That said, it can be alive and old
22:33:42*xet7 quit (Remote host closed the connection)
23:23:47*BitPuffin quit (Remote host closed the connection)
23:36:07*thomasross quit (Read error: Connection reset by peer)
23:36:30*thomasross joined #nim
23:39:15*Electrux joined #nim
23:39:32*elrood quit (Quit: Leaving)
23:40:17*thomasross quit (Remote host closed the connection)
23:40:46*thomasross joined #nim
23:43:05*NimBot joined #nim
23:43:27*user0 quit (Quit: user0)
23:43:54*Electrux quit (Ping timeout: 256 seconds)
23:48:57*riidom quit (Ping timeout: 264 seconds)
23:49:55*riidom joined #nim