<< 07-03-2017 >>

00:18:57*handlex joined #nim
00:26:53*rauss joined #nim
00:27:33*handlex quit (Quit: handlex)
00:39:29*chemist69 quit (Ping timeout: 240 seconds)
00:42:16*chemist69 joined #nim
00:44:13*PMunch quit (Quit: leaving)
00:55:08krux02meh: http://ix.io/ozv
01:01:58krux02ok don't worry, I got it working
01:09:29*byte512 quit (Ping timeout: 259 seconds)
01:15:55*krux02 quit (Quit: Leaving)
01:17:50zachcarter:D
01:46:08*zetashift joined #nim
01:48:57*zetashift quit (Client Quit)
01:50:07libmanI started working on http://www.libman.org/nim/download/index.html but it's still crap. Haven't had the time to make it good yet.
01:56:48SusWombatWhen i need the same custom type in different modules, should i import it somehow? or declare it in each of the files?
02:13:59*mwbrown joined #nim
02:28:02zachcarterSusWombat: declare it in a common module and then import that module into whatever other modules need it
02:28:14SusWombatzachcarter, okay ty
02:28:18zachcarternp
02:28:40zachcarterSusWombat: you can use * to export symbols
02:28:56zachcarterin other words, make that symbol visible to other modules
02:29:43SusWombatyeah
02:47:04*jabb quit (Ping timeout: 260 seconds)
02:55:35*chemist69 quit (Ping timeout: 264 seconds)
03:09:16*chemist69 joined #nim
03:13:23*jabb joined #nim
03:16:08*vlad1777d quit (Remote host closed the connection)
03:35:53*BitPuffin|osx quit (Ping timeout: 246 seconds)
03:45:41*Serenitor quit (Read error: Connection reset by peer)
03:45:47*Serenit0r joined #nim
03:52:23*def-pri-pub joined #nim
03:52:23*def-pri-pub quit (Changing host)
03:52:23*def-pri-pub joined #nim
04:07:42*def-pri-pub quit (Quit: Lost terminal)
04:48:49*mwbrown quit (Ping timeout: 260 seconds)
04:50:59*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:58:58*djellemah quit (Ping timeout: 240 seconds)
05:18:34*djellemah joined #nim
05:19:34*zachcarter quit (Quit: zachcarter)
05:45:16*rauss quit (Quit: WeeChat 1.7)
05:52:16*yglukhov joined #nim
06:03:36*yglukhov quit (Ping timeout: 240 seconds)
06:18:17*Kingsquee quit (Ping timeout: 246 seconds)
06:18:56*kokozedman joined #nim
06:19:29kokozedmanhey guys, trying to debug on macOS El Capitan, using VSCode + Native Debugger
06:19:45*rauce quit (Ping timeout: 268 seconds)
06:19:47kokozedmandebuggin works with --debugger:native, but the variable names are so mangled, it has nothing to do with the original
06:19:52kokozedmanhow can I solve this
06:20:13kokozedmanor, is there something other **better** approach to debugging these days?
06:20:16*Kingsquee joined #nim
06:22:40*rauce joined #nim
06:39:34*nsf joined #nim
06:41:43Araqkokozedman: it's always variablename_HASH
06:41:57Araqso much for "nothing to do with the original"
06:42:27Araqsecondly, most local vars are not mangled at all
06:48:36*ftsf quit (Quit: :q!)
06:56:07kokozedmanAraq: I believe what you say, but not sure why I'm getting these... let me show this: http://pastebin.com/9Pfzm567 .. I'm using 0.16.0 on macOS, installed from brew
06:56:23*bjz joined #nim
06:56:28Araquse nim devel
06:56:52kokozedmanah, ok. Thanks
06:56:54Araqoh and write a plugin that reads in the produced .ndi files (in nimcache)
06:57:14Araqthe name mapping are stored in .ndi files, debuggers can make use of it (but don't)
06:58:54kokozedmanI've been busy with some other things in the past year, so, there are a lot of things that I missed. It's now the first time I hear about this .ndi file
06:59:01*chemist69 quit (Ping timeout: 260 seconds)
06:59:24kokozedmanbut, it's a great progress from ENDB
07:00:57*libman quit (Quit: Connection closed for inactivity)
07:10:04*Vladar joined #nim
07:15:20*rokups joined #nim
07:19:43*Nobabs27 quit (Quit: Leaving)
07:23:06*kunev_ quit (Ping timeout: 240 seconds)
07:24:53*kunev joined #nim
07:25:40*chemist69 joined #nim
07:29:51*zachcarter joined #nim
07:32:44*couven92 joined #nim
07:55:19*byte512 joined #nim
07:59:11*rauce quit (Ping timeout: 264 seconds)
08:05:12*rauce joined #nim
08:09:11*gokr joined #nim
08:10:25*jonathon joined #nim
08:12:13*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:14:53Calinouhttps://github.com/nim-lang/Nim states there's ARMv6 support, how good is support for more modern ARM (namely ARMv7 and ARMv8 which is 64-bit)?
08:16:00*bjz joined #nim
08:17:04AraqCalinou: everything works? not sure.
08:17:22Araqthere is little CPU specific stuff in Nim
08:18:14*Andris_zbx joined #nim
08:22:19*brson quit (Quit: leaving)
08:25:10*zachcarter quit (Read error: Connection reset by peer)
08:25:28*rauce quit (Ping timeout: 240 seconds)
08:25:31*zachcarter joined #nim
08:29:42*zachcarter quit (Client Quit)
08:42:48*rauce joined #nim
08:55:38FromGitter<vegansk> @Araq, hi! PR https://github.com/nim-lang/Nim/pull/5490 is ready
08:56:30FromGitter<vegansk> Thanks :-)
08:57:53*brson joined #nim
08:59:42*brson quit (Client Quit)
09:08:49*kokozedman quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
09:25:31*onionhammer quit (Ping timeout: 240 seconds)
09:25:50*onionhammer joined #nim
09:36:31jonathonany ideas why `nimble install aporia` results in a 0-byte aporia executable after it has been copied to the destination dir? it has built correctly and is present in the temporary dir before that...
09:37:14jonathondisk space is fine, all other files copy correctly, it's just the aporia executable
09:43:28*Lord_Nightmare quit (Ping timeout: 240 seconds)
09:45:57*Lord_Nightmare joined #nim
09:53:24*kokozedman joined #nim
09:57:08Araqjonathon: no idea, worked for me the last time I installed it
09:58:42jonathonyeah, it worked under Arch but not under Ubuntu... it's probably just a weirdness on this PC
10:11:51*Arrrr joined #nim
10:11:51*Arrrr quit (Changing host)
10:11:51*Arrrr joined #nim
10:19:13*Arrrr quit (Ping timeout: 260 seconds)
10:28:13*Arrrr joined #nim
10:33:14dom96jonathon: bug in Nimble 0.8.2
10:33:21dom96Nimble 0.8.4 doesn't have this problem
10:35:07jonathonah ha
10:35:23jonathonguess which version i have :) (it's 0.8.2)
10:40:58ArrrrMmm, i had that version too.
10:41:22ArrrrBtw, why is getContent(string) deprecated?
10:41:33ArrrrEven nimble uses it
10:42:03dom96because you should create a newHttpClient and call its getContent proc
10:43:02ArrrrBut why? Couldn't it be an optional arg and check for nil?
10:43:46ArrrrNot that it really changes much, i'm simply curious
10:44:19Araqproc getContent(s: string): string = newHttpClient().getContent(s)
10:44:23dom96because you need an object to implement keep-alive
10:44:30Araq^ no need to deprecate it, IMO
10:44:36Araqjust change it's implementation
10:44:55Araqinstead of telling people to write 2 lines of code where 1 was enough
10:45:30Araqdom96: what if I don't care about keep-alive :-)
10:45:54Araq*its, damn
10:46:11Araqmaking the same mistakes as a native speaker, sucks
10:46:12dom96Come on. 2 lines is hardly a lot.
10:46:28jonathon`nimble install nimble` -> $HOME/.nimble/pkgs/compiler-#head/compiler/commands.nim(60, 16) Error: cannot open '../doc/basicopt.txt' ... ?
10:46:56dom96Araq: If you want to decrease the number of lines to do something then make parsecfg nicer.
10:47:34Araqfalse dichotomy.
10:48:36dom96Nope.
10:49:02Araqparsecfg is very nice, it's just that you don't understand its design. :P
10:49:34ArrrrI have seen getContent(str) implemented in other languages (python maybe?). What's the issue with keep-alive?
10:49:51dom96Araq: I could say the same thing about httpclient
10:50:17Araqyou could, but you would be wrong.
10:51:14Araqbut back to the original point: https://nim-lang.org/docs/apis.html
10:51:22Araq" Ease of use is measured by the number of calls to achieve a concrete high level action."
10:51:44Araqthis is a clear indication we should keep getContent()
10:52:50jonathonoh, the debian package doesn't install the nim source 'doc' directory anywhere...
10:53:38dom96Arrrr: I don't think it's implemented that way in Python.
10:53:55dom96Araq: Having a procedure that takes hundreds of parameters is bad design.
10:54:06Araqno it's not.
10:54:19Araqmoving the parameters into an object is just that. a move.
10:54:31Araqit doesn't change the quality of the design.
10:55:05AraqNim supports named arguments for this design.
10:55:50Araqin any case, getContent already exists
10:56:16dom96Yes, but soon it won't.
10:56:27AraqI only argue to keep it, not that it was the "best" design.
10:56:36dom96It's already deprecated.
10:56:42Araqde-deprecate it.
10:56:43dom96Its fate has been sealed.
10:56:55Arrrrhttp://rosettacode.org/wiki/HTTP#Python
10:57:05ArrrrIt looks a bit close.
10:57:12Araqso, everybody needs to pointless update his code and these 2 lines pop up everywhere.
10:57:18ArrrrGo returns an optional
10:57:32Araqthat's like embraced code duplication
10:57:56dom96The new design encourages efficient usage.
10:58:10Araqthe old design was about convenience.
10:58:26ArrrrI don't think requiring httpclient object for complex task is bad, but i would trust default args for 99% of cases
11:00:38Araqhow does it encourage efficient usage? I bet the nimble patch will just replace 1 line by 2 lines everywhere.
11:01:13Araqit's hard to keep the client object around, and when you use a global for it, you lose .gcsafety
11:01:52dom96Fine. But this is where you're wrong, you will need a global.
11:02:14dom96If you create a new http client for every request then that's obviously not efficient, is it?
11:02:47dom96and then what should we support by default? the synchronous or asynchronous one?
11:02:55dom96or should we have getContent and getContentAsync
11:03:08Araqyeah, but this thing returns the contents as a potientially long string. it's clearly inefficient, but convienent
11:03:36Araqyou're right the version that takes a client object is much more useful.
11:04:01Araqbut for the common throw away case, it's not as convenient as the old one.
11:04:02dom96Fine.
11:04:21dom96But by this logic a hell of a lot more things in the standard library should be made more convenient
11:04:32dom96parsecfg and parseopt especially
11:06:49enthus1astwhy not redefine getContent to use the new style internally and also define an getContent for the object?
11:07:01Araqenthus1ast: that's what I argued for.
11:07:40Araqparsecfg and parseopt are fine, what's lacking is a stdlib macro to write string cases without the duplication
11:07:53Araq"foobar": x.foobar = true
11:08:12Araq"xyz": x.xyz = false
11:08:38ArrrrIt could accept a case object
11:08:45dom96what's missing is the ability to write: parseCfg()["key"]
11:08:55ArrrrI use enums for parsing cfgs and args
11:09:03*bjz_ joined #nim
11:09:14Araqno, that's worse design. no protection against typos in the "key" part
11:09:17dom96I hate having to define my own config objects every time I parse a config
11:09:30Araqno type safety, no thanks.
11:09:53Araqalso parseCfg has something that gives you an OrderedTable back
11:10:04Araqwas a recent addition though.
11:10:18Araq(and I think it's bad design.)
11:10:33*bjz quit (Ping timeout: 260 seconds)
11:10:39enthus1astoh by the way, does OrderedTable lack a way to retreive multiple keys? : )
11:10:44ArrrrIt is the only way to get section-agnostic keys.
11:10:46dom96So... json isn't type safe either.
11:10:51Araqyes.
11:11:01kokozedman:)
11:11:26dom96I prefer convenience in this case.
11:11:32dom96Just like I prefer convenience with json.
11:11:50dom96There is a reason I dislike Go and Haskell's approach to reading JSON
11:12:28dom96It's the same reason I feel like I am wasting my time writing the same damn parsing case statement for parseopt and parsecfg every time I have to do it
11:12:54*vlad1777d joined #nim
11:13:07kokozedmanI think efficiency is key, but convenience is always a good value. If we can have convenience while having efficiency, that would ideal. They are not mutually exclusive.
11:13:30Araqenthus1ast: values() iterator?
11:13:33kokozedmanBut in this day an age, efficiency is more important. Scaling is always a concern.
11:13:41Araqer, keys() iterator, I mean
11:13:41kokozedmanMostly
11:14:23Araqkokozedman: lol what? I think the fact that computers stopped getting faster doesn't mean they are suddenly too slow for parsing config files :-)
11:15:25kokozedmanAraq: I'm not sure about the depth of the discussion, but I seem to understand something about inefficient HTTP client
11:15:33Araqdom96: fair enough to request this feature in parsecfg and parseopt, I will accept PRs
11:15:45federico3in the case of config files speed is not important, type safety is.
11:16:05Araqbut I personally will always use the style that doesn't use dictionaries everywhere.
11:16:08dom96Araq: good
11:16:10kokozedmanconvinience will draw people to use the API (whether it is efficient or not)
11:16:37kokozedmanyou expose an inefficient API, people will use it, and a lot of time without knowing that it's not efficient
11:16:48federico3OTOH, when parsing JSON, having "unstructured" access is very useful, both when exploring some new contents or to be able to ignore extra fields
11:16:53kokozedmanin those cases, warnings or deprecations are in order
11:16:59Araqthat said, JSON is messy and comes from external sources, so it can be hard to enforce type safety. config files and command line args are more under your control.
11:17:46federico3but we can have a typed JSON parser/converter when better efficiency is needed, why not?
11:18:04AraqI think there is a way to transform the json into a typed object
11:18:17Araqbut I am not familiar with json.nim
11:18:24Araq*not that
11:18:59dom96I'd be happy with a macro that takes a type and parses the config automatically
11:19:11federico3I think you can, with to[] , but it's probably not efficient
11:19:25dom96Which would give you type safety and more convenience
11:19:37federico3+1 dom96
11:19:49dom96The `to` proc is for marshalling and unmarshalling
11:20:27dom96I don't think we can assume that it will always use the JSON format
11:20:49dom96(I bet many people are using it like that though)
11:20:56federico3yes
11:21:19federico3perhaps the json module should have [un]marshalling procs that will always use JSON
11:21:32dom96yes
11:21:35Araqyeah json.nim should have a 'to'
11:23:00Calinoufirst PR on Nim :)
11:23:04Calinou(it's just a typo fix)
11:28:36*PMunch joined #nim
11:33:02*yglukhov joined #nim
11:36:49kokozedmandom96, Araq: in Golang, people are encouraged to re-use the HTTP client (for efficiency), and when you http.Get(...) it also re-uses a default http client. I don't think getContent() does this, and the many use of it will create a very inefficient program; talk about people from Go moving to Nim, which can be quite a number as people using Go are p
11:36:50kokozedmanroperly looking for more interesting language alternatives. If you ask me, it's good that getContent() gets deprecated. getContent() doesn't adhere to the "efficient" value that is marketed about Nim.
11:37:26kokozedmanprobably*
11:37:59dom96kokozedman: Yes, that was why getContent was deprecated. But Araq wants it to be reimplemented in the same way you described Go's implementation.
11:38:16Araqagain, it returns a 'string', not a stream, so it never was about efficiency, IMO. ymmv.
11:39:15euantorRegarding Json serialization/deserialization, I really like Rust's Serde approach: https://github.com/serde-rs/serde
11:39:34Araqthe efficient way is async+streams and if you like to encourage that, don't offer a getContent that returns a string.
11:40:02euantorI can imagine a similar thing for Nim that allows you to just add a pragma to an object and have it generate code at compile time to create functions to serialize/deserialize
11:40:41Araqbut this only means people will write their own wrapper that collects everything into a string in the application code because it's more convenient.
11:40:57kokozedmanwhy don't we just put a better recommendations like that on documentation? I mean, clearly, people who are going to use getContent() have no clue what's behind, but we do
11:41:19kokozedmanthese puts a tremendous value to the language to people who are really looking for "efficiency"
11:42:13Araqbetter docs are always worthwhile, but "we made this hard to encourage efficiency" doesn't work IMO.
11:42:39Araqit's really the same in osproc
11:42:48Araqwe have procs that return the output as a string.
11:43:20PMunchI mean, if I want to write a simple script to crawl a site for an update for example then performance doesn't really matter and getContent would be plenty good for those purposes
11:43:38Araqand as a library user I often know better. like "yeah, I know, but I'm calling GCC which is known to produce a small amount of output"
11:43:48PMunchSo getContent certainly has a spot as a convenience function
11:44:05*vlad1777d quit (Remote host closed the connection)
11:44:30Araqlikewise I can imagine "yeah I know, but this URL produces small websites"
11:44:33kokozedmanPMunch: curl is very script-friendly ;-)
11:45:02PMunchkokozedman, that's besides the point though
11:45:18Araqmaybe every string should be an async stream though.
11:45:50Araqbut this is more a design for a higher level language, in systems programming the split "small data" vs "big data" is everywhere.
11:45:58PMunchCurl is great, but the topic isn't "how would I do X" but rather "how would I do X in Nim"
11:46:19kokozedmanso, an indication to the more efficient approach should be mentioned in those cases ... so it stays convinient to those who need it, and provides needful insight for those getting the wrong idea to use it everywhere
11:47:29PMunchYeah, the docs could be written ta state "getContent is a simple template/wrapper around the aforementioned async stream methods of retrieving data"
11:47:33PMunchOr something similar
11:48:16kokozedmanPMunch: well, I certainly won't consider writing a Nim program as writing a small script. If I use Nim, I know I'm going to be doing something bigger than just a mere script will do. But that's just me.
11:48:34PMunchMaybe drop a line like "if any kind of performance or robustness is expected getContent should be avoided"
11:48:44kokozedmanand same goes for other folks I think
11:48:58kokozedmanPMunch: yes, that's a good line
11:49:07PMunchWell, I've started writing short Nim programs instead of Python scripts
11:49:07*elrood joined #nim
11:50:00PMunchMost things can be done just as easily in Nim as in Python and with Nim you get a performance benefit as well
11:50:08kokozedmanGood for you. Well, for my use case, I use Nim mainly to write programs that will run for months inside OpenWRT routers
11:50:40kokozedmanand this is a nice proof of the diverse use-cases of Nim
11:50:50PMunchI guess this is just a testament to how versatile Nim really is :)
11:50:52PMunchYeah
11:50:54kokozedmanyou use it for mostly scripting, I use it for long running program
11:51:00PMunchWell, I use it for both
11:51:03kokozedmanIndeed
11:51:07PMunchOr pretty much anything
11:51:26PMunchWhat kind of OpenWRT scripts are you writing by the way?
11:51:57kokozedmanwhat I'm interested next, is the Javascript backend, like producing a server to client web application stack, where everything is written in Nim
11:54:10PMunchThat would be quite interesting
11:55:43PMunchThe problem I can see you facing there is the problem that most people wanting to write web-code is already familiar with JavaScript and having all the JavaScript snippets out there is great for code-reuse.
11:58:45Araqyou can use .emit for your copy&paste pleasures :P
11:59:00Araqin fact, my dochack uses it too
11:59:19PMunchOoh, that's a good point :)
12:02:11*bjz joined #nim
12:02:45*Snircle joined #nim
12:03:59*bjz_ quit (Ping timeout: 264 seconds)
12:04:16dom96Another thing we might want to beware regarding getContent: reimplementing getContent using HttpClient may have some subtle unpredictable results for people that are using it.
12:04:29dom96It's unlikely but you never know.
12:04:35*yglukhov quit (Ping timeout: 264 seconds)
12:04:58dom96So we must ensure that this is documented well.
12:15:24Araqsublte unpredictable results? :-)
12:15:26Araqlike?
12:18:40*vlad1777d joined #nim
12:21:33*arnetheduck joined #nim
12:22:39*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
12:22:45dom96no idea
12:23:07*zachcarter joined #nim
12:45:45*vlad1777d quit (Quit: Leaving)
13:09:59*Arrrr quit (Ping timeout: 264 seconds)
13:12:01*zachcarter quit (Quit: zachcarter)
13:17:31*gokr quit (Ping timeout: 240 seconds)
13:24:20*andris_ joined #nim
13:26:06*Andris_zbx quit (Ping timeout: 240 seconds)
13:26:39*Arrrr joined #nim
13:26:39*Arrrr quit (Changing host)
13:26:39*Arrrr joined #nim
13:30:06PMunchI'm trying to create a nimble package
13:31:00PMunchIt's a super simple, one file program that has a simple example file along with it. What would be the preferred folder structure for that? I can't get Nimble to shut up about misnamed files etc.
13:31:25*Arrrr quit (Ping timeout: 268 seconds)
13:31:55dom96SkipDir = @["examples"]
13:32:58PMunchThat's the preferred way?
13:33:24dom96Yes, at least until Nimble gets support for example files.
13:34:41PMunchHmm, that throws an error
13:34:57PMunchhttp://ix.io/oIk
13:35:22dom96SkipDirs?
13:36:04PMunchSame error
13:36:19PMunchAh, "skipDirs"
13:48:12*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:50:33*bjz joined #nim
13:53:02*zachcarter joined #nim
14:09:12*BitPuffin|osx joined #nim
14:19:32*mwbrown joined #nim
14:20:56*couven92 quit (Quit: Client disconnecting)
14:29:02*Arrrr joined #nim
14:29:02*Arrrr quit (Changing host)
14:29:02*Arrrr joined #nim
14:29:19*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:30:55PMunchJust pushed a little shebang script to the Nimble package repos: https://github.com/PMunch/nimcr/blob/master/docs/nimcr.md
14:30:56*ofelas_ quit (Read error: Connection reset by peer)
14:32:40*ofelas_ joined #nim
14:36:48FromGitter<Jeff-Ciesielski> I literally just pushed this up like a week ago: https://github.com/Jeff-Ciesielski/nimr
14:37:26FromGitter<Jeff-Ciesielski> Handles caching of build results / FFI / etc. We're all solving the same problem. The community should standardize on a solution
14:39:26*gokr joined #nim
14:40:27*chemist69 quit (Ping timeout: 256 seconds)
14:40:29Araqha. PMunch I like it.
14:41:34Araqnot sure it's a valid solution for Windows though, you don't want to attach "nimcr" to the .nim file extension so that the file is executed with this. Though that's what Python for Windows does, I think.
14:42:36PMunchJeff-Ciesielski: mine has the benefit of outputting the compiler error when it fails. And I prefer keeping the executable in the same folder but hidden so it doesn't need to be recompiled once every reboot for systems that has non-persistent tmp directories (but keeping the nimcache folder in tmp if you are writing the script and trying to run it multiple times).
14:42:50PMunchAraq, yeah I was wondering about that
14:42:55FromGitter<Jeff-Ciesielski> Mine also outputs the compiler errors :)
14:43:14AraqI also prefer 'sh file.sh' over 'chmod +x file.sh && ./file.sh' in general, but I guess that's just me
14:43:33PMunchJeff-Ciesielski, yours only outputs the error code, not the actual error message.
14:43:48PMunchAraq, well I think it depends on who you ask
14:43:56Araqoh and I also despise hidden files :P
14:44:07PMunchThe benefit of a shebang is that the file itself ships with the information on how to run it
14:44:16Araqthese are usually the first file I need to touch and tweak :P
14:44:40PMunchWell, the hidden file in this case is just the compilation output
14:44:51PMunchSo nothing to really tweak in there :)
14:44:52Araq(*cough* .nimble directory *cough*)
14:45:16AraqPMunch: "force rebuild" is "rm .hidden_binary" :P
14:45:27PMunchYeah I guess
14:45:34FromGitter<Jeff-Ciesielski> @PMunch....I'm not sure what you're referring to, running with mine most definitely shows the compiler error message. ```jeff.ciesielski:scratch> ./finally.nim ⏎ finally.nim(6, 5) Error: no return type declared ⏎ ```
14:45:36*chemist69 joined #nim
14:45:53FromGitter<Jeff-Ciesielski> Either way, inconsequential. There are now literally 5 of these floating around
14:45:53PMunchOr just change the file-time by writing something to it
14:46:56PMunchWait, it does? I'm looking at the source and I can't see any line that would show it (as long as --verbosity:0 does what I think it does)
14:47:09PMunchBut yeah, I agree, doesn't matter :P
14:47:23FromGitter<Jeff-Ciesielski> IIRC Verbosity:0 squelches hints and whatnot
14:47:37FromGitter<Jeff-Ciesielski> Errors still propegate
14:47:45PMunchHmm, that's the thing though. Mine gives you the entire output iff it fails
14:47:55PMunchSometimes the hints are actually useful
14:48:57AraqI don't mind adding a tool to 'koch tools', but dom96 may disagree
14:49:34PMunchHe doesn't like shebangs?
14:50:02Araqhe might think it shouldn't be part of the "core"
14:50:09FromGitter<Jeff-Ciesielski> Why not just a `nim -s` option?
14:50:15FromGitter<Jeff-Ciesielski> That sets sensible defaults
14:50:20FromGitter<Jeff-Ciesielski> for running as a script?
14:50:42Araqok, fine with me. PRs accepted.
14:53:22Araqbut IMO it should produce project/project.exe, remove the nimcache dir and not mess with hidden files or /tmp
14:53:50FromGitter<Jeff-Ciesielski> Seems reasonable.
14:54:57FromGitter<Jeff-Ciesielski> Though removing nimcache kills a lot of the speed benefit no?
14:55:02PMunchYeah
14:55:10PMunchI tested with a simple echo "Hello world"
14:55:22PMunchFirst compilation .5s
14:55:25Araqhu? the binary is kept.
14:55:29PMunchSecond compilation .1s
14:55:33Araqwhy would it matter
14:55:51FromGitter<Jeff-Ciesielski> I guess I'm not familiar with how the compiler tracks the dependency tree internally
14:56:03FromGitter<Jeff-Ciesielski> Does it check timestamps of binary vs source files?
14:56:05PMunchIt wouldn't really, but it's nice to have the cache if you need it
14:56:41PMunchThat's why I put it in /tmp so it would clean itself out but still be available if you say is tuning a value and running the script over and over
14:58:41PMunchAnd the rationale with the hidden file was that since most scripts create a single binary anyways it would be just as well to hide it (I keep a "scripts" folder on my machine with scripts for all sorts of things, it would quickly get cluttered if every script also created a folder with a single exe in it).
15:01:15Araqjeff-ciesielski: no it doesn't, it recompiles the world. the symbolfiles feature uses file hashes rather than timestamps
15:02:47PMunchFor example on my Surface Pro I run Linux. To allow it to have auto-brightness I have a script that reads the light sensor and controls the brightness by that. When I wrote the script I was constantly tweaking the curve of brightness and those parameters. Now it's just in a folder with my other scripts and I don't touch it. This is a Python script, but if I were to rewrite it in Nim I would want to keep nimcache while working on it (since it involves a lot of
15:02:47PMunchtweaking a number and rerunning) but don't care for anything but the script when I'm "done" writing it.
15:03:27AraqPMunch: it could use a shared nimcache/ in your /tmp then
15:03:28PMunchThat's why I put nimcache in /tmp and hid the binary output
15:04:00Araqby sharing it we try to ensure it doesn't take up too much space eventually
15:04:06PMunchAraq, oh yeah definitely. But I wasn't sure how well it handled sharing nimcache
15:04:08Araqfor systems that don't clean /tmp
15:04:48PMunchI've had weird issues before that got fixed by purging nimcache. So I wanted to keep them separate in case that would be an issue
15:05:16AraqI only know of the C++ <-> C nimcache issue
15:05:30PMunchAh, that might've been the one :P
15:05:42PMunchI was working with WxWidgets which is C++
15:05:44Araqwhich exists because we don't detect the .o file's origin
15:06:08Araqbut yeah, it's a good point. -.-
15:06:19Araqsharing could cause issues.
15:06:51PMunchIt could check for a nimcache-<anything but my own hash> and delete them?
15:07:14Araqdunno. sounds like we're then doing the OS's job
15:07:25PMunchYeah, that's a fair point..
15:07:41kokozedmandoes nimsuggest support --path:... parameter?
15:07:52PMunchI just dump everything I don't particularly care about to /tmp and hope for the best :P
15:08:24kokozedmanI have wrapped it in a bash script and add my path, but inside VSCode, the code using codes in the path are still marked as errornous
15:09:17PMunchFor simple scripts though nimcache isn't likely to grow much larger than a couple hundred kb so I don't think running out of space would be that big of an issue
15:10:39*kokozedman quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
15:15:20Araqkokozedman: VS Code doesn't use nimsuggest for checking, but 'nim check'
15:15:48*vlad1777d joined #nim
15:16:31*mwbrown quit (Ping timeout: 240 seconds)
15:22:57*yglukhov joined #nim
15:27:13*rauss joined #nim
15:37:39jonathondoes nimscript (or nim) have a finally() method or 'trap' similar to bash to make sure a command gets run before the program exits?
15:38:15PMunchdefer?
15:39:16AraqaddQuitProc
15:40:35*gokr quit (Read error: Connection reset by peer)
15:40:39*BitPuffin|osx quit (Remote host closed the connection)
15:41:26*BitPuffin|osx joined #nim
15:44:46jonathonah, defer led me to try/finally (same thing, different syntax) which works fine for what i'm after
15:46:42*brson joined #nim
15:48:49*jonathon quit (Quit: Doing something else... or rebooting)
15:57:49enthus1astAraq, dom96 please merge 5494 there is another one waiting on my finger tips.
15:58:57subsetparkAnybody have any experience with mainaining Arch packages? nim-git in AUR pulls from head, but it would be nice to have something pegged to the most recent release and nim is out of date and unmaintained
15:59:30PMunchsubsetpark, the nim package pulls from a given tag doesn't it?
16:00:16PMunchThis one: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/nim
16:00:37Araqenthus1ast: btw equality for Ordered Tables is hard. it should optionally ignore the order I think
16:01:11Araqbut oh well, this can be left for later. not sure if we need it
16:01:13*fvs joined #nim
16:01:13subsetparkPMunch: no idea (I have just become an Arch user as of this week), but that link does seem to indicate that
16:01:20PMunchOfficially it's stuck on 0.15.0, which is a shame. But you should be able to install it, and during installation edit PKGBUILD to change the pkgver :)
16:01:42PMunchOh right subsetpark, I'm using Manjaro which is based on Arch
16:01:57PMunchSo I'm installing from the same repositories
16:02:19subsetparkSurely we should be able to update the package then
16:02:49PMunchYeah, but it's maintained by a guy which appear to not care..
16:02:57PMunchI tried sending him an e-mail but no reply
16:03:28*couven92 joined #nim
16:03:39euantorCan you not fork the package in that case?
16:04:08PMunchTBH I'm not 100% sure how all that works
16:04:27PMunchBut I think you could potentially mark the package as orphaned, then request to adopt it or something..
16:04:34PMunchNot entirely sure
16:04:48subsetparkdom96: you are listed as a contributor - do you happen to have any insight on how to adopt/update the orphaned nim package on Arch?
16:16:58*krux02 joined #nim
16:24:16*Trustable joined #nim
16:42:42PMunchsubsetpark, I've requested the package to be adopted or dropped to AUR where someone else can adopt it
16:42:46PMunchSo now we wait :P
16:43:28subsetparkNice job!
16:47:21*GK___1wm____SU joined #nim
16:52:46*handlex joined #nim
16:57:17*GK___1wm____SU quit (Quit: jIRCii - http://www.oldschoolirc.com)
17:01:10*handlex quit (Quit: handlex)
17:05:07*gokr joined #nim
17:11:18*yglukhov quit (Remote host closed the connection)
17:16:02*deavmi__ joined #nim
17:16:46*andris_ quit (Remote host closed the connection)
17:20:54*deavmi__ quit (Quit: deavmi__)
17:31:43PMunchsubsetpark, the package has now got a new maintainer, a Levente Polyak. Hopefully it will be updated to 0.16.2 soon :)
17:45:29*jabb left #nim (#nim)
17:47:33*krux02 quit (Remote host closed the connection)
17:48:22subsetparkFast work!
17:49:10PMunchIndeed
17:50:29*brson quit (Ping timeout: 260 seconds)
17:56:31AraqPMunch: if only 0.16.2 would exist -.-
17:56:57PMunchOh right, 0.16.1
17:57:05PMunch:S Not sure where I got .2 from
18:01:55*brson joined #nim
18:05:47*gokr quit (Ping timeout: 264 seconds)
18:18:17*Trustable quit (Remote host closed the connection)
18:18:31*vendethiel joined #nim
18:21:17*rauss quit (Quit: WeeChat 1.7)
18:29:56*Ven joined #nim
18:31:26*vlad1777d quit (Quit: Leaving)
18:41:09*Ven quit (Ping timeout: 240 seconds)
18:49:47*Ven joined #nim
18:52:35*Ven quit (Read error: Connection reset by peer)
18:54:42*gokr joined #nim
18:55:39subsetparkIf ExcB is object of ExcA, then if I have try... except ExcB... except ExcA, the except ExcA will never catch if ExcB catches, right?
18:56:01*deavmi__ joined #nim
18:58:54PMunchHmm, I believe so
19:07:36*onionhammer quit (Read error: Connection reset by peer)
19:08:31*krux02 joined #nim
19:09:56*Ven joined #nim
19:18:35SusWombatIf i import the same module multiple times it sitll ends up only once in the binary right?
19:20:28krux02Well I am on an arch based distro, too
19:21:05krux02just saw the conversation is almost three hours ago, so never mind
19:21:48krux02SusWombat: yes
19:22:01*shashlick quit (Ping timeout: 240 seconds)
19:22:01SusWombatok thanks
19:22:27krux02I recommend you though to not make cyclic dependencies
19:23:36*shashlick joined #nim
19:24:16FromGitter<Varriount> cyclic dependencies are evil.
19:24:29FromGitter<Varriount> Or well, usually evil. Sometimes they can't be avoided.
19:25:09*Ven quit (Ping timeout: 240 seconds)
19:29:30*Ven joined #nim
19:29:46SusWombatcyclic dependencies?
19:34:07SusWombatanyone here using vscode?
19:34:33SusWombatcan i get the autocomplete for modules aswell? like when i import a module
19:35:34SusWombatit works for the one in installed via nimble. But not for my own
19:38:41ehmry[m]if I have a function that I know will always fail at runtime, can I print a warning at compile time if this function is in use?
19:38:59ehmry[m]this is a platform specific thing
19:40:46AraqSusWombat: likely some --path issue?
19:41:02*nsf quit (Quit: WeeChat 1.7)
19:41:02Araqehmry[m]: .error but then you get a compile-time error.
19:41:11*Ven quit (Ping timeout: 264 seconds)
19:41:14Araqor you misuse .deprecated
19:41:32SusWombatAraq, Il look into it thanks! :)
19:41:51*jonathon joined #nim
19:41:51ehmry[m]Araq: .deprecated wouldn't be that dishonest
19:42:18ehmry[m]but I'll try error first
19:42:28Araqehmry[m]: .error is honest but you claimed it should produce a runtime error
19:43:04Araqbtw platform specific code can also just be in a 'when defined(os_here)'
19:43:13jonathoncan i get `nim e` to run a nim script that doesn't end in ".nims"? i get "invalid indentation" if e.g. i have a plain filename
19:43:29ehmry[m]Araq: yes, thats what I'
19:43:55ehmry[m]m using but I expect the proc to be called occasionally and the exception handled
19:44:21Araqstrange setup.
19:44:46Araq"this occasionally fails at runtime so I warn you at compile-time about it"?
19:45:13ehmry[m]its a long story
19:47:11*Matthias247 joined #nim
19:48:25ehmry[m]anyway, would it conceivable to accept a PR that add an option to the compiler that would generate a Make recipe rather than invoke the external compiler?
19:48:53ehmry[m]I'm in a sticky situation and that might be my fix
19:49:00Araqjonathon: I dunno.
19:49:44*Ven joined #nim
19:50:06zachcarterI’m trying to translate some C code to Nim, can anyone tell me if this looks right ?
19:50:13zachcarterhttps://gist.github.com/zacharycarter/f7cd4abb6ee2fdda0b69162afb3e25fa#file-test-c-L46 vs https://gist.github.com/zacharycarter/f7cd4abb6ee2fdda0b69162afb3e25fa#file-conversion-nim-L38
19:50:49zachcarterI’m not sure if https://gist.github.com/zacharycarter/f7cd4abb6ee2fdda0b69162afb3e25fa#file-conversion-nim-L40 is correct
19:51:00krux02ehmry[m], you can tag the function as compileTime
19:51:08krux02then it isn't even there at runtime
19:51:13Araqehmry[m]: nope, just use --compileOnly and read nimcache/$project.json
19:51:40Araqand write something that translates the .json into makefile syntax or whatever
19:53:36krux02zachcarter, that is a lot of code
19:54:09zachcarterit is, most of it’s just definitions though
19:54:13zachcarterI’m mostly just concerned about the functions
19:54:20zachcarterI included the structs for reference
19:54:38ehmry[m]Araq: yea, thats probably going to work, thanks
19:54:42zachcartererr the function - there’s only one in each snippet
19:54:57Araqzachcarter: use 'var MaxRectsRect'
19:55:04Araqskip the 'seq'
19:55:09krux02looks ok to me
19:55:19zachcarterthank you Araq,
19:55:23*Ven quit (Ping timeout: 258 seconds)
19:55:26Araqin this case it's really a pointer to a pointer, not a pointer to an array
19:55:35krux02well your seq is wrong
19:55:37zachcarteryeah that’s what was confusing the crap out of me
19:56:25zachcarterthank you both :)
19:56:27Araqit remains a mystery how one can design a programming with a flaw like that and yet win a Turing award for it.
19:57:23krux02well the c programming language is actually quite nice and not overburdened with features, but it can't be fixed, because then it isn't C anymore
19:58:45Araqno, it's a defective broken version of Algol. the only innovations in it are design mistakes.
20:00:16krux02I had a professor, who said that algol 68 is the nicest language
20:00:44krux02better said he was my boss at the c++ classes
20:01:21krux02is algol 68 really so good?
20:01:27krux02I once tried it, but I failed
20:03:22Araqit was a superb language for the time, yes.
20:09:10*fvs left #nim ("leaving")
20:09:49*Ven joined #nim
20:10:02zachcarternever knew about algol 68 thank you guys for the history lesson :P
20:15:47krux02I wonder if there is a simple way to enable the keyboard layout https://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/APL-keybd2.svg/600px-APL-keybd2.svg.png
20:15:53*rauss joined #nim
20:17:28*brson quit (Ping timeout: 240 seconds)
20:20:45krux02if that keyboard layout would have been standard today, symbols like && and || would never have been introduced as substitutions for ¬ ∨ ∧
20:21:24*jabb joined #nim
20:23:51Araqv is a pretty ugly operator though, looks like the letter v
20:24:14*brson joined #nim
20:24:50Araqand recent studies showed that the brain is more in "language mode" than in "math mode" when programming, so natural language words like 'or' and 'and' seem to be less error prone
20:24:54PMunchkrux02, probably a xmodmap file on Linux :)
20:25:09PMunchAraq, that's interesting
20:25:38*Ven quit (Ping timeout: 246 seconds)
20:26:43Araqkrux02: I once thought of replacing 'if' with '?' and 'loop' with '@'
20:26:58Araqto have a language without english keywords
20:26:59PMunchkrux02, apparently it's already shipped with many Linux distros. Just do setxkbmap apl :)
20:27:28*Arrrr quit (Read error: Connection reset by peer)
20:27:45Araqbut it got ugly very fast :P what's the symbol for "function"/"proc"?
20:28:09krux02~_∊∊ ⎕↓⌊⎕ ~⌊∆ ⍳'_⌊⎕ ∆⍺⍴⍴_∆∆
20:28:16krux02⌈ ⌊| ∘∇~ ⍵_'⍕ ↓⌊∪∪⍕∊⍕ ~'⌈⎕⌈∘⍳ ⌈∘ ⌊∪∊
20:28:22krux02⌊∘⍎ ↓∇~ ⍎∇ ⌈ ∆~⌈⎕⍴↓ ⊤⌊⍴↑∆
20:28:25Araqпроцедуре
20:28:47PMunchæøå :)
20:28:54*deavmi__ quit (Quit: deavmi__)
20:29:10cheatfateAraq, you can make language with greek symbols :) it will looks ancient :)
20:29:15*Ven joined #nim
20:30:04PMunchI actually thought about creating a mock up of source highlighting where not only colours but also typefaces were at play
20:30:09AraqЯ пью пиво
20:30:16PMunchSo say all your variables were a different font from your functions
20:30:23PMunchJust to see what it would look like
20:31:02Vladarhttps://en.wikipedia.org/wiki/Rapira
20:31:12AraqPMunch: nimsuggest lets you do this, in fact
20:31:19krux02finally, when in apl mode, everything is those apl things
20:31:20Araqvia the 'outline' command
20:31:47krux02I copypasted my command thanks to the middle mouse button
20:32:13*rokups quit (Quit: Connection closed for inactivity)
20:32:29cheatfateAraq, russians already made ugly language with russian keywords and make it part of accountants software widely distributed (1C)
20:32:34PMunchHuh, interesting
20:33:02cheatfateits some sort of `basic` with russian keywords
20:34:01krux02I like the way how scratch solves the language barrier: https://en.wikipedia.org/wiki/Scratch_%28programming_language%29
20:34:30jabbC is life
20:34:33krux02it uses nodes, not text to represent a program. Then it's just applying standard localization for the nodes and it's done
20:38:26krux02how does this outline command do?
20:39:59*Ven quit (Ping timeout: 246 seconds)
20:43:59Araqkrux02: it tells the editor "this is a var, this is a let, this is a proc" etc
20:45:21krux02I rememebr that KDevelop has a very interesting feature, where every identifier is highlighted in a different color
20:45:45krux02while I think that is a bit too much, I think it can be an advantage to know where identifiers come from
20:45:52krux02for example one color per module
20:46:14krux02or a different color when something is a direct member access or a proc that just looks like a member
20:48:30krux02Araq: I have a horrible hack to get offsetof work at compile time: https://github.com/nim-lang/Nim/issues/5493
20:49:23*Ven joined #nim
20:50:29*Nobabs27 joined #nim
20:50:51Araqkrux02: congrats, you used the cache parameter of staticExec :-)
20:51:35krux02yes I am happy that I found it
20:52:32krux02because only because of it, I think doing this is actually practical
20:56:39*Ven quit (Ping timeout: 268 seconds)
21:00:34krux02Araq: where does the name gorge from staticExec come from?
21:01:18Araqit was inspired by "slurp"
21:01:53Araqand "slurp" comes from "hmm, I'm out of synonyms for 'read'"
21:02:19*Ven joined #nim
21:07:06krux02well I think staticExec is a bit more clear on what it does
21:09:04*zachcarter quit (Quit: zachcarter)
21:09:26krux02I just looked up what that word means, I don't think it really fits the purpose
21:12:15Araqit doesn't, it's a bad pun
21:12:46Araqin fact, both slurp and gorge should be deprecated :P
21:13:51FromGitter<JorySchossau> :thumbsup: those names are definitely weird coming in to Nim for the first time.
21:15:05krux02http://ix.io/oNy
21:15:38krux02sorry unrealated, but that doesn't compile, but it's not really stopping me from anything because the working alternative is there, too
21:15:49krux02but yea I actually do like slurp
21:16:06krux02I actually imagine the compiler slurping in some text
21:16:35krux02and then it's gone form the hard disk :P
21:17:22krux02mut maybe it should be called staticRead instead
21:18:35krux02wait that is how it is called :P
21:36:14*jonathon quit (Quit: Quit)
21:38:29*chemist69 quit (Ping timeout: 240 seconds)
21:49:38*bjz joined #nim
21:54:44*Nobabs27 quit (Quit: Leaving)
21:59:02*nsf joined #nim
22:01:59jabbnsf, you like nim and go?
22:02:30*Nobabs27 joined #nim
22:05:49*chemist69 joined #nim
22:19:34odcas a perl fan, I protest against the deprecation of slurp! ^^
22:20:27*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:21:34*elrood quit (Quit: Leaving)
22:26:26FromGitter<JorySchossau> My wrapper runs great stand-alone, but I'm confused how to make it a module. Something to do with importcpp and codegen namespaces is messing me up. Sage comments would be greatly appreciated. Minimal example here: [https://forum.nim-lang.org/t/2833]
22:27:37*zachcarter joined #nim
22:28:09*byte512 quit (Ping timeout: 240 seconds)
22:52:51*Vladar quit (Remote host closed the connection)
22:59:57krux02how do I use getAst?
23:00:39AraqJorySchossau: compile with 'nim cpp'
23:00:48*Jesin quit (Quit: Leaving)
23:00:58Araqkrux02: getAst someTemplate(arg1, arg2)
23:01:20krux02Araq: hmm, that is what I am doing and then I get "wrong number of arguments"
23:04:54Araqso pass the proper number of args to your template
23:06:14krux02well I am not sure about the problem at the moment
23:06:24krux02I just made an example to show what I mean, and there it works
23:06:38krux02http://ix.io/oNM
23:09:16nsfjabb: I like Go
23:09:22krux02Araq: well now I got the problem http://ix.io/oNN
23:09:30nsfjabb: and follow nim
23:09:37nsfdon't use nim though
23:09:57krux02I like nim, and follow Go
23:10:04krux02but there is not much to follow though
23:10:09krux02the language doesn't change
23:12:31zachcarternsf: where is that convo coming from?
23:12:41Araqkrux02: getAst doesn't do overload disambiguation
23:12:49nsfzachcarter: what are you talking about?
23:12:57zachcarternsf: jabb: I like Go
23:12:59zachcarterwho is jabb?
23:13:08nsf03:00:41 jabb | nsf, you like nim and go?
23:13:11krux02Araq: well that is what I need at the moment
23:13:23zachcarteroh I must have missed that, my bad
23:13:38nsf03:26:20 --> | zachcarter ([email protected]) has joined #nim
23:13:47nsfindeed, but anyways, it's very late here as you can see
23:13:50nsfgood night :)
23:13:54zachcartergnight nsf!
23:13:56*nsf quit (Quit: WeeChat 1.7)
23:14:11zachcarterjabb: do you have questions about Nim vs Go?
23:14:55jabbnope!
23:14:57krux02Araq: I have properties attached to types, by defining those templates as you can see in the example
23:14:59zachcarterah okay
23:15:22krux02now I am iterating the members of an object, and I need access to exactly that property
23:15:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:16:17krux02it's nice that the ast has symbols for the type for all the members
23:16:23krux02it's a weird iterator, but it works
23:17:46*butchster quit (Read error: Connection reset by peer)
23:17:54krux02well I guess I have an idea
23:17:56*butchster joined #nim
23:18:08krux02for once I thought getAst might be useful :P
23:18:28AraqI think you confuse getImpl and getAst
23:18:44Araqmembers do not have templates.
23:22:16*Matthias247 quit (Read error: Connection reset by peer)
23:24:36*yeeve quit (Ping timeout: 240 seconds)
23:24:48krux02well members are symbols
23:26:07krux02it's a bit complicated
23:26:26krux02when you look at ComposedType
23:26:38krux02I would like to pass ComposedType to the macro
23:26:46krux02so that I can call getImpl on that
23:26:48*yeeve joined #nim
23:26:54krux02then I can iterate the members
23:27:07krux02and I also hay symbols for the type of the members
23:27:11krux02so far so good
23:27:46krux02I also have the requiredment that all types of the members of the Composed type have a template on them implemented, that returns a string
23:28:44krux02now I want to collect those strings from all members
23:28:55*Pisuke joined #nim
23:31:37*MyMind quit (Ping timeout: 260 seconds)
23:31:59*gokr quit (Ping timeout: 256 seconds)
23:36:31krux02http://ix.io/oNR
23:37:57krux02Araq: I need it, so that I can create blocks for transform feedback https://www.khronos.org/opengl/wiki/Transform_Feedback
23:38:56AraqgetImpl?
23:39:15*couven92 quit (Quit: Client Disconnecting)
23:40:36Araqthe nimsuggest tests killed me, good night
23:42:42krux02getImpl is not what i need :/