<< 08-03-2018 >>

00:00:04FromGitter<ZarsBranchkin> Oops yeah, nim-mode
00:01:17FromGitter<ZarsBranchkin> https://i.imgur.com/sqUF8Bq.png
00:01:30FromGitter<krux02> yes I just tested it
00:01:35*elrood quit (Quit: Leaving)
00:01:35FromGitter<krux02> yes that keyword is missing
00:01:37Temperance[m]how do I define a function pointer with void return?
00:01:51FromGitter<krux02> I found out I can actually use func to define functions
00:02:12FromGitter<krux02> either I never tried it or last time I did it didn't work
00:02:29FromGitter<ZarsBranchkin> I remember seeing it somewhere it in docs, apparently deprecated
00:02:32FromGitter<krux02> it's just emacs that has problems highlighting and indenting the line when I use func
00:02:49FromGitter<krux02> yea min should release a few keywords
00:03:47FromGitter<ZarsBranchkin> Oooh, it seems like some keyword for future use https://nim-lang.org/docs/manual.html#pragmas-nosideeffect-pragma
00:05:31Temperance[m]I think I understand, nim uses 2 spaces for indentation, doesn't it?
00:06:59FromGitter<ZarsBranchkin> I think that's the official convention, but should work with different amount of spaces too. Haven't tested myself
00:09:08Temperance[m]does it work with tabulations?
00:09:53Temperance[m]NICE
00:10:11Temperance[m]took an example with glfw and nuklear
00:10:15Temperance[m]and managed to wrap some initialization code inside a proc and expose it with*
00:10:15Temperance[m]I'm liking this stuff a lot.
00:10:23FromGitter<ZarsBranchkin> No, tabs aren't allowed, only spaces
00:10:34FromGitter<ZarsBranchkin> Yeah, I find it real fun interfacing with C functions
00:11:02Temperance[m]I'm having many problems understanding why this kind of mechanisms aren't there for plain C
00:11:34Temperance[m]>No, tabs aren't allowed, only spaces
00:11:48Temperance[m]is this something that can be configured?
00:11:55Temperance[m]or is it kinda, enforced
00:12:35FromGitter<ZarsBranchkin> I think it's enforced
00:12:39FromGitter<ZarsBranchkin> Yeah, here https://nim-lang.org/docs/nep1.html#introduction-spacing-and-whitespace-conventions
00:19:23*MJCaley joined #nim
00:25:28*dddddd joined #nim
00:32:59*xet7 quit (Quit: Leaving)
00:38:58*xet7 joined #nim
00:45:27Temperance[m]I'm having a little bit of a problem understanding what's happening here
00:45:28Temperance[m]type fptr = (proc(x: int):int)
00:47:22Temperance[m]does this declare a type called "fptr" that is a proc that receives a parameter x which is an int, and should return an int?
00:47:22Temperance[m]am I getting this correctly?
00:47:52FromGitter<ZarsBranchkin> Yeah, something like that. Here is more information on that https://nim-lang.org/docs/manual.html#types-procedural-type
00:49:59*geocar joined #nim
00:56:37*rbrt quit (Quit: Oíche mhaith)
00:58:08*rbrt joined #nim
00:58:38*rbrt quit (Client Quit)
01:00:42*vlad1777d joined #nim
01:05:01Temperance[m]well, insofar I'm kinda liking nim a lot
01:06:35Temperance[m]The fact I was able to import some package and have a window opened by glfw in one day seems like a whole success for a day
01:45:46*rockcavera quit (Remote host closed the connection)
01:47:19*rockcavera joined #nim
01:48:22*zarthur joined #nim
01:49:36*rockcavera quit (Remote host closed the connection)
01:51:44*arthurz quit (Ping timeout: 255 seconds)
01:56:51*rockcavera joined #nim
02:07:34*S1t1Schu joined #nim
02:11:05*S1tiSchu quit (Ping timeout: 240 seconds)
02:12:42*rockcavera quit (Ping timeout: 245 seconds)
02:19:33*rockcavera joined #nim
02:48:06*MJCaley quit (Quit: MJCaley)
02:59:31*geocar quit (Quit: Connection closed for inactivity)
03:18:45*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:35:50FromGitter<zacharycarter> is there a way to create multiple modules for the VM in memory?
03:36:14FromGitter<zacharycarter> or should I just register everything in the globalCtx?
03:36:29FromGitter<zacharycarter> I was hoping I could make several modules and compose them into a modulegraph and use that when compiling my nimscript
03:36:43FromGitter<zacharycarter> but I'm not seeing how to do that clearly - I've created several modules, but don't see a way to make them depend on one another
03:46:50*SenasOzys quit (Ping timeout: 268 seconds)
04:09:07*triple_a joined #nim
04:10:17*triple_a left #nim (#nim)
04:19:13FromGitter<krux02> to be honest i dont know what you mean with modules in memory.
04:40:10*dbatbold joined #nim
05:03:38*yglukhov joined #nim
05:14:04*yglukhov quit (Remote host closed the connection)
05:27:55*sz0 joined #nim
05:35:02*yglukhov joined #nim
05:36:42*nsf joined #nim
05:39:13*yglukhov quit (Ping timeout: 240 seconds)
05:55:39*yglukhov joined #nim
06:00:27*yglukhov quit (Ping timeout: 265 seconds)
06:02:59*smt` joined #nim
06:06:43*smt quit (Ping timeout: 252 seconds)
06:29:14*craigger quit (Quit: bye)
06:31:08*craigger joined #nim
06:36:54*yglukhov joined #nim
06:41:30*yglukhov quit (Ping timeout: 256 seconds)
06:58:27*yglukhov joined #nim
07:18:28*Yardanico joined #nim
07:23:43*nohusuro joined #nim
07:27:02*dddddd quit (Remote host closed the connection)
07:33:57*zama quit (Ping timeout: 245 seconds)
07:37:03*couven92 joined #nim
07:40:34*zama joined #nim
07:46:26*rokups joined #nim
07:49:39*yglukhov quit (Remote host closed the connection)
07:51:57*yglukhov joined #nim
08:01:27*yglukhov quit (Remote host closed the connection)
08:06:57*sz0 quit (Quit: Connection closed for inactivity)
08:07:52FromGitter<narimiran> wait what? nim has REPL?! (cc @krux02)
08:10:08*yglukhov joined #nim
08:15:11*yglukhov quit (Remote host closed the connection)
08:18:42*yglukhov joined #nim
08:20:05FromGitter<andreaferretti> yes, just one that does not really work well with the C FFI
08:20:18FromGitter<andreaferretti> hence with a not small part of the stdlib
08:20:26FromGitter<andreaferretti> so it's hidden by default
08:26:34*PMunch joined #nim
08:36:46*sendell joined #nim
08:36:50*dbatbold quit (Ping timeout: 260 seconds)
08:49:08FromGitter<jaco60> Hi, i need to reverse a string. Is there already a `reverse` or `reversed` proc for strings in the std library (i’ve no found…) or conversions methods from string to seq allowing to use the ones from `algorithm`), or should i write my own proc (not a big deal, though) ?
08:49:43*Arrrr joined #nim
08:52:27PMunchjaco60, https://rosettacode.org/wiki/Reverse_a_string#Nim
08:52:50FromGitter<jaco60> Arf
08:53:26PMunchSeeing the complexity of the unicode variants I really feel like this should be put into a library. Possibly strutils
08:55:46*floppydh joined #nim
08:58:15FromGitter<jaco60> +1
08:58:52euantoryou mean like `unicode.reversed`? https://nim-lang.org/docs/unicode.html#reversed,string
08:58:54euantor;)
08:59:37PMunchHaha, yeah I guess like that
09:00:12FromGitter<jaco60> Arf (bis repetita)
09:00:18euantorIt is quite well hidden, and it doesn't seem like there's a version that doesn't handle UTF8
09:01:07PMunchMaybe rosettacode should be updated to just show this instead?
09:01:33PMuncheuantor, well UTF-8 first is generally a good approach
09:01:55PMunchIf you put another reverse in strutils everyone would just use that and mess up with unicode stuff
09:02:16euantortrue. It would definitely make sense to update rosettacode. Do they accept contributions like that - I've never looked
09:02:26PMunchI think so
09:02:54PMunchAnd besides, writing a proper ASCII string reverser is a lot easier than writing a UTF-8 one
09:03:14PMunchSo if you need for for just ASCII, then it's not too hard to write it
09:04:17euantor`algorithms.reversed` also works: https://nim-lang.org/docs/algorithm.html#reversed,openArray[T]
09:04:35euantorTHough you get a `seq[char]` out of it
09:05:04FromGitter<jaco60> I have an account on Rosetta, i may add the unicode.reversed solution
09:05:23euantorawesome, that would be helpful :)
09:06:36PMunchMaybe we should go through some of these as well: http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_Nim
09:06:47PMunchMight be a good idea for a live-stream :)
09:07:17FromGitter<jaco60> i don’t understand why the existing solution import unicode and rewrite reversed
09:07:28euantoryeah, there are probably a lot that could be improved a bunch
09:08:34PMunchjaco60, if you look at the example it's the exact same as the one in the manual. I wouldn't be suprised if the same person who wrote that rosettacode snippet was also the one who added it to the unicode module
09:09:36euantorThis one is super easy: http://rosettacode.org/wiki/DNS_query
09:09:51euantorhttps://nim-lang.org/docs/nativesockets.html#getHostByName,string
09:10:20AraqPMunch: that is exactly what happened
09:10:36Araqfirst it was on rosettacode and then it was added to the stdlib
09:11:42PMuncheuantor, well it says both IPv4 and IPv6. Not sure if you can do that with getHostByName
09:11:51euantorit looks like it
09:11:57euantorhttps://github.com/nim-lang/Nim/blob/master/lib/pure/nativesockets.nim#L413
09:12:20PMunchThat is either
09:12:31PMunchDepends on what you got from the lower procs
09:12:48PMunchYou can't specify "I want this as IPv6"
09:12:52euantorStill might be worth having it there though
09:13:37euantorThis is also an easy one: http://rosettacode.org/wiki/URL_parser
09:19:07*Vladar joined #nim
09:20:31PMunchDoes Nim have a URL parser built in somewhere?
09:20:42euantoryep, in the `uri` module
09:20:48PMunchNice
09:24:04FromGitter<jaco60> Added the unicode.reversed in Rosetta
09:25:05FromGitter<jaco60> I could be better to know the nim version where this proc was added
09:28:41FromGitter<jaco60> s/I/It
09:36:28*Arrrr quit (Ping timeout: 256 seconds)
09:38:45Araqprobably exists since at least 0.16
09:39:19FromGitter<jaco60> Ok, i’ll add this
09:44:40*Arrrr joined #nim
09:44:41*Arrrr quit (Changing host)
09:44:41*Arrrr joined #nim
09:50:48*yglukhov quit (Remote host closed the connection)
10:00:28PMunchYou could always check the git commit that introduced it as well jaco60
10:01:18FromGitter<jaco60> Wow… https://forum.nim-lang.org/t/3540 : that’s what we have to do to extract a readable IP Address from a Hostent ?
10:05:43Araqthat code only deals with IP v4
10:06:16PMunchjaco60, Araq, apparently reversed in the unicode module was added for 0.11.0
10:11:14*yglukhov joined #nim
10:15:55*couven92 quit (Read error: Connection reset by peer)
10:16:47PMunchHmm, is there a way to borrow all for a distinct type?
10:18:54*Arrrr quit (Quit: Leaving.)
10:19:53Araqno and if you need that, why do you have a distinct type?
10:35:05*smt` quit (Ping timeout: 256 seconds)
10:44:43*yglukhov quit (Remote host closed the connection)
10:46:09*smt joined #nim
10:50:10PMunchOverloading
10:50:41PMunchI want to have two types, which are both ints, behave exactly like ints, but serialize differently when written to a stream
10:51:29PMunchCurrently I have them as distinct ints and have an overloaded write proc for each of them
10:51:52PMunchBut that means you have to convert back and fro between them, which is annoying
10:56:50PMunchHmm, with a X to seq converter it won't use high as it techincally wants an openarray, is this a bug?
10:57:21*yglukhov joined #nim
10:58:10PMunchHmm, same for []=
10:58:16PMunchWell that's annoying
10:59:41PMunchEspecially since I can't return an openArray from a converter..
11:03:00*Ahmedkh joined #nim
11:03:11*Ahmedkh left #nim ("ERC (IRC client for Emacs 25.3.1)")
11:05:31Araq"I want to have two types, which are both ints, behave exactly like ints, but serialize differently when written to a stream" seems confusing
11:08:42PMunchWell, that's how protobuf works.. You can have an int64, a sint64, a fixed64, or a sfixed64. All of those are 64bit integers, fixed64 is unsigned. The two fixed variants serialize as a regular 64bit int. The normal int64 serializes as a Varint, but always uses 10 bytes to store a negative number. sint64 uses zig-zag encoding which is more efficient for negative numbers.
11:09:13PMunchSo I want to have a protoWrite procedure, which takes either of these and writes them as per the spec
11:10:10PMunchBut internally in your program it doesn't really make sense to differentiate between them
11:12:53dom96hrm, couldn't you use a converter?
11:13:24dom96to implicitly convert back to the int but still able to write procs on the distinct type
11:16:54Araqyou should use the new pragma annotations
11:17:08Araq field* {.sfixed64.}: int64
11:17:23Araqit's a property of the field, not of the type
11:17:49FromGitter<andreaferretti> +1
11:17:57FromGitter<andreaferretti> it is a perfect use case
11:19:03Araqdom96: did we move fsmonitor to a nimble package? https://forum.nim-lang.org/t/3617
11:20:07dom96apparently it's here? https://github.com/nim-lang/Nim/blob/devel/lib/packages/fsmonitor.nim
11:20:40PMunchdom96, yeah I have converters now. But that doesn't work for seq
11:20:45PMunchNot that that's a huge issue
11:21:06PMunchHmm, how does that work Araq?
11:21:10PMunchThe properties I mean
11:21:20*xkapastel quit (Quit: Connection closed for inactivity)
11:21:31Araqread the manual
11:21:56*yglukhov quit (Remote host closed the connection)
11:26:44PMunchHmm, yes I remember vagualy someone talked about this when it was introduced
11:27:08*regtools quit (Quit: leaving)
11:27:39FromGitter<jaco60> Any advice before publish it in Rosetta ? (i don’t know if it’s idiomatic nim as i’m a beginner) https://gist.github.com/jaco60/bb2fbc4d79b2f64adaa6f8a0d9d7a679
11:27:54PMunchSo convert my writer procs to a single macro, then annotate the fields and have the macro read the custom pragma to decide serialization?
11:29:37PMunchjaco60, looks good to me. Could use an array instead of a seq since you're not changing the length but that's a minor thing
11:35:41dom96jaco60: why not just echo(url)?
11:36:46FromGitter<jaco60> Because i wanted to follow other solutions, like Go
11:37:15FromGitter<jaco60> echo url would be rather « raw », compared to the other solutions
11:37:32dom96You'll get the same output, but with much less code
11:39:04FromGitter<jaco60> i don’t get the same output at all
11:39:08dom96well, similar output
11:39:28FromGitter<jaco60> No… I just get the original url
11:39:39dom96echo(parseUri(url))
11:39:42dom96that's what I meant
11:39:51*yglukhov joined #nim
11:40:08FromGitter<jaco60> yes, but no… Try `echo res`, you’ll see
11:40:13*yglukhov quit (Remote host closed the connection)
11:41:11dom96oh right
11:41:17dom96echo system.`$`(parseUri(url))
11:41:20PMunchecho res just outputs the same URI that you passed in
11:43:51PMunchHmm, same info. But the formatting isn't as nice
11:44:24FromGitter<ZarsBranchkin> Uhm, why is the std/ part nescessary? I can't import the modules when it's there
11:44:41FromGitter<ZarsBranchkin> Error: cannot open 'std/uri'
11:45:10dom96Are you using Nim 0.17.2?
11:45:15PMunchjaco60, speaking of formatting: https://gist.github.com/3352f266c96db3cef74627feedf7cba6
11:45:25FromGitter<ZarsBranchkin> Ah, probably still have 0.17 on this computer
11:45:43dom96but actually it's more idiomatic not to use that
11:45:52dom96'std/' is only necessary for disambiguation
11:46:25FromGitter<ZarsBranchkin> Also backwards compatible if that is left out, so probably should remove that
11:47:28dom96yeah, and that's another reason to just write `echo system.`$`(parseUri(url))` ;)
11:48:03*regtools joined #nim
11:49:20FromGitter<ZarsBranchkin> System is necessary because uri overrides default $?
11:49:48dom96yep
11:50:11dom96system has a generic `$` for all objects
11:51:38Araqwell the idioms still evolve
11:51:46AraqI like 'std'
11:52:22Araqspeaking of which, can we do without 'pkg' please :P
11:53:06Araqah let me read the RFC again, forgot the problems already
11:53:17dom96no, we can't
11:54:09*SenasOzys joined #nim
11:58:07Araqimport random # uses std lib random
11:58:07Araqimport random/random # uses nimble's random
11:58:42Araqstill is the best solution. fix the nimble packages that don't play nice
11:59:01PMunchThat looks super confusing :P
11:59:25Araqpackage management is all about enforcing a style/directory layout anyway
11:59:38FromGitter<jaco60> Posted...
12:01:09*yglukhov joined #nim
12:02:30*Snircle joined #nim
12:05:21*yglukhov quit (Ping timeout: 248 seconds)
12:08:26Araqwhat if we make 'pkg' mean "not in std" but make it use the --path/nimblepath ?
12:08:41Araqthen it would just work with today's nimble, right?
12:16:48GitDisc<mraxilus> hey can anyone here provide some help with reassigning pointers in nim
12:17:35GitDisc<mraxilus> I'm trying to implement a stack to learn about pointer/memory mangement in nim -> https://pastebin.com/zk4BtZtd
12:18:14GitDisc<mraxilus> and on line 43 I get an error about not being able to assign a new address to one of my ptrs
12:21:49*yglukhov joined #nim
12:22:59*vlad1777d quit (Ping timeout: 268 seconds)
12:25:33PMunchmraxilus, try changing your input type to a "var Stack[T]
12:25:49GitDisc<mraxilus> what's the difference?
12:25:57*yglukhov quit (Ping timeout: 240 seconds)
12:26:14PMunchNormally you can't modify your input parameters in Nim
12:26:24FromGitter<ZarsBranchkin> Oh true, that solves it. It tells compiler that argument may get modified by the procedure
12:26:37PMunchSo you must specify that your input parameter is var so it can be modified
12:26:42PMunchCorrect
12:26:47GitDisc<mraxilus> Ah, I understand now, thanks
12:27:16PMunchThat way you won't be able to pass it e.g. a stack that's declared with let (not that it makes much sense in this case)
12:42:10FromGitter<dom96> mraxilus: PMunch: A better idea would be to use a 'ref' type in that case
12:42:19FromGitter<dom96> You won't have to write 'var Stack' everywhere then
12:45:04Araqthat's not better, just different
12:45:19FromGitter<andreaferretti> I prefer var stack
12:45:26FromGitter<andreaferretti> Stack stays a value type
12:45:37FromGitter<andreaferretti> and functions that mutate the stack say so in their signature
12:46:07GitDisc<mraxilus> yeah, I'm usually a fan of explicitly stating where mutations happen
12:46:22GitDisc<mraxilus> think I'll stick with ptr
12:46:56Yardanicowhy ptr?
12:46:57*floppydh quit (Remote host closed the connection)
12:47:25PMunchIsn't that the opposite of what you just said?
12:47:31PMunchOr did you mean var instead of ptr?
12:47:45*floppydh joined #nim
12:47:50GitDisc<mraxilus> var yeah my bad
12:49:43PMunchdom96, I tried to compile a local version of Nim after I made some changes. But to avoid having to build from C sources I just used the nim version I had from choosenim, but I get this error: http://ix.io/U34/
12:49:46PMunchIs that normal?
12:50:50YardanicoPMunch, https://github.com/dom96/choosenim/issues/45
12:52:45PMunchAha
12:52:50PMunchWhat even is nim0?
12:53:21Yardanicoprobably executable koch creates while bootstrapping
12:53:25YardanicoI don't really know
12:53:42Araqnim0 is the 0th step in the bootstrapping process
12:54:01Araqwhich is just a copy of nim iirc
12:55:23PMunchHmm, building from csources didn't get me much farther either..
12:55:25PMunchhttp://ix.io/U3c/
12:55:46YardanicoPMunch, ugh, are these csources 0.18.0?
12:55:54PMunchYup
12:56:01PMunchAccording to bin/nim --version at least
12:57:28PMunchOh wait
13:03:03*yglukhov joined #nim
13:07:38*yglukhov quit (Ping timeout: 276 seconds)
13:23:42*yglukhov joined #nim
13:25:37FromGitter<narimiran> @dom96 "A better idea would be to use a 'ref' type in that case" - did i understand this correctly: if you have 'ref object' there's no need to have 'var ' parameter in your proc, you can still modify it?
13:26:50FromGitter<narimiran> i thought using 'var' is a must if you wanted to modify something, didn't know about this other possibility (if i didn't misunderstand what you just said). any pros/cons of each method?
13:28:21*yglukhov quit (Ping timeout: 268 seconds)
13:29:13euantoryeah, you don't need `var` for a `ref` object
13:31:23PMunchWhat you are passing in with a ref object is not the object, it's the ref. So you're not allowed to change the ref, but you can change what it references (that is just treated as memory). If you used var with a ref object that would imply that you changed the reference, similar to double pointers in C.
13:32:06Yardanicoptr var ref object :D
13:32:22Yardanicothis is valid 0_0
13:32:38PMunchHmm, what would that be
13:32:47PMunchI guess var implicitly makes a ref
13:32:55PMunchSo it would be a pointer to a ref to a ref object?
13:33:23FromGitter<narimiran> thanks guys for the clarification!
13:37:07FromGitter<narimiran> btw, yesterday i had a situation where i had a seq consisting of arrays. and i want to send one array to another proc without copying it (`let a = seq[index]` would have copied it, from what i understand). i did is this way, tell me if there is a better way:
13:40:11FromGitter<narimiran> `let a = addr seq[index]`, and then in that proc, i had a parameter which said: `p: ptr array[length, type]`
13:44:21*yglukhov joined #nim
13:46:30PMunchnarimiran, you should probably use var in that case as well: https://play.nim-lang.org/?gist=8dd766c0da08dbb5115dba9426cc3a90
13:46:51PMunchThat means you are not copying the data you are sending in
13:48:32*yglukhov quit (Ping timeout: 245 seconds)
13:49:05*SenasOzys quit (Ping timeout: 240 seconds)
13:49:10FromGitter<narimiran> @PMunch: here's that part of the code (it won't work, just to show what i'm doing): https://play.nim-lang.org/?gist=ceed5afa714abc90ad7bee280ed42680
13:50:55FromGitter<narimiran> i thought if on line 8 i don't use `addr` that would copy Ts[t], no?
13:51:18PMunchNot if T is marked as var as well in the 'f' proc
13:55:13FromGitter<narimiran> @PMunch: here's your example modified: https://play.nim-lang.org/?gist=43d821c97ef03c2afd6343dc45e7b53b to include new `var z = x[1]` - the values in `x` haven't changed! (in contrast to when you have called `test(x[1])`)
13:56:07PMunchAh yes, the "var z = x[1]" copies the array I think
13:56:43PMunchSo in your case addr is the way to go
13:56:48*SenasOzys joined #nim
13:57:55FromGitter<narimiran> ok, so here is the wanted version: https://play.nim-lang.org/?gist=c2c11da40fc0c032dfa11dcd922910b7 using `addr` and `ptr`
13:58:44PMunchYes
13:58:59PMunchNote that you could also have z declared using a let statement here
13:59:14PMunchAs it is the reference, not the data
13:59:16FromGitter<narimiran> indeed!
14:00:15FromGitter<narimiran> ok, this was the first time i have used `addr` and `ptr` so i wanted to check if that's the way to go, or there is some better/idiomatic way to achieve the same thing.
14:00:38PMunchFor performance reasons (which I guess is what you are going for here) you might also want to throw on a {.inline.} pragma
14:00:46PMunchOr even just declare the whole thing as a template
14:04:49FromGitter<narimiran> you have guessed correctly about performance :) {.inline.} goes in the definition of my `f` proc, right? what would be advantages of using template here?
14:04:57*yglukhov joined #nim
14:05:48PMunchYes
14:06:05PMunchWell, maybe not that great of a benefit
14:06:20*vlad1777d joined #nim
14:06:24PMunchtemplate and {.inline.} would probably have similar performance benefits
14:07:09PMunch{.inline.} is just a flag to the compiler to make it inline the body of the procedure. templates does more or less the same but in Nim
14:09:29*yglukhov quit (Ping timeout: 260 seconds)
14:11:08FromGitter<narimiran> just tried both versions (inline and template) and there is no noticeable difference in the end regarding running times
14:12:21PMunchDid you notice a speedup between not using them?
14:12:26Araqtemplate currently has the edge because the compiler's handling of .inline is rather stupid
14:12:48Araqthe compiler delegates .inline to the C compiler
14:13:19Araqtemplate performs the inlining in the frontend, this can elide more copies, for example
14:15:10PMunchYeah, and .inline. is just a hint
14:15:18PMunchThe compiler might ignore it completely
14:16:33FromGitter<narimiran> PMunch: haven't noticed a significant difference (it is smaller than difference between two consecutive runs)
14:17:34AraqPMunch: that's usually not a problem.
14:17:44FromGitter<narimiran> Araq: so you would recommend to use templates in cases like this one? its performance will be at least as good as proc, and it might be better?
14:18:05Araqno, our guidelines say to prefer inline procs
14:18:32Araqas they are easier to reason about (no control flow effects)
14:19:29Araqthat they are currently slower in some circumstance is just an unfortunate implementation detail. you can always optimize and use 'template' later
14:23:31FromGitter<narimiran> i have run every version five times, and these are average times:
14:23:52FromGitter<narimiran> proc: 3.65 sec; inline proc: 3.65 sec; template: 3.80 sec
14:25:34*yglukhov joined #nim
14:29:17FromGitter<narimiran> and all these are very good times for such a huge domain i'm calculating. (for comparison, julia runs this in 4.74 seconds, python+numpy+numba in ~13 sec)
14:29:35*yglukhov quit (Ping timeout: 240 seconds)
14:30:01FromGitter<jaco60> Well, iI give up trying to figure out how to use `nativesockets.getHostByName` to get IP addresses. It’s beyond my skills :(. If someone is able to explain me how to get *readable* strings from the `Hostent.addrList` field, i’ll be grateful.
14:33:27*smt quit (Ping timeout: 252 seconds)
14:35:44dom96http://sogrady-media.redmonk.com/sogrady/files/2018/03/lang.rank_.118.png
14:35:54dom96Time to create more projects guys!
14:38:35dom96(From https://redmonk.com/sogrady/2018/03/07/language-rankings-1-18/)
14:39:03federico3we need better dissemination
14:39:39zarthurIndeed @dom96, and my 2 cents, if #nim could get as good Webframework as Rails it could take it much higher
14:40:04*PMunch shudders while thinking about Ruby on Rails
14:41:21dom96zarthur: Perhaps you could that web framework :)
14:41:24dom96*could write
14:42:01federico3zarthur: the web "development" world is already really saturated with languages and frameworks
14:42:12zarthur@PMunch it is all about how you want to position #nim. Ruby is high because of Rails, C# is for all/everything summed up, R for the wide adoption by para-programmers in application to data science, CSS, well not a language per-se but drives quite a bit of websites
14:43:25zarthuryeah writing a successful Web Framework is not a trivial undertaking, but today the World needs better web experience. Ruby is slow and illogical, rip it apart with #nim :-)
14:45:18*douglascorrea joined #nim
14:45:28zarthurWell, @pmunch, with all the fairness, but when a Web Dev (not me) reading "Nim in Action" needs Nginx reverse proxy mapped to Jester 0.0.1 to power a website one sets oneself on fire
14:45:52federico3zarthur: want to write detailed requirement on https://github.com/nim-lang/needed-libraries/issues ?
14:47:05federico3zarthur: what's the issue? 0.0.1?
14:47:40PMunchzarthur, well that's fair. But Jester really isn't that hard to set up and it's super easy to use. At least for simple sites which is all I have really used it for
14:47:46FromGitter<andreaferretti> rosencrantz is versio 0.3.3 - clearly more advanced :-P
14:48:37dom96https://www.reddit.com/r/programming/comments/82wpiw/the_redmonk_programming_language_rankings_january/dvdks2l/
14:48:54zarthurExactly, aim, high @pmunch, nim needs a pro web framework with ORM (database objects mapper)
14:49:39dom96zarthur: yeah, strange how most of the web runs on PHP behind nginx, apache, lightttpd huh?
14:49:42federico3zarthur: again, want to write detailed requirement on https://github.com/nim-lang/needed-libraries/issues ?
14:50:17dom96I bet most web frameworks recommend you run them behind nginx or another http server
14:50:21zarthur@dom96 PHP has good web frameworks
14:50:36PMunchzarthur, yeah I was using MySQL for my simple site. But now we have Ormin: https://github.com/Araq/ormin
14:50:57zarthurAll the web servers are Web Framework agnostic
14:52:58FromGitter<krux02> zarthur: then built a web framework.
14:53:07FromGitter<andreaferretti> zarthur: not exactly true
14:53:20FromGitter<andreaferretti> many web frameworks are meant to be exposed directly
14:53:29FromGitter<andreaferretti> without a reverse proxy
14:53:39FromGitter<andreaferretti> hence they are frameworks and servers in one
14:53:47federico3that's usually not a good idea
14:54:38zarthurDoes ormin natively integrate into Jester?
14:54:44livcdzarthur: Ruby is loosing its momentum because its "usefulness/popularity" is driven mainly by an opinionated web framework.
14:55:20zarthur@andreaferretti exactly my point, but in the book... ^
14:55:43federico3yep - it's better not to force ORMs and other stuff on users
14:56:08PMunchzarthur, what do you mean by natively integrate into Jester?
14:56:23zarthur@livcd, this is why I said above rip it apart with #nim
14:56:53dom96Does the book say you "need" it?
14:56:58zarthur@federico3 that's what I am conveying in reference to the book
14:58:15PMunchHmm, I should really do that documentation server. If for nothing else than to show how to combine Jester+Ormin+Karax to create a simple website
14:58:22federico3I'd rather have a tool to create a skeleton for web apps and pull in only the libraries you really need and generate the glue code
14:58:42livcdfederico3: like with js projects and npm ? :D
14:58:45PMunchOr Jester+Ormin+<Some templating engine (ideas?)>
14:58:49federico3[spam] PMunch: and httpauth
14:59:03federico3livcd: no, like turbogears was doing
14:59:23PMunchOooh nice federico3, didn't know about that
15:00:23federico3PMunch: Nim already has templating albeit it does not integrate well in jester
15:00:32Temperance[m]I suppose that given that nim compiles to C, using nim with emscripten must not be too hard, right?
15:00:49FromGitter<andreaferretti> for templates there is https://nim-lang.org/docs/filters.html
15:01:04FromGitter<andreaferretti> I cannot see why it would not integrate nicely in jester
15:01:09FromGitter<andreaferretti> or anything else really
15:01:15FromGitter<andreaferretti> they are just functions
15:01:25federico3andreaferretti: that's why
15:01:57PMunchOh yeah, those strange things. Haven't really tried them
15:02:00PMunchBut I like the idea
15:02:08dom96IMO those filters just need a nicer syntax
15:02:17dom96and a way to inline them into procedures
15:02:37YardanicoTemperance[m], it's already possible
15:03:04federico3andreaferretti: many frameworks discover automatically the template location and "apply" them to the routes you want
15:03:06YardanicoTemperance[m], for example see https://github.com/Jipok/Nim-SDL2-and-Emscripten
15:03:10dom96Temperance[m]: It's already used in production
15:03:21Yardanicodom96, really?
15:04:03dom96Reel Valley uses emscripten IIRC
15:04:20Yardanicodom96, I think it doesn't, hmm
15:04:44Yardanicodom96, ah, yes, it does
15:05:00PMunchfederico3, I guess one could do something like that with a macro
15:05:06FromGitter<andreaferretti> @federico3 I don't like autodiscovery, I think that explicitly using the functions you want is preferable
15:05:15PMunchSearch through a folder and include whatever is in there and create routes for it
15:05:17YardanicoTemperance[m], check out Reel Valley on facebook (it's a game), it uses nim+emscripten
15:05:26Yardanicoit's also available on mobile platforms, but it uses native code there
15:05:50federico3PMunch: the routing has to be explicit because you might want to apply the same template to many routes
15:05:58*r3d9u11 joined #nim
15:07:06livcdso then an opinionated game framework in Nim ? :-X modeled after Reel Valley ?
15:07:23Yardanicolivcd, Reel valley uses NimX
15:07:34Yardanicofor gui :)
15:07:45livcdoh
15:08:05Yardanicolivcd, a lot of parts of Reel Valley are open-sources
15:08:07*sendell quit (Remote host closed the connection)
15:08:07Yardanicoopen-sourced*
15:08:13PMunchfederico3, wait. What did you want it to do then?
15:08:34Yardanicolivcd, check "Technical Insights of the Game" here - https://yglukhov.github.io/Making-ReelValley-Overview/
15:09:01Yardanicolivcd, and yeah, their game engine is rod - https://github.com/yglukhov/rod
15:10:23zarthur@livcd, I am not a proponent of Ruby on Rails, but "loosing momentum" feels like fake news, and it does not mean much sorry if assaulting but how much momentum, it is very high on the chart
15:11:08zarthurin m view the Ruby on Rails community just wanted to whine a bit to entice the maintainers to keep going delivering good stuff
15:11:50*yglukhov joined #nim
15:12:11FromGitter<Vindaar> So I recompiled a small program, which just extracts some time information from some data on the current 0.18.1 devel branch. Previously compiled on a few months ago on the then devel branch. I noticed that the duration I output suddenly shows 0 days, 0 hours and 0 minutes. Well, code boils down to this example from the docs: ⏎ https://play.nim-lang.org/?gist=ebc0c0a8f45eb2a31e61ce54262afb9a ⏎ I know there were
15:12:11FromGitter... quite a few changes to the times module, but is that expected behavior now? Meaning initInterval only adds the given field (in this case seconds) to the TimeInterval instead of correctly populating the different fields.
15:12:43federico3PMunch: you "apply" a template to a route with a simple syntax and the framework will scan ./templates for it and give a meaningful error if there's any issue. Currently templates are imported globally and you have to type the tpl name in 3 places
15:12:55FromGitter<Vindaar> Looking at the implementation of initInterval shows that indeed, the div and carrying to populate all fields is gone
15:15:30PMunchfederico3, I would love to see a mock up of how this would work in Jester. Not runnable of course
15:16:34*yglukhov quit (Ping timeout: 260 seconds)
15:18:32dom96Vindaar: yeah, there was quite a few changes to this. Do open an issue if the behaviour is odd now.
15:18:46federico3PMunch: will do
15:18:57FromGitter<Vindaar> @dom96 ok, will do
15:33:21*rinzai joined #nim
15:38:06*yglukhov joined #nim
15:40:24*douglascorrea quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:41:13*dddddd joined #nim
15:43:07FromGitter<Vindaar> done: https://github.com/nim-lang/Nim/issues/7315
15:44:35*miran joined #nim
15:47:34Temperance[m]if I end up liking nim I might try to do a toy game engine for fun, specially since I'll want to be able to test glsl and stuff with it.
16:03:26*floppydh quit (Quit: WeeChat 2.0.1)
16:05:29*PMunch quit (Quit: Leaving)
16:06:12*douglascorrea joined #nim
16:09:55FromGitter<krux02> :D I have there something for you
16:10:11FromGitter<krux02> but only if you are not on a mac
16:10:37FromGitter<krux02> @Temperance githib.com/krux02/fancygl
16:11:10FromGitter<krux02> but if you try it out, tell me about it, it's not in a final state it is more a research project
16:11:32mirankrux02: you have (at least) one typo in your link ;)
16:11:43FromGitter<krux02> I actually write a master thesis about it and it will have eventually shaders that are written in it
16:11:46FromGitter<krux02> ah sorry
16:11:53FromGitter<krux02> github.com/krux02/opengl-sandbox
16:12:23*noonien joined #nim
16:12:27noonienhello folks!
16:13:07miranhello noonien!
16:13:08FromGitter<Vindaar> hey!
16:15:45FromGitter<krux02> @Temperance: the video is also linked on the github page, but it is a good introduction: https://www.youtube.com/watch?v=JO0iqGDgFqA
16:16:08noonieni'm trying to see if i can compile a simple blinky program using nim, for a cortex m0 mcu. from what i understand, this should be as easy as compiling with `nim c --cpu:arm --gc:none --os:standalone`, correct?
16:20:11*r3d9u11 quit (Ping timeout: 256 seconds)
16:28:00Temperance[m]can't open fancy gl github
16:28:25miranTemperance[m]: see the other link few messages below
16:28:27dom96noonien: hrm, maybe federico3 can help out here
16:28:38nooniencool
16:29:03noonienis there any way of passing default build flags using nimble?
16:29:24noonienor should i just create build-debug and build-release tasks in the .nimble file?
16:29:34Temperance[m]will look into it tonight
16:30:15dom96noonien: create a .nim.cfg file and add your flags there
16:30:30dom96name it module.nim.cfg
16:30:45dom96or just nim.cfg to apply to your whole project IIRC
16:30:59noonieni've got a nimble package created with "nim init"
16:31:10noonienshould i put that file in the src folder?
16:31:25dom96yeah
16:31:31nooniencool
16:50:10nooniendoes nim have a runtime?
16:52:10nooniencan i compile nim without the stdlib, or, can i choose which functions from the stdlib i use, and not compile the ones i don't use?
16:55:40FromGitter<zacharycarter> is it possible to compile multiple modules for the VM at runtime?
16:55:44FromGitter<zacharycarter> using a modulegraph or something?
16:55:59FromGitter<zacharycarter> or should I just register all my vm callbacks in the main context?
17:01:02Araqhmm, not sure
17:01:47Araqnoonien: with --deadCodeElim:on only what you use ends up in the binary
17:03:06noonieni see, i'm already using that, i'm trying to create an empty program and am getting: `/build/newlib-OTNHfJ/newlib-2.4.0.20160527/build/arm-none-eabi/newlib/libc/stdlib/../../../../../newlib/libc/stdlib/exit.c:70: undefined reference to `_exit'`
17:03:14noonieni guess exit is a special requirement
17:05:26Araqexit.c is not produced by Nim
17:07:09FromGitter<zacharycarter> Araq: any idea who might know more about the VM stuff? I've written a macro which stores callbacks I want to register with a VM module context in a table. At runtime I register these callbacks with the VM context - but it'd be neat if I could build a module dependency hierarchy and separate all my callbacks into separate modules, instead of just dumping them all into the main module.
17:07:14Yardaniconoonien, arm-none-eabi means what you're compiling for barebones?
17:07:28YardanicoI mean not for an OS?
17:07:52noonienYardanico: yes
17:08:05Yardanicowell then you can't use some modules from stdlib
17:08:12Yardanicoand GC
17:08:14noonienthat's not a problem
17:08:34Yardanico(well you can port GC, but I don't know how :D)
17:11:45FromGitter<tim-st> Not directly nim related, but mayber someone knows if there's a better way to use a sequence of uint as strKey than like `0|1|2|4|1`?
17:12:04FromGitter<tim-st> (enums)
17:15:41Araqhttps://hal.inria.fr/hal-01724997/document
17:15:53Araqzacharycarter: I think you're doing it wrong ;-)
17:16:08Araqcheck out how putEnv was added to Nim
17:17:36FromGitter<zacharycarter> okay thanks I will
17:19:54FromGitter<zacharycarter> ah I think I get it now :) thanks Araq!
17:20:36*xkapastel joined #nim
17:27:46noonienYardanico: I'm trying to compile an empty program
17:27:54noonienjust an empty main function
17:28:28Yardaniconoonien, you still need to disable gc, maybe it will help
17:28:29Yardanicobut IDK
17:29:36*MJCaley joined #nim
17:31:07*rbrt joined #nim
17:39:42dom96noonien: looking at nimkernel might help out too: https://github.com/dom96/nimkernel
17:40:28noonienawesome, i'll give it a look, thanks!
17:42:57*yglukhov quit (Remote host closed the connection)
17:46:05federico3noonien: an example of nim.cfg for avr in query
17:46:31noonienjust a second, i'll put up a gist of what i've got so far
17:54:08noonienthis is what i've got so far: https://github.com/noonien/nrf51288_blinky_nim
17:54:16noonienand the error i'm getting: http://vpaste.net/FlOf9
17:55:04noonieni don't know how hard it'll be to initialize the hardware in nim, as a temporary workaround i was thinking of compiling the nim code as a library and initializing the hardware in C code
17:55:31noonienthe problem with nimkernel is that it calls the linker manually
17:55:33*Chiel joined #nim
17:55:48noonienand one of the reasons i'm trying to move to nim is so i can simplify the build process
17:56:53ChielHello Nim people. We are considering using Nim on an embedded linux system with pretty tight memory constraints. Would it be possbile to compile (part of) the Nim standard libs as shared libraries to reduce the size of the individual binaries?
17:57:32ChielI can only get this to work using the C api, but I'm not sure how to call pure nim code from an Nim lib compiled with --app:lib
17:58:01*SenasOzys quit (Remote host closed the connection)
17:58:18*SenasOzys joined #nim
18:03:04federico3Chiel: like in https://forum.nim-lang.org/t/2051 ? --app:lib gives you a C api
18:04:07federico3(besides: Nim includes only the the needed code in a binary, not the whole stdlib: are you sure this optimization would be useful?(
18:04:13federico3))
18:04:31ChielProbably, I have a number of tools all doing asynchronous networking, which adds up
18:04:39ChielJust considering the options
18:05:45federico3can you share some numbers?
18:07:47ChielI have a single binary which is now approx 500K, of which only 40K is main application symbols, the rest all comes out the stdlib
18:08:22ChielAdding one and one, I suppose I should be able to have two of such programs runninng at a total of (40+40+460) = 540K
18:08:46ChielThe other option would be to make one single binary and fork() early
18:09:24Chielor one binary which multiple apps built in, and simply choose an other path to run at startup
18:09:33Chielbasically, just linking it all into a single blob
18:11:20federico3like https://en.wikipedia.org/wiki/BusyBox
18:11:25Chieljust like that
18:12:03Chielbusybox originally solved it like that to be able to run small on uclinux, which has no MMU, and no shared libs
18:12:29federico3do you also want to do execute-in-place?
18:12:43ChielNo, we run from cramfs, so that is not an option at this time
18:13:07ChielI have approx 4mb of flash, but loads of RAM available
18:19:08federico3Chiel: assuming you are using -d:release --opt:size --deadCodeElim=on , have you tried compressing the binaries?
18:19:28ChielWell, in the end they are compressed by the cramfs, which does a lot
18:19:37federico3(i mean apart from cramfs)
18:20:35ChielNo, not yet. That does not really help in the end because it will end up in the cramfs anyway
18:20:53federico3cramfs uses zlib - perhaps xz does better
18:20:59ChielCramfs does as well
18:21:26Chielsquashfs that is
18:21:27ChielI'm sorry
18:22:15Chielanyway, I'm still fine for now, just looking for options
18:24:09noonienOops, my mistake, nim was not at fault, i just had to pass --specs=nosys-specs to the linker
18:24:19noonienAccording to: https://stackoverflow.com/questions/19419782/exit-c-text0x18-undefined-reference-to-exit-when-using-arm-none-eabi-gcc
18:24:49noonienAnd https://launchpadlibrarian.net/170926122/readme.txt
18:25:00noonienPerhaps nimc should do that by itself?
18:25:18Araqnoonien: there is a subset of Nim that maps to C 1 to 1, there is nothing you need to use C for
18:25:53AraqChiel: the library can be built as a DLL but it's usually not done because it's inconvenient
18:26:22ChielHow does one import and export from a shared lib with mangling intact?
18:27:25Araqby telling the compiler how to mangle
18:31:20Araqproc foo*(x, y: int) {.exportc: "prefix_$1_intint".}
18:32:24ChielAh, that makes sense, thank you
18:36:25Araqnoonien: Nim can't guess your configuration. the embedded stuff is full of special cases and setups
18:37:10noonienThat makes sense, i just figured arm-none might be a common setup in the embedded world
18:38:11dom96it might make sense if this option works for all arm-none projects
18:38:23dom96and if Nim can easily know that that is what you're using
18:40:09*Trustable joined #nim
18:41:48*jxy quit (Quit: leaving)
18:45:50*jxy joined #nim
18:59:23FromGitter<samdmarshall> heya, I had a quick question while trying to work on a small project. I have some sequences that i'm filtering down. the resulting sequences should have a single elements, how would I go about pulling an element from the sequence without hard-coding it directly to a specific index? I thought there was an `any` or similar operator that would return an element (doesn't necessarily have to be the first element) from
18:59:23FromGitter... the sequence, but I cannot seem to find anything when I checked the docs
19:01:50FromGitter<Vindaar> Not quite sure if that's helping you, but you're aware of the sequtils module, right? https://nim-lang.org/docs/sequtils.html
19:02:56AraqI think we only have https://nim-lang.org/docs/sequtils.html#any,openArray%5BT%5D,proc%28T%29 and siblings returning 'bool' not the element that matched
19:03:04FromGitter<samdmarshall> yeah I looked at that but didn't see anything that would return a singular element from the sequence for me
19:04:47FromGitter<tim-st> Is there a way to ensure my enum type has every ord in range 0..255 ?
19:05:24FromGitter<samdmarshall> normally i'd be fine with just using an iterator for such results, but i'm doing this in a `cmp` method so I need to unbox the element from the seq
19:09:17*athenot_ quit (Remote host closed the connection)
19:09:28FromGitter<cabhishek> Hi folks, I am getting `ProtocolError: Connection was closed before full request has been made` error when trying to load test my server. Any ideas how I should I handle this run time error? I am using `AsyncHttpClient`.
19:09:58*athenot joined #nim
19:16:59*SenasOzys quit (Ping timeout: 256 seconds)
19:21:21FromGitter<nitely> @samdmarshall you are lookig for a `reduce` function
19:22:48FromGitter<nitely> I does not seem Nim has one, at least not one with that name in the stdlib
19:23:12FromGitter<jaco60> there is a foldr proc, right?
19:24:37FromGitter<ZarsBranchkin> Yeah, seems you're right https://nim-lang.org/docs/sequtils.html#foldr.t,untyped,untyped
19:29:28FromGitter<nitely> ah, right. That one should work
19:30:07FromGitter<samdmarshall> how would I use that to return a singular element of the sequence?
19:30:52miransamdmarshall: can you be more detailed about what exactly you're trying to do?
19:31:49FromGitter<nitely> @samdmarshall you want the first one that matches your cmp?
19:32:27FromGitter<samdmarshall> i'm not sure how more detailed I can be: I have a seq that has probably one, but maybe more, element in it. I don't care which element of the sequence I am given, I just want one of them
19:33:25*SenasOzys joined #nim
19:34:06miranso basically you want a random element from that seq?
19:34:17FromGitter<samdmarshall> yes
19:34:27FromGitter<data-man> LLVM/Clang 6.0.0 released. http://releases.llvm.org/6.0.0/docs/ReleaseNotes.html
19:35:09miranhttps://nim-lang.org/docs/random.html#rand,int
19:35:24*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
19:35:38miranseq[rand(seq.len-1)] ?
19:35:46FromGitter<samdmarshall> that would look something like `my_seq[rand(len(my_seq)]` yes?
19:36:30FromGitter<samdmarshall> yeah that is kinda horrible and was hoping for a simple operator, I might as well just hardcode the first element if that is the case
19:36:54FromGitter<ZarsBranchkin> Can always write a template for that, haha
19:37:35FromGitter<samdmarshall> returning the first element isn't that big of a deal, I was hoping there was a language construct for this
19:37:49mirantake a note that max in `rand` proc is included in the range, so your example would sometimes fail. but you can use seq.high instead of seq.len-1
19:38:24FromGitter<ZarsBranchkin> Language construct is kind of a sketchy statement in Nim, since the standard libraries are just pure Nim as well. There is no difference if they implement it, or you write a template/procedure for that
19:38:59FromGitter<ZarsBranchkin> So if you would write `any` template, that picks random element like that, you could as well call it a new sequence construct
19:39:02FromGitter<samdmarshall> ok, let me rephrase, I was hoping there was something in the stdlib that already did this
19:39:20*Snircle joined #nim
19:39:45FromGitter<samdmarshall> randomizing the element selection is going to over-complicate this if I have to implement that myself
19:40:05dom96what's wrong with: seq[rand(seq.len-1)]?
19:40:47FromGitter<ZarsBranchkin> ```template any[T](list: OpenArray[T]): T = ⏎ list[rand(list.high)]``` ⏎ ⏎ And that's about as legit as what stdlib could provide you [https://gitter.im/nim-lang/Nim?at=5aa191bf888332ee3a1567e7]
19:40:53FromGitter<samdmarshall> it is just adding complexity to the code for the sake of it when I already know it will have at least one element
19:41:22FromGitter<ZarsBranchkin> Now with that you can just do: ⏎ ⏎ ```var someElement = mySeq.any``` [https://gitter.im/nim-lang/Nim?at=5aa191e1458cbde557102355]
19:42:02FromGitter<ZarsBranchkin> Which would be as efficient/fast as just writing out `mySeq[rand(mySeq.high)]`
19:42:06dom96Not that I want to bikeshed, but `pick` is a better name for this function
19:42:24FromGitter<samdmarshall> @ZarsBranchkin yeah, i'm aware I can do that; my question was about existing functionality and if I was missing something because I was trying to look it up using the wrong terminology -- not a question of "can I actually do this"
19:43:01FromGitter<samdmarshall> @dom96 yeah, I agree, I gave `any` in my example as that is what it has been called in other languages I know
19:43:08FromGitter<ZarsBranchkin> Now that you were interested in it, why not make a pull request and suggest such addition to sequtils? Now it will be part of stdlib
19:43:12miransamdmarshall: well, in python you would have `choice`, but it is not that much simpler than the nim code presented before
19:43:47FromGitter<ZarsBranchkin> The language grows from such additions anyway, that's why I was slightly confused about what's the problem here
19:44:04FromGitter<samdmarshall> ¯\_(ツ)_/¯ all I was trying to figure out if there was a convenience method that exists or not, if not then i'll just hardcode and move on in my work
19:44:39miranhardcode means you will have `seq[0]`?
19:45:12FromGitter<ZarsBranchkin> what about `seq.pop`, if you don't care about which element you get?
19:45:21FromGitter<ZarsBranchkin> That's part of stdlib already
19:45:54FromGitter<ZarsBranchkin> https://nim-lang.org/docs/system.html#pop,seq[T]
19:46:33*Chiel quit (Quit: Lost terminal)
19:47:17*Ven`` joined #nim
19:51:04FromGitter<samdmarshall> @ZarsBranchkin because that requires adding more mutability to my code
19:51:58FromGitter<samdmarshall> @miran if it means I don't have to write the implementation and is documented as part of the language then the complexity it has doesn't matter, as I don't have to maintain it
19:52:07FromGitter<ZarsBranchkin> Then probably index would be as simple as it gets
19:52:13FromGitter<samdmarshall> whereas, I do need to maintain my own code
19:53:44miranwell, i still don't see the problem with `seq[rand(seq.high)]`, because it is quite self-explanatory in what it does, but that's just me.... :)
19:54:14FromGitter<samdmarshall> it takes infinitely longer to parse and comprehend than seq[0] does, so
19:54:56miranthat kind of thinking won't get us much further than some addition of integers :D
19:55:07*douglascorrea quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:55:56FromGitter<ZarsBranchkin> Not sure if you should be worrying about parsing time, Nim expects you to meta-program it, that's what it was made for
19:57:04*douglascorrea joined #nim
19:57:11*rbrt quit (Quit: Oíche mhaith)
19:58:24FromGitter<samdmarshall> i'm talking about humans
20:01:12FromGitter<ZarsBranchkin> If I were you, I'd just write that template and forget about it. Don't see how it's any different from chunking up your code via funtions, except here you abstract away tougher to read code, to deal with what you just mentioned
20:01:41FromGitter<ZarsBranchkin> Remember that templates are compile time thing and are there for exactly that - make code more readable to human
20:03:38FromGitter<nitely> well, I mentioned `reduce/fold` cuz it can be use as an `any` that returns a seq value instead of boolean, which came up at some point in the conversation. But it does looks like you would better off just doing `my_seq[0]` to get the first element or `my_seq[my_seq.high]` to get the last one
20:05:35shashlickdom96: looks like nimble runs "before install" before installing dependencies so I cannot use dependencies in the before install section
20:06:06FromGitter<ZarsBranchkin> Yeah, fastest performing and prettiest looking would be template `first` that simply equals to `my_seq[my_seq.low
20:06:12dom96shashlick: what are you planning to use?
20:07:34shashlickfor my nimgen dependent packages, nimgen needs to be installed before you can generate the nim files
20:07:45shashlickso steps are 1. install nimgen, c2nim dependencies 2. before install, generate nimgen artifacts 3. install to pkgs dir
20:08:08shashlickalternative is to run nimgen in the "after install" step but I need to be in the right pkgs directory and not quite sure how to do thata
20:09:21shashlicki can find the install path with "nimble path packagename" but then how do I "cd" into that in a .nimble script
20:11:01FromGitter<nitely> @ZarsBranchkin I believe ruby is one of the few languages that has stuff like `myseq.first` and `myseq.last`, but seriously, anyone who has program before knows what `my_seq[0]` means
20:12:34FromGitter<jaco60> To mimic a lot of FP languages, we could have myseq.head and myseq.tail (or myseq.car and myseq.cdr for lispians) :)
20:13:19miranb-but why? what's wrong with s[0]?
20:13:45miranwell ok, s[1..^1] is not as pretty as pythons s[1:]
20:14:17*PMunch joined #nim
20:16:14FromGitter<samdmarshall> my 2-cents: index by zero as a concept is silly
20:16:20FromGitter<samdmarshall> so I prefer `.first()`
20:16:47miranlet us not go there. also no vim vs emacs, and no spaces vs tabs :D :D
20:17:11FromGitter<ZarsBranchkin> Yeah, that's why i'd use seq.low or seq.high as indices, when implementing first and last
20:17:47FromGitter<ZarsBranchkin> And now i'm feeling like just making a PR with this for system.nim
20:17:58*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:28:28FromGitter<krux02> @samdmarshall what is so bad with index by zero
20:29:38FromGitter<samdmarshall> I don't like hardcoding values if I can avoid it
20:29:42FromGitter<krux02> miran: I could imagin that nim would automatically apply the this pragma in `[]`
20:30:12FromGitter<krux02> meaning `a[0 .. len-1]` would work, because it can resolve len as `a.len`.
20:30:23FromGitter<krux02> and then all other symbols would work, too
20:30:30FromGitter<krux02> a[low .. high]
20:30:40PMunchOooh, that would be fancy
20:30:59FromGitter<krux02> and if you define them also your own symbols `a[low .. middle]`
20:31:12PMunchMan, that would be really neat
20:31:21PMunchBut I'm not sure if the this pragma would work
20:31:32PMunchOr wait, would it?
20:31:37PMunchFor let's say a seq
20:31:54FromGitter<krux02> I can try a prototype with macros
20:31:57FromGitter<krux02> maybe
20:32:24FromGitter<krux02> I'll be back until then you get some waiting music: https://danieldeluxe.bandcamp.com/track/soul-siphon
20:32:43PMunchWould these be procs though, and not fields
20:32:48PMunchI don't think this works with procs
20:34:05FromGitter<ZarsBranchkin> Seems neat, but how would it react to variables named that way? I guess use those, if there sre none, assume a.low etc
20:41:35*rokups quit (Quit: Connection closed for inactivity)
20:42:01dom96shashlick: You can probably use this: https://nim-lang.org/docs/nimscript.html#cd,string
20:42:21dom96shashlick: Also, this might be a valid alternative to executing `nimble path ...`: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/nimscriptapi.nim#L44
20:42:32shashlickdom96: looks like my fix for #280 is wrong - https://github.com/nim-lang/nimble/pull/448/commits/4770556939a7dfd53c608926a6ccf0320dd5e77f
20:42:33dom96Definitely plan to expand this API in the future :)
20:43:19FromGitter<krux02> @ZarsBranchkin yes, but unfortunately I don't see an easy way to just prototype that functionality right now.
20:43:23shashlickthe pre-install hook needs to be moved here: https://github.com/nim-lang/nimble/blob/master/src/nimble.nim#L349
20:43:37dom96shashlick: :/
20:43:51dom96It's time to add a test for this
20:44:57FromGitter<krux02> as far as I know macros don't allow to control the rules for symbol resolution
20:47:05shashlickgetPkgDir() returns blank
20:51:19dom96hm, odd
20:54:06*rbrt joined #nim
20:56:12*nsf quit (Quit: WeeChat 2.0.1)
21:00:11miranhttps://www.tiobe.com/tiobe-index/ nim is not even in the first 100 languages? or it isn't even included?
21:00:28miran(yeah yeah, i know, tiobe index is shit, but just saw a link on HN)
21:02:25*miran quit (Quit: Konversation terminated!)
21:02:46FromGitter<ZarsBranchkin> miran: Apparently they do track Nim https://www.tiobe.com/tiobe-index/programming-languages-definition/#instances
21:03:01FromGitter<krux02> tiobe index is not shit, but it is just a metric they use, nobody can tell you how popular a language really is
21:03:26FromGitter<krux02> but to be honest how big can a language be when the entire community of that language shares a single chat room?
21:03:55FromGitter<jaco60> and we don’t need Tiobe to know that nim is not a mainstream programming language… yet
21:04:46PMunchkrux02, what do you mean. We have plenty of chat rooms!
21:04:55PMunchThey're all linked together though..
21:05:09PMunchExcept from #nim-nologs and #nim-offtopic I guess
21:05:14PMunchAnd the Telegram channel
21:05:52Araqnumber of github projects seems to me a pretty reasonable indicator
21:06:14dom96Not everybody uses GitHub :)
21:06:23Araqno need for Tiobe's weirdness. do they still think Delphi and Pascal are different languages?
21:06:37dom96They are different languages though :P
21:06:55FromGitter<krux02> PMunch that is what I mean. All chat rooms are linked together, and it is still not overcrowded
21:07:16PMunchkrux02, yeah I was just making a joke :P
21:07:58FromGitter<krux02> dom96: that is true, but it is just meant as a metric
21:08:35dom96I think measuring user count and message frequencies might be a good way to measure popularity
21:08:58FromGitter<krux02> I never programed in Delphi or Pascal, but I though Delphi to Pascal is like C++ to C.
21:09:05dom96or at least it gives you another metric to look at
21:09:08FromGitter<krux02> But it is just a complete random guess
21:09:38dom96Creating something that measures this is on my todo list in fact
21:09:44FromGitter<krux02> dom96: message frequency is good, but then you can only compare nim to nim, not to other languages
21:10:07FromGitter<krux02> dom96: at least there is still the chat log
21:10:12FromGitter<ZarsBranchkin> Heh, recently had to start using pascal(or delphi, not even sure). Was pleased to see some similarities to Nim, like variable type declerations at least
21:10:12Araqoh they fixed it. now only Delphi/Object Pascal is listed
21:10:22FromGitter<krux02> so you are able to track back to when the first chat was logged
21:10:26*rbrt quit (Quit: Slán agat)
21:10:37PMunchYeah I was thinking about parsing the irclogs for new nicks and such to get some cool metrics
21:11:14FromGitter<krux02> yes, but then you need to parse the user from the bridges as well correctly
21:11:33FromGitter<krux02> some regular expressions to the win
21:11:57dom96krux02: Why only Nim to Nim?
21:12:09Araqkrux02: "Delphi to Pascal is like C++ to C" that is correct but everybody made the switch
21:12:19dom96I could join channels dedicated to other languages and start collecting metrics
21:12:46FromGitter<krux02> yes that is true, but not all other languages have "official" channels
21:13:13FromGitter<krux02> the imporance of the channel in other languagas is just much different
21:13:44FromGitter<krux02> so I don't think you can compare it
21:14:24Araqthe truth is: our docs and the search feature are so good that most don't use google or stack overflow nor #nim. and they all develop commercial closed source products
21:14:52FromGitter<jaco60> :)
21:15:06Araqso we think nobody uses it when in reality entire civilizations now depend on it ...
21:15:15GitDisc<treeform> Araq, is that true?
21:15:20dom96krux02: I think there is plenty of official channels to compare to: #rust on Mozilla's IRC network and #crystal-lang as an example.
21:15:36GitDisc<treeform> because that is what I am doing...
21:15:37dom96#d seems pretty official too
21:15:55FromGitter<jaco60> just compare SO channels, too
21:15:56Araqtreeform: nah, I think I live in my own universe
21:16:04PMunchWe should create a IRC -> Stack Overflow bot to get some more traffic going :P
21:16:33PMunchAny message by a new user followed by a question mark automatically gets added to Stack Overflow with the #nim tag
21:16:34GitDisc<treeform> I think stackoverflow as a good place before, now its too full of crap.
21:16:48*athenot quit (Ping timeout: 255 seconds)
21:16:54PMunchI still use it when I google for things. Lot's of good answers on there
21:17:04PMunchBut I almost never ask questions there
21:17:10GitDisc<treeform> I end up there less and less.
21:17:15*PMunch quit (Quit: leaving)
21:17:29GitDisc<treeform> and when I do end up its not very useful anymore.
21:17:42FromGitter<ZarsBranchkin> Same, I have never asked question on stack overflow yet, but it has given me answers most of the time
21:18:09*athenot joined #nim
21:20:26FromGitter<jaco60> (https://files.gitter.im/nim-lang/Nim/Ryao/b_1_q_0_p_0.jpg)
21:20:41FromGitter<jaco60> The new bible of IT students
21:21:17GitDisc<treeform> Araq, do you think nimscript can be used as a scripting language sort of like lua or more like AngelScript? I did not find a way to included as a library or eval strings or files? Or expose compiled things to it?
21:22:03dom96treeform: nimble does this, and there is even a package that exposes a nice API for it IIRC
21:22:28GitDisc<treeform> I did not find it, I was poking around vm.nim it looks like thats where it lives.
21:23:16GitDisc<treeform> is this it? https://github.com/Serenitor/embeddedNimScript
21:23:26GitDisc<treeform> I guess I was looking for some thing inside the compiler or stdlib.
21:23:30GitDisc<treeform> but if this works it works
21:23:48dom96yeah, I think this is it
21:25:06FromGitter<krux02> I recently got over 500 points on stack overflow for a single answer I gave.
21:25:10Araqhttps://github.com/Araq/nimedit/blob/master/api.nim#L131
21:25:18Araq^ treeform
21:25:24FromGitter<krux02> But I too think stack overflow became worse
21:26:03FromGitter<krux02> it was a nice place to get answers, and often it still is, but when you ask a question, be warned it will be closed down in no time and tagged as not constructive.
21:26:23FromGitter<krux02> and the people who tag you are also pround and get achievements for doing that
21:27:04Araqbtw somebody could work on NimEdit... ;-)
21:27:20FromGitter<krux02> Worst thing I had was, I was writing an answer to someone and while I wrote it the question was closed because it is "not constructive" and I was not able to give this person the answer.
21:27:52FromGitter<krux02> Araq: well I like nim, but to be honest, not everything needs to be written in Nim
21:27:57GitDisc<treeform> Araq, I written my own editor about 4 years ago, I don't need another one.
21:28:20Araqkrux02, blasphemy :P
21:28:22GitDisc<treeform> Araq, it looks like that will get me started on embedding it.
21:28:24FromGitter<krux02> treeform: what does it do?
21:28:58GitDisc<treeform> krux02, the only really good property it has, is I know how it works. I don't recommend it.
21:29:00dom96I wrote my own editor too :P
21:29:04Araqwell I'll extract some useful libraries from NimEdit, maybe.
21:29:12dom96Araq: Yeah, you should.
21:29:21dom96or improve embeddedNimScript
21:29:30dom96treeform: do try out embeddedNimScript if you can
21:29:47dom96It's good to use these libraries instead of copying and pasting custom code all the time
21:30:42FromGitter<krux02> is embeddedNimScript like python?
21:30:54GitDisc<treeform> All I really want is: load scripts, run scripts, expose compiled code to them, have a repl, and maybe break on errors and set breakpoints.
21:31:17GitDisc<treeform> embeddedNimScript does not do break on errors and set breakpoints, but maybe that can be hacked in.
21:31:41Araqneeds some VM additions
21:31:46Araqbut can't be hard
21:33:14GitDisc<treeform> I like the AngelScript model where you write what kind of looks like C++, so if you decided to port it to compiled code it is easy.
21:33:26GitDisc<treeform> Another idea is just to ship the game with a nim+c compiler as well?
21:33:31shashlickdom96: is it possible to get the output of an exec command in nimscript
21:34:12FromGitter<krux02> isn't that the return value?
21:34:21dom96Doesn't look like it https://nim-lang.org/docs/nimscript.html#exec,string
21:34:43Araqtreeform: let make this clear: NimScript is Nim. modulo the VM's restrictions. it uses the same syntax, the same static type system, the same macro system, etc etc
21:34:46dom96I'm still a proponent of removing this nimscript thing and making the ordinary procedures work in nimscript
21:34:56dom96s/nimscript thing/nimscript module/
21:35:09Araqhmm?
21:35:51dom96just define osproc.execCmdEx for the VM
21:37:40Araqyeah, another thing we should have done for 0.18 :P
21:37:47Araqoh wait
21:37:53Araqwe have staticExec()
21:38:19dom96huh? So you agree now that we shouldn't have a specific module dedicated to nimscript?
21:38:27Araqno.
21:38:40AraqI agree we need something like execCmdEx
21:38:50Araqbut it turns out we already have.
21:39:18shashlickdoes staticExec work in nimscript
21:40:38Araqtry it :-)
21:42:07Araq"If you are reading this you are missing nimblepkglist.js or have javascript disabled in your browser."
21:42:12Araqnope...
21:43:26dom96It's time to just remove this and link to https://nimble.directory
21:43:37shashlickhow do you get the package name within nimble
21:44:01dom96`packageName`
21:44:04dom96possibly
21:44:06Araqpackages?callback=gotPackageList:1 Uncaught ReferenceError: gotPackageList is not defined
21:44:06Araq at packages?callback=gotPackageList:1
21:44:23Araqwhy not fix that "callback"?
21:44:33Araqwhy is it broken anyway?
21:44:44dom96because it has been freezing my browser since forever
21:44:47dom96and many other's too
21:45:11shashlickdom96: packageName is blank in the after install
21:45:51dom96shashlick: :/
21:46:03shashlicki'm installing from local dir, not sure if that matters
21:47:20dom96No idea
21:47:38*Vladar quit (Quit: Leaving)
21:50:46Araqdom96: so ... you intentionally disabled it?
21:50:56dom96Araq: no?
21:51:01dom96No idea why it's broken
21:52:26dom96Does c2nim support objective C?
21:54:16shashlickgot it working - staticExec() works thankfully, but have to hardcode packageName in .nimble file
21:55:47dom96oh cool, Nim is #2 on this: https://www.slant.co/topics/6032/~systems-programming-languages
21:57:09shashlickugh, but now I am upsetting nimble - Cannot completely remove C:\Users\gt.nimble\pkgs\nimkerberos-0.1.0. Files not installed by nimble are present.
21:57:28Araqdom96: no to Objective C.
21:58:10dom96Araq: :'(
21:58:24shashlickso I have to use before install, which means nimble needs to be fixed
22:20:24dom96Maybe it's time to add libclang support to c2nim? :)
22:23:04*Ven`` joined #nim
22:25:44shashlickdom96: so if I push a fix to nimble, does it get pulled by koch tools?
22:32:01*smt joined #nim
22:44:00FromGitter<cabhishek> Hi everyone, I think this is a bug in `AsyncHttpClient`: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Running above code results in `Exception message: Connection was closed before full request has been made` error. Just to compare, equivalent async python code runs fine. [https://gitter.im/nim-lang/Nim?at=5aa1bcaf6f8b4b9946059324]
22:52:39*douglascorrea quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:56:57shashlickdom96: running nimble test doesn't do anything - I have a tests\testkb.nim and it doesn't run anything
23:02:32*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:04:51FromGitter<zacharycarter> dom96, araq: I see why you guys use nimscript as configuration now :D I'm re-writing FRAG and going to write an editor this time - I'm using nimscript as configuration for things like shaders etc
23:10:03FromGitter<zacharycarter> With the macro I can write code like - ⏎ ⏎ ```add("bar")``` ⏎ ⏎ :D [https://gitter.im/nim-lang/Nim?at=5aa1c2cbf3f6d24c6852a9a7]
23:11:41Araqcabhishek report it on github please
23:12:09*Trustable quit (Remote host closed the connection)
23:12:17Araqshashlick: koch tools uses the latest nimble if you have a .git dir, aka have a Nim from git
23:12:43*MJCaley quit (Quit: MJCaley)
23:15:49*douglascorrea joined #nim
23:28:05noonienhow can i see the called compiler/linker commands using nimble?
23:30:07noonienalso, does nim have a proc main?
23:30:08FromGitter<zacharycarter> not sure that you can
23:30:25FromGitter<zacharycarter> no
23:30:45FromGitter<zacharycarter> isMainModule will be set to true when the module being invoked is the main module
23:31:04FromGitter<zacharycarter> so you can write
23:31:29FromGitter<zacharycarter> ```proc main() = ⏎ echo "foo" ⏎ ⏎ when isMainModule: ⏎ main()``` [https://gitter.im/nim-lang/Nim?at=5aa1c7d1c3c5f8b90d4d62b6]
23:31:46FromGitter<zacharycarter> or just call `main()` without the check if you don't care about it
23:32:22FromGitter<zacharycarter> regarding the nimble question - ask dom96
23:32:38noonieni'm just wondering if there's a reason to create a main proc in nim
23:32:42dom96noonien: try --verbose or --debug
23:32:55FromGitter<zacharycarter> yes there is - there's a performance benefit apparently
23:33:00FromGitter<zacharycarter> to having a main function
23:33:18FromGitter<zacharycarter> there's also a performance benefit to using the inbuilt result variable, rather than declaring and returning your own
23:33:34nooniendom96: i tried both, none output the compiler/linker command
23:34:33noonieni'm guessing not declaring a main function makes all declared variables global
23:34:47*littleli joined #nim
23:34:51dom96noonien: hrm, try `nimble c --verbosity:3 file.nim`
23:34:55FromGitter<zacharycarter> dom96: I'm thinking that knowledge about the VM needs to more prominent - game devs love this kind of stuff
23:35:15FromGitter<zacharycarter> the fact that I can execute code inside a configuration file is huge
23:35:41nooniendom96: nimble or nim?
23:36:11nooniennim shows me calls to gcc, so that appears to work
23:36:48dom96noonien: both should work
23:37:08noonienoh, my bad, nimble c works as well
23:37:32Temperance[m]I've been trying with a friend, to write a game engine in c++, the guy is relatively good with shaders but he isn't in c++
23:37:56FromGitter<zacharycarter> using what rendering API?
23:38:06Temperance[m]I expected him to design the shaders and all the stuff, and I told him I would provide him the rest for wathever visuals he dreamed to make.
23:38:21FromGitter<zacharycarter> I've written a couple of game libraries in Nim - but I'm re-writing the first one now.
23:38:44FromGitter<zacharycarter> http://fragworks.io/ and https://github.com/zacharycarter/zengine
23:38:55Temperance[m]But we have had lots of problems, he has problem with c++
23:38:56Temperance[m]I wanted to go with opengl
23:39:01Temperance[m]Vulkan is still too green and too difficult for me to consider it.
23:39:16nooniendom96: hmm, from what i can tell, only the linker call is shown
23:39:20Temperance[m]I'm thinking that with how easy is to build nim projects, It might be a good idea to do the c++ parts on separate files and just use nim as glue.
23:39:28FromGitter<zacharycarter> that's why I'm going to be using bgfx again
23:39:38FromGitter<zacharycarter> why do you need C++?
23:39:38dom96noonien: try removing nimcache :)
23:39:41Temperance[m]I have to study nim more, but if I can take out cmake out from the equation It will be a definitive win.
23:39:49noonieni did, no change
23:40:04noonienthe cache and the binary
23:40:28FromGitter<zacharycarter> Temperance[m]: you don't need c++ :D just bind to it
23:40:59dom96noonien: in that case I'm out of ideas, Araq?
23:41:18Temperance[m]Knowing how to be efficient is something that is learned. You have to have powerful tools, you have to be able to relate asm to code easily, you have to be able to use intrinsics.
23:41:25Temperance[m]even if nim provided all that stuff, (and I have some problems debuggining yesterday) those are things that would probably take me a little bit of too much time relearning to do in nim.
23:41:28noonienfrom what i can tell, the commands are comments in the generated .c files
23:42:02FromGitter<zacharycarter> ah I see what you mean by glue code now - yeah I mean most frameworks I've written have leveraged several C/C++ libraries
23:42:29FromGitter<zacharycarter> for instance - http://fragworks.io/ - uses https://github.com/bkaradzic/bgfx for the rendering API
23:42:36FromGitter<zacharycarter> and the new iteration of frag will too
23:43:45Temperance[m]Still, several things in nim seemed really attractive, and the fact that the garbage collector can be deactivated, and yes, several c++ libraries could be reused, makes me think nim unlike other modern languages, has a little bit of tought probably put into making people like me not so unhappy.
23:43:48noonienTemperance[m]: hehe, sucky build systems is one of the reason i'm trying to switch to nim as well
23:44:08noonienthat and the '70s preprocessor
23:44:43Temperance[m]It took me half a year to learn cmake, and I still am not sure I fully grasped it. I can't pretend to work with other people in c++ if they don't know how to deal with a tool that is HARDER to use than the language it is supposed to build.
23:45:01FromGitter<zacharycarter> I prefer premake
23:45:14noonienyeah, all build systems seem to invent a new DSL
23:45:23noonienwhen the real problem, imho, is within the language
23:45:24Temperance[m]I tried it, seemed simpler, but didn't like it.
23:45:26FromGitter<zacharycarter> and generally use - https://github.com/bkaradzic/GENie - if I"m using C++
23:46:36FromGitter<zacharycarter> https://github.com/bkaradzic - has kind of tamed the C++ world for me, via studying his code
23:47:06FromGitter<zacharycarter> at least in terms of producing portable and easy-to-read C++ code
23:47:35Temperance[m]-> this was written by him, and it kinda is my bible https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b
23:47:48FromGitter<zacharycarter> yeah! that is a great read :D
23:47:54nooniensure, the problem isn't that you can't write good code. the problem is that c/c++ preprocessors are so bad it's really hard to trust anyone not to take "shortcuts"
23:48:27Temperance[m]To be honest, I only use c++ for 3 or for features. However, Most likely nim already covers said problems.
23:49:01nooniena good module system would probably not cause c/c++ to need such convuluted build setups
23:49:19Temperance[m]I would code plain C if it weren't for how hard is to search for "plain C" results, thanks to c++ having the same name, and for namespaces. I really don't like endless names you get in C
23:50:23Temperance[m]that being said. I think .h files have extra uses, It's nice to have already done a list of the functions in some part of your code.
23:50:36Temperance[m]The last part I mean it about modules and stuff.
23:54:19nooniendo you think they're worth all the hassle you have to put up with to setup a complex enough build system to build your, and others' code?
23:58:20*MJCaley joined #nim
23:58:33Temperance[m]I don't think at all they're worth the hassle we have to put with. That being said I'm not sure headers had to be completely related to all those hassles either. C/C++ compilation workflow is a complete mess, and while yes, headers feel redundant, even if you didn't need headers, C/C++ would still be a pia to compile.