<< 20-04-2017 >>

00:04:22FromGitter<Varriount> gokr: For what it's worth, I agree with you.
00:06:00gokrI am slightly torn - I do get demi's point. Also, I now investigated why hello.rs is so large - and it's mainly because it includes jemalloc.
00:07:05demi-ah that would do it
00:07:14gokrA newer rustc (nightly) - and two lines at the top of hello.rs to get rid of jemalloc gets it down to 160kb stripped. Nim is 63kb stripped.
00:07:30demi-i believe nim uses the system implementation of malloc
00:08:40gokrBut yes, the compilation unit of Rust is the crate (lib) and ... Nim does have an inherent advantage here with dead code removal. AFAICT Rust also relies on LTO (link time optimizations etc) but it doesn't seem to help much here.
00:09:07gokrLots to read here: https://lifthrasiir.github.io/rustlog/why-is-a-rust-executable-large.html
00:09:42demi-nim can also take advantage of LTO
00:09:48gokryep, true.
00:11:38gokrI would perhaps add "strip -s hello" to all languages, for Rust it cuts it in half almost for me. And perhaps note that Go does indeed link statically on many/most (?) platforms and thus ends up pretty big for "small" programs.
00:11:47sdwD used to have tables comparing features with C++. It generated a lot of negative PR (do they still have those tables? I can't find them)
00:12:14gokrAFAICT - for the moment - the way to fully statically link Rust would be to use musl.
00:12:21demi-go may link statically on all platforms except OS X
00:12:40demi-since OS X doesn't support statically linked binaries
00:12:52gokrWith Nim you can do it with libc too. I experimented with musl etc with Spry, works also great with Nim of course.
00:13:25gokrdemi-: It turns out... that depending on what you use in Go - you can get some dynamic linking going.
00:13:29gokrAt least with cgo.
00:13:30FromGitter<Varriount> Nim actually does get some benefit out of LTO - mainly for size.
00:14:22FromGitter<Varriount> demi-: How does OS X not support statically linked binaries?
00:14:55gokrAlso, "upx --best hello_*" will cut down severely on my Linux.
00:14:58demi-Varriount: https://developer.apple.com/library/content/qa/qa1118/_index.html
00:17:33sdwso... it does support static libs
00:17:40demi-of course
00:17:56sdwyou stated the opposite
00:18:16demi-no, i said it doesn't support statically linked binaries
00:18:20FromGitter<dextorious> Does Nim have any support for allocating memory with specific alignment, or should I just wrap the standard system-level C calls?
00:18:33sdwoh, so definition game :D
00:18:49demi-sdw: did you read the page at all?
00:19:01sdwI read that they discourage static libs and stopped
00:19:08demi-no
00:19:21demi-that is not what that page says at all
00:21:22demi-a statically linked binaries doesn't rely on the OS or any other dependencies on the system it is running on
00:21:37demi-a static library is an archive of object files
00:24:07sdwit says shipping a statically linked binary is a compatibility risk
00:24:23*krux02 quit (Remote host closed the connection)
00:24:51sdwso that must mean that you can do it, but they are under no obligation to help you when it breaks (and it will break)
00:25:24demi-hence, saying it was unsupported, building the Csu component doesn't work out of the box iirc
00:25:25*krux02 joined #nim
00:26:25sdwI equated "not supported" with "not possible", so my BS detector went off. I misunderstood :)
00:27:13demi-for all intents and purposes it might as well be not possible
00:27:38gokrBtw, so with strip -s and upx --best on all three (don't have haskell or D) - and with jemalloc removed from hello.rs to be a bit "fair" - we end up with Nim: 26kb, Rust: 68kb, Go: 479kb. But... upx is a bit of cheating, since it's simply compression - it will decompress when run.
00:28:43sdwwhy does this stuff get measured? is there a compelling argument anywhere?
00:28:50gokrWithout upx we get Go 1.6Mb, Rust 160kb, Nim 63kb.
00:30:04gokrWell, for "hello world" there is not much of a compelling argument of course. The main compelling argument IMHO is suitability for constrained platforms.
00:30:39demi-sdw: if you want to build statically compiled binaries, go bananas: https://opensource.apple.com/source/Csu/Csu-85/
00:33:11sdwgokr: then give me numbers for nim programs utilizing macros and templates. I wanna see that growth. Otherwise why would I not just keep using C?
00:33:31*rauss joined #nim
00:34:05gokrBecause C sucks? :)
00:34:15sdwnot for resource constrained...
00:34:45gokrI meant that it "sucks" when it comes to abstraction, usability etc.
00:35:29gokrNim will "cost" a tad more - but should work quite fine on many of the smaller MCUs. Perhaps a bit harder on the smallest ones.
00:35:47gokrI would like to play with it on my ESP32 for example, haven't had time.
00:35:48sdwthose come at a cost. rust advertises "zero cost" abstractions, or something, I think. Those are what you would need to sell
00:36:07gokrNim has zero cost stuff too.
00:37:08gokrBut even on smaller platforms much "worse" beasts are gaining traction - like micropython, espruino, Lua etc. Nim fits much better IMHO.
00:37:29sdwbut that is what needs to be shown, not hello world sizes
00:37:48sdwwhen I read that it has the opposite effect: these guys are not serious players
00:37:51gokrYeah, but harder to compare languages.
00:37:59sdwthen leave it out
00:38:18gokrhello world measures mainly overhead - but I agree - it gets a bit meaningless without an analysis.
00:38:55sdwI think those charts would get managers types to look into it. But when someone who knows a little more starts to see the BS, it turns them away
00:40:26sdwD used to have these tables comparing D features to C++ features, and they were often unfair comparisons. That really hurts when your audience knows their C++ and calls BS on your claims
00:40:51Araqdunno, if you cannot see C's tremendous disadvantages (no bounds checking in debug mode for a start) you're full of BS on your own.
00:40:52gokrI tend to agree. It may be better to just show/explain how Nim does things and the end result.
00:40:53sdw"what else are they lying about?"
00:42:33gokrIn my book Nim is one of the very few languages that has "C speed" and a nice GC model. I presume Swift may end up in the similar space, but... not sure about other contenders.
00:42:37sdwAraq: then show that
00:43:23Araqwhy do I need to show C sucks? it's widely known. the conflation of arrays with pointers and the effects it caused on the whole industry are widely known
00:43:45Araqyou're an amateur if you don't long for something better.
00:45:03sdwthis argument is what does the PR chart achieve
00:45:19raussgokr: Have you gotten your ardunimo lib to run on Unos and Nanos and whatnot?
00:45:40gokrNah, haven't touched that stuff since I made it.
00:45:55gokrBut... I do itch to take another stab at ESP32.
00:46:59raussgokr: Do you think it's reasonable for me to change things in ardunimo to be able to use it for other AVRs?
00:47:09FromGitter<Varriount> gokr: That name always reminds me of x86 registers
00:47:29gokrUnos and that ilk are too small. For example, the Moteino that I intend to use in a specific project - has an Atmega328p too - and ... 2kb RAM... ouch.
00:47:31demi-gokr: i doubt swift will end up like that, not when it is being ruled by garbage takes on access control rather than improving the language
00:47:42gokrdemi-: Good :)
00:48:02gokrrauss: Yeah, well, I hope so.
00:48:17demi-swift is still evolving and is extremely overburdened with keywords and boilerplate syntax
00:48:20gokrrauss: What platforms are you interested in?
00:48:41gokrdemi-: Do you know of any other contender?
00:48:43raussgokr: I have been coding in C++ for an arduino nano project, and would love to use nim
00:49:47demi-gokr: not that i am aware of, there is swift (and derivatives), rust, go, nim, ¯\_(ツ)_/¯
00:50:00demi-and the older statically typed languages i guess
00:50:13gokrdemi-: I wouldn't really consider rust (I want a GC).
00:50:21krux02the new homepage of nim doesn't even mention that nim can do metaprogramming
00:50:26raussI use a C library that I'd need to wrap as well, and would really need access to the arduino standard api like Ardunimo provides
00:50:42gokrrauss: Wrapping C libs is trivially easy.
00:50:51ldleworkgokr: will you wrap sdl-gpu pls
00:50:58gokrWrapping C++ libs is harder, but Araq has done most of the heavy lifting.
00:51:00demi-ah i see, yeah i don't know then, i'm not much of a language enthusiast
00:51:01raussgokr: Right, but running the wrapped code on an AVR is not :)
00:51:02krux02gokr: no it's more a "it depends" thing
00:51:09krux02wrapping C is not generally easy
00:51:34gokrkrux02: Well, ok, sure. But for the libs I have tried I wouldn't say it was that hard.
00:51:56krux02try to wrap open dynamics engine
00:52:09krux02or something with callbacks
00:52:49krux02but anyway good night folks
00:52:50*krux02 quit (Remote host closed the connection)
00:53:14gokrcallbacks doesn't have to be hard. But sure, it all depends.
00:53:28ldleworknah wrap sdl-gpu plsss
00:54:17gokrrauss: What are you doing with the nano?
00:54:43FromGitter<Varriount> zachcarter: Hows progress going on the game?
00:54:53gokrrauss: Btw, what I did with Ardunimo was to basically look at the stuff that the Arduino IDE spat out - and work from there.
00:54:56zachcarterVarriount: almost done i think, adding enemy bombs now
00:55:23FromGitter<Varriount> zachcarter: I trust you were able to convert the tracker module into something playable?
00:55:23zachcartergoing to try to finish it tonight
00:55:26raussgokr: I'm working with this library ( https://github.com/NicoHood/Nintendo ) to mess with signals to/from the gamecube
00:56:03zachcarterI haven’t tried yet but that’s on my short list
00:56:12gokrrauss: cool
00:56:21rausszachcarter: We should add a link to the new discourse on the website
00:56:41gokrrauss: Any reason you couldn't use a slightly stronger thingy?
00:56:45zachcarterwe can - I was going to do some clean up on it first, just haven’t gotten around to it yet
00:57:11FromGitter<Varriount> discourse?
00:57:13zachcarterhttp://community.fragworks.io/
00:57:14raussgokr: Size, and the fact that the Nano works perfectly for this when nim isn't in the picture
00:57:36gokrMy fav right now it the ESP32 Thing from Sparkfun.
00:57:49FromGitter<Varriount> zachcarter: You can either convert the tracker module file to an mp3/wav/etc, or use a library that supports playback (I believe SDL_mixer suppurts some formats)
00:58:01zachcarteryeah I was going to try to go for ogg
00:58:02gokrrauss: I actually have a few nanos here too.
00:58:02zachcarterif possible
00:58:29gokrrauss: In fact, I have TONS of these little buggers of all kinds - our office was emptied and most of it ended up in my house.
00:59:15raussgokr: Do you think you could give me tips on getting Ardunimo working on avrs, if it's not something you'd want to work on yourself?
00:59:41zachcarterVarriount: I’m thinking about working on a little repl type thing for a nim playground for the website too
01:00:10FromGitter<Varriount> Yeah, I saw
01:00:21gokrI could give it a shot
01:00:28rauss:D:D:D::D:D:D:D:D:D :D
01:00:33zachcarterlooking forward to that
01:00:53gokrSince I do plan on working on the Moteino - it's the same Atmega328p.
01:01:02raussRight
01:02:11gokrI should sleep now though. But bug me here regularly :)
01:02:32raussWill do, thanks
01:11:03*chemist69 quit (Ping timeout: 258 seconds)
01:11:52*sflynn_ joined #nim
01:12:19*sflynn_ quit (Client Quit)
01:14:17*vlad1777d quit (Remote host closed the connection)
01:15:38*Sentreen quit (Quit: WeeChat 1.4)
01:16:14gokrAraq: etcpriv?
01:17:31*gangstacat quit (Quit: Ĝis!)
01:17:34gokrseems gone
01:24:37*alectic quit (Quit: leaving)
01:32:46*chemist69 joined #nim
01:53:59*yglukhov joined #nim
01:58:52*yglukhov quit (Ping timeout: 268 seconds)
02:02:01zachcartercool space invaders is pretty much done minus levels
02:07:04pydsignerGrats
02:07:32*gangstacat joined #nim
02:11:02*gokr quit (Ping timeout: 240 seconds)
02:14:59*Sentreen joined #nim
02:28:01*Sentreen quit (Ping timeout: 260 seconds)
02:38:59*Sentreen joined #nim
02:42:56zachcarterthanks
02:48:22zachcarterIdlework: are you around?
02:48:53ldleworkzachcarter: its ldlework to you mr.
02:49:01ldleworkwhats up
02:49:12zachcarterI have a question about Docker
02:49:48zachcarterah nm I think I just figured it out
02:49:56ldleworkglad I could help.
02:49:59zachcarterI was looking for data volumes :P
02:50:00ldleworksummon my presence anytime.
02:50:04zachcarterlol thank you
03:01:06*libman quit (Quit: Connection closed for inactivity)
03:08:12*arnetheduck quit (Remote host closed the connection)
03:31:10*sdw left #nim (#nim)
04:08:16zachcarterVarriount: are you around by any chance?
04:11:16FromGitter<Varriount> zachcarter: yes
04:11:45zachcartero/ do you have any ideas on how I might achieve this playground thing - in terms of hosting the compiler
04:13:04zachcarterI was thinking of using docker but demi- was suggesting a repl like interface
04:13:09zachcarternot sure it would be responsive enough for that
04:13:10FromGitter<Varriount> Hm.
04:13:32FromGitter<Varriount> Well, docker + limiting the stdlib would probably help.
04:13:42zachcarterokay
04:13:52zachcarterI can give that a shot
04:14:08zachcarterthink I have a basic idea of how to do this
04:14:15zachcartergoing to give it a go and see what happens
04:15:23zachcarterthanks for the suggestion
05:01:06gangstacaton the windows installation page, shouldn't "~/.nimble/bin (where ~ is C:\Users\username\.nimble)" be replaced to "%USERPROFILE%\.nimble\bin"? https://ss64.com/nt/syntax-variables.html USERPROFILE: This is equivalent to the $HOME environment variable in Unix/Linux
05:08:25FromGitter<Varriount> Probably
06:05:02*vlad1777d joined #nim
06:10:02*rauss quit (Quit: WeeChat 1.7)
06:19:26*nsf joined #nim
06:27:15*bozaloshtsh quit (Ping timeout: 240 seconds)
06:30:42*rokups joined #nim
06:45:06FromGitter<Bennyelg> Printable of the book is already available right?
06:48:36*Tiberium joined #nim
06:51:36*gokr joined #nim
06:54:08FromGitter<mratsim> @zachcarter, you can check how Rust did their playground, since they don’t have a REPL, they just compile everytime, as a proof of concept that will be enough. Plus what is interesting is the LLVM IR, their MIR IR (intermediate IR) and the ASM output. It’s great to check if things like iterator where properly optimized (+ sharing on a bug tracker): https://play.rust-lang.org/
06:54:08FromGitter<Bennyelg> Just now I bought the Combo Edition :) p + e book ;]
06:57:19*benny joined #nim
06:57:44*benny is now known as Guest17309
06:58:33FromGitter<mratsim> (And the big bonus, I could test things at lunch time without bringing my laptop at work)
06:58:57*couven92 joined #nim
06:59:48Guest17309Hey
07:00:39dom96zachcarter: I think you should structure it this way: a backend that accepts code, compiles and runs it, then returns the result. You can then write a bunch of different front ends for that (and allow others to do the same).
07:01:26dom96i.e. The usage would be simply a POST to https://try.nim-lang.org/run (or whatever) with the code (and perhaps some other info like desired Nim compiler version)
07:01:30Guest17309O
07:01:48dom96Bennyelg: not yet.
07:02:03*Guest17309 is now known as BennyElg
07:02:44dom96zachcarter: FWIW I don't think you should be going after a REPL-like interface. Just a simple run this code and give the results.
07:02:48dom96*give me
07:02:51BennyElgJust now I bought it anyway.
07:02:58dom96BennyElg: thanks :)
07:03:22BennyElgCheers! Hope to switch from python to Nim fast :D
07:03:33FromGitter<mratsim> agree with dom96 :)
07:03:47ldlework+1
07:03:50BennyElg@dom96 are you from germany ?
07:04:20Tiberiumhow to get "ptr" of the first element in array?
07:04:37Tiberiumaddr(data[0]) ?
07:04:40FromGitter<mratsim> add your array[0]
07:04:44FromGitter<mratsim> add*
07:04:49FromGitter<mratsim> addr
07:04:59FromGitter<mratsim> yes
07:06:37Tiberiumbasically I want to make something like https://github.com/codeplea/tinyexpr#binding-to-custom-functions
07:06:54dom96BennyElg: Nope, Polish but lived in the UK for most of my life
07:06:56dom96bbl
07:07:11Tiberiumbut I don't know how to construct array like this in Nim, because if I pass pointer of first element in array, and length of array (2), it still fails
07:07:17Tiberiumah, nvm
07:07:29Tiberiumok, can I get name of function in proc that accepts function?
07:07:47FromGitter<mratsim> Actually I use that for my ndarray library (but it’s a pointer to sequences so maybe addr is enough for arrays) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58f85e46cfec9192725861a6]
07:08:21Tiberiumit works for me
07:08:37Tiberiumbut there's another problem: get name of proc passed into my proc
07:08:44TiberiumI have "proc genFunc[T](fun: T): te_variable = "
07:09:10Tiberiumand I want to know the name of "fun" (it would be a proc, but with different number of args)
07:09:25Tiberiumah, nevermind
07:09:34TiberiumI'll just add new argument to my proc - funcName: cstring
07:10:29FromGitter<mratsim> you may be able to use astToStr
07:11:35FromGitter<mratsim> found that:https://stackoverflow.com/questions/31565006/how-to-get-string-representation-of-an-expr-in-nim-template
07:11:57FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58f85f40d32c6f2f09222b5b]
07:13:10gangstacatdom96, do you want a PR for what I spoke about?
07:13:54Tiberiummratsim: astToStr just gives me "fun" which is name of argument in proc
07:14:51FromGitter<mratsim> not inside the function, use a wrapper function that can call asttostr
07:15:21BennyElgdom96: Nice I'm working on Gett (Former gettaxi if you ever hear of them)
07:15:24FromGitter<mratsim> Here is an example: https://github.com/mratsim/nimfp/blob/master/config.nims
07:16:06FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58f860398fcce56b201bfd55]
07:16:30couven92BTW, I read a little about Nimble and the binaries symlink problem on Windows... I found out that hardlinks do not require administrative rights on Windows...
07:16:53FromGitter<mratsim> instead of exec nim you could use a let func_name =, and then use that as input to your function
07:17:08FromGitter<mratsim> so you don’t have to add that manually everywhere
07:17:18couven92Question is: Is a hardlink better than batch file?
07:17:42FromGitter<mratsim> There is hardlinks on windows :O ?
07:17:56couven92@mratsim yes there is
07:18:46*chemist69 quit (Ping timeout: 260 seconds)
07:18:48couven92@mratsim `MKLINK /?` will tell you that `/H` creates a hardlink instead of a symlink
07:19:09Tiberiummratsim: still doesn't work. How do I need to call this "foo" template? If I try "let funcName = foo(fun)" it fails; also in template it gives "export is only allowed at top level"
07:21:11FromGitter<mratsim> Can’t help you there unfortunately :/ I just remembered this pattern but I didn’t use it myself so I don’t know the technicalities
07:24:19Tiberiumcan I make this a "case" statement somehow? https://gist.github.com/TiberiumN/f19f2c989ec564ca9ce33f1cbc19c4de
07:25:23FromGitter<mratsim> is the input a vararg?
07:25:48FromGitter<mratsim> if yes you can use case varargs.len: ⏎ of:
07:25:55Tiberiummratsim: I have a generic proc (to accept procs with different number of args)
07:26:08Tiberiumah, maybe I can get number of proc arguments?
07:26:25Tiberiumproc genFunc[T](fun: T, name: cstring): te_variable =
07:32:32Tiberiumok, doesn't matter, I still achieved my main goal - passing array of procs into C function
07:37:05*chemist69 joined #nim
07:40:42*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
07:41:15*Arrrr joined #nim
07:41:15*Arrrr quit (Changing host)
07:41:15*Arrrr joined #nim
07:46:57Tiberiumcan I do something if float is "2.0" but not "2.5"? So if it can be converted to int without losing data
07:47:29TiberiumI can only think of "if someFloat == float(int(someFloat)):"
07:48:15ldleworkTiberium: https://nim-lang.org/docs/math.html#floor,float64
07:48:48*couven92 quit (Read error: Connection reset by peer)
07:49:11Tiberiumldlework, "if someFloat == floor(someFloat):" ?
07:49:43ldleworksure
07:49:57BennyElghow do I request.get("someURL") on Nim
07:50:23ldleworkBennyElg: did you look in the available libraries?
07:50:45BennyElgI am still pretty new to all (2nd day of investigrating)
07:50:48TiberiumBennyElg, getContent in httpclient
07:50:52BennyElginvestigating
07:51:02Tiberiumbut it's not high level as requests is
07:51:04BennyElgThanks I'll get look into the Nimble thing
07:51:09Tiberiumit's not nimble
07:51:11Tiberiumit's in stdlib
07:51:25TiberiumBennyElg, https://nim-lang.org/docs/httpclient.html
07:51:27ldleworkBennyElg: https://nim-lang.org/docs/lib.html
07:51:48BennyElgOh, I got the idea that Nimble is like pip in python so If I'm looking into some library this is my "Guy" on Nim
07:52:36ldleworkBennyElg: That is what nimble is. He's telling you that httpclient is a standard library.
07:52:42ldleworkNot a third party package installed with Nimble.
07:52:46ldleworkIE, you already have it.
07:53:11*gokr quit (Ping timeout: 252 seconds)
07:53:20TiberiumBennyElg, for example, in my application I use only two third-party Nim libraries: "colorize" for colored console output, and "strfmt" for string interpolation (like f-strings in python)
07:53:26Tiberiumso I can live without these easily
07:53:33Tiberiumand depend only on stdlib
08:12:42Tiberiumzachcarter, hi, what do you use for gif recording?
08:19:40euantorYou probably don't even need colorize: https://nim-lang.org/docs/terminal.html#setForegroundColor.t,ForegroundColor
08:20:00Tiberiumeuantor, colorize is just easy to use :)
08:20:06Tiberium"my string".fgRed.bold
08:20:14euantorPerfectly good reason :)
08:20:18Tiberiumwould produce red and bold string
08:20:26Tiberiumand it can be evaluated at compile time
08:20:57Tiberiumbecause fgRed and bold are just procs which accept string and return string
08:21:37Araqdoes colorize work on Windows?
08:21:53TiberiumAraq, probably it doesn't
08:22:03Tiberiumbecause it just emits ANSI color codes
08:22:24Tiberiumit should work in powershell
08:22:27Tiberiumbut not in default cmd
08:22:41Tiberiumbut anyway powershell will become default cmd in windows
08:23:21*yglukhov joined #nim
08:24:26Araqwell you can always patch echo to translate color codes into Win API calls
08:24:53TiberiumAraq, wait, so "terminal" works on both windows and linux ?
08:25:03Araqof course it does.
08:25:25Araqbut I doubt colorize does.
08:25:41TiberiumAraq, it doesn't
08:25:46Tiberium(I mean not in default cmd)
08:26:05Araqbut hey, unportable code is sexy when you do it to fight evil M$
08:26:35TiberiumAraq, http://techgage.com/article/microsofts-windows-10-creators-update-small-tweaks-for-a-big-difference/ "One tweak that will likely have a lot of people confused, and quite a few guides updating, is Microsoft’s first stage plan of replacing Command Prompt with PowerShell. "
08:26:52Tiberium"When you right-click on the Start button or use Win+X, the two options for Command Prompt plus (Admin) have been replaced with PowerShell shortcuts."
08:27:39Tiberiumand powershell supports ansi codes
08:28:14TiberiumAraq, but thanks for info about terminal!
08:28:14AraqI use a custom command prompt on Windows not Powershell ;-)
08:28:28AraqPowershell is stupid.
08:28:36Tiberiumcustom?
08:29:01Araqforgot its name, but it can do constrol-cursor to jump over words
08:29:06Araq*control
08:29:18Tiberiumbtw, there's powershell for mac and linux
08:29:27Araqmaking it more pleasant to use than anything I ever found for Unix.
08:29:41Tiberiumunder MIT license https://github.com/powershell/powershell
08:30:01euantorI should probably check if my progress library works in cmd, I've only ever tested it in Powershell for windows. My guess would be that it doesn't
08:31:02TiberiumAraq, you mean "ctrl+left arrow" or "ctrl+right arrow" ?
08:31:19Tiberiumbecause in my oh-my-zsh I have this feature
08:34:15Araqyeah :-)
08:35:33Tiberiumah, and some distros seems to provide mappings for "ctrl+left/right arrow" too
08:35:34Tiberiumhttp://stackoverflow.com/questions/5029118/bash-ctrl-to-move-cursor-between-words-strings
08:36:23Tiberiumah, it seems this is not a "zsh" feature but system key mapping
08:40:58*MyMind joined #nim
08:43:00*Sembei quit (Ping timeout: 258 seconds)
09:11:02*alectic joined #nim
09:13:47*Pisuke joined #nim
09:15:29*MyMind quit (Ping timeout: 260 seconds)
09:16:48*couven92 joined #nim
09:42:05*chemist69 quit (Ping timeout: 252 seconds)
09:42:31*bjz joined #nim
09:46:36*Vladar joined #nim
09:47:01*chemist69 joined #nim
09:50:18*TheLemonMan joined #nim
09:51:51*Arrrr quit (Ping timeout: 245 seconds)
09:59:51*Vladar quit (Quit: Leaving)
10:02:08*gokr joined #nim
10:10:01*Arrrr joined #nim
10:33:19*bjz_ joined #nim
10:34:14*bjz quit (Ping timeout: 255 seconds)
11:02:31*Snircle joined #nim
11:04:46*PMunch joined #nim
11:20:42*arnetheduck joined #nim
11:22:25*Jipok[m] quit (Ping timeout: 240 seconds)
11:27:34FromGitter<mratsim> I managed a cool thing (maybe not for you veterans). Using the compiler to check that you don’t mix and match ressources from different contexts. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I am forced to use `ctx: Context[T]` instead of `ctx: C` however [https://gitter.im/nim-lang/Nim?at=58f89b298fcce56b201cf94c]
11:29:09*Jipok[m] joined #nim
11:32:51*yglukhov quit (Remote host closed the connection)
11:44:24zachcarterdom96: I’m a quarter Polish :P maternal grandparents last name is Pawenski :)
11:44:40zachcarteranywho do you think using docker to compile and run the code is the right way to go?
11:45:02ldleworkyes
11:45:05zachcarterTiberium: I use quicktime and then use ffmpeg to convert the mov files to gifs but if your’e on windows there are better solutions
11:45:15zachcarterokay that’s what I’m going to do then
11:45:45*PMunch quit (Ping timeout: 260 seconds)
11:47:54*yglukhov joined #nim
11:49:39FromGitter<mratsim> I think I celebrated too fast ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58f8a0568e4b63533de81948]
11:51:11*chemist69 quit (Ping timeout: 255 seconds)
11:52:08*yglukhov quit (Ping timeout: 240 seconds)
11:56:03*chemist69 joined #nim
11:59:31*tankfeeder joined #nim
11:59:42euantorYeah, I would say Docker is the way to go
12:02:00*PMunch joined #nim
12:20:05*zachcarter quit (Quit: zachcarter)
12:26:23*BennyElg quit (Remote host closed the connection)
12:29:27*yglukhov joined #nim
12:33:30*nsf quit (Quit: WeeChat 1.7)
12:41:11*BennyElg joined #nim
12:41:42*yglukhov quit (Remote host closed the connection)
12:44:26Tiberiumbtw, about "More examples at RosettaCode…" - some of them doesn't work
12:44:29*BennyElg quit (Remote host closed the connection)
12:44:35Tiberiumfor example because "typeless arguments are obsolete"
12:46:13tankfeederfix it
12:46:22Tiberiumyep
12:46:59*yglukhov joined #nim
12:52:22Tiberiumbtw, I don't like slowness of rosetta code :(
12:52:29Tiberiumpages load slowly
12:53:07tankfeederthey under cloudflare, its ok
12:53:31Tiberiumnot for me
12:53:38Tiberiumfor me wikipedia is 3x faster than rosetta code
12:57:03tankfeederwgy you compare ?
12:57:05tankfeederwhy
12:57:09tankfeederforget it
12:57:32Tiberiumbut really, rosetta code is annoyingly slow
12:57:49*vivus quit (Quit: Leaving)
12:59:17Tiberiumwat
12:59:21Tiberium"proc sqrt*(x: int64): float {.importc: "sqrt", header: "<math.h>".}"
12:59:35Tiberiumthere wasn't sqrt in "math" stdlib module some time ago?
13:03:12*BennyElg joined #nim
13:03:14tankfeederhttps://nim-lang.org/docs/math.html#sqrt,float32
13:03:49BennyElgNim In action (Reading in progress - semi review: Great book - recommended)
13:04:39tankfeedernothing special :)
13:05:28Tiberiumtankfeeder, I know, but still :)
13:08:51*nsf joined #nim
13:09:00*BennyElg quit (Remote host closed the connection)
13:13:57*Tiberium quit (Read error: Connection reset by peer)
13:14:14*Tiberium joined #nim
13:15:44*Tiberium quit (Remote host closed the connection)
13:15:58*Tiberium joined #nim
13:16:39*Tiberium quit (Remote host closed the connection)
13:18:10*BennyElg joined #nim
13:18:56*Tiberium joined #nim
13:26:09*BennyElg quit (Remote host closed the connection)
13:31:23*zachcarter joined #nim
13:37:02*smt quit (Read error: Connection reset by peer)
13:39:25*smt joined #nim
13:46:09dom96BennyElg: Glad you like it :)
13:49:25*krux02 joined #nim
13:53:45*BennyElg joined #nim
13:56:11Tiberiumhow to make this work? https://gist.github.com/TiberiumN/a636674dbe6d6cdced38b18fe5a66db2
13:56:23Tiberium"Error: undeclared identifier: 'msg'"
13:56:50Tiberiumcall.handle is a call for my proc, problem isn't there
13:57:27Tiberiumin base.nim there's some imports, including "meta.nim"
13:58:00Tiberiumhmm
13:58:04Tiberium{.dirty.} helped
14:00:31dom96you need to use the inject pragma
14:00:43dom96try applying it to the parameter
14:01:32Tiberiumdom96, how? proc call(api {.inject.}: VkApi) {.async.} like this?
14:01:45dom96no idea
14:02:02Tiberiumdom96, ah, you mean after "command" I need to inject two variables?
14:04:17Tiberiumdom96, ah, with inject in this template I'll end using "var myvar {.inject.} = myvar", but I don't want users to change myvar
14:04:29TiberiumI mean not users, but commands :)
14:04:38Tiberium(and {.dirty.} is shorter)
14:10:33*BennyElg quit (Remote host closed the connection)
14:10:44*BennyElg joined #nim
14:13:40*rauss joined #nim
14:15:51dom96dirty is deprecated though IIRC
14:19:51Tiberiumdom96, why?
14:21:46*tankfeeder quit (Quit: Leaving)
14:30:29Tiberiumoh no, I've met same issue - https://github.com/nim-lang/Nim/issues/4753
14:31:08Tiberiumthe problem is that I need to create unique names of procs in template, so I can define proc separately (not using anonymous proc)
14:33:34Tiberiumso how to define a proc in template with a unique name?
14:33:40Tiberiumrandom doesn't work at compile time
14:33:53Araqdirty is not deprecated.
14:33:54adeohluwaAraq: custom shell on WIN baboon? cygwin?
14:39:46*BennyElg quit (Remote host closed the connection)
14:52:14zachcarterdom96: is using threadpool with asyncdispatch okay?
14:55:53*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:58:36dom96zachcarter: yes
14:58:50zachcarteralright cool
15:06:56*nsf quit (Quit: WeeChat 1.7)
15:07:19*McSoFake joined #nim
15:13:19*Trustable joined #nim
15:22:21*libman joined #nim
15:27:36FromGitter<Varriount> zachcarter: You still can't magically have memory cross thread boundaries easily
15:27:47zachcarterright
15:33:46*zachcarter quit (Quit: zachcarter)
15:40:23dom96wow, the new site launch has given us the biggest spike in visitors ever
15:41:05PMunchNice!
15:48:41*PMunch quit (Quit: leaving)
15:50:46*Vladar joined #nim
15:51:06Tiberiumdom96, can you share some stats?
15:51:13Tiberiumjust curious :)
15:51:21demi-dom96: it is a very nice new design :)
15:52:45Tiberiumalso it's very strange that I've joined Nim community in the time where everything is changing :) (I mean website, many new features etc..)
15:53:08*nsf joined #nim
15:54:28Tiberiumnsf, wow, there's russian nim users :)
15:54:41dom96Tiberium: What stats would you like?
15:55:02dom96We had just under 25k page views yesterday
15:55:07Tiberiumoh wow
15:55:08Tiberiumnice then
15:58:22Tiberiumdom96, if you have time: how can I define proc's in template with unique name? (so procs wouldn't overlap) I can't use anonymous proc's because I need them to be {.async.}
16:01:15euantorEasy solution is to have a count, so the first time you create one it'll be `someproc1`, the next is `someproc2`, etc
16:01:33nsfTiberium: I don't use vim, just linger here...
16:01:42nsfoops soory
16:01:45Tiberiumnsf, :D
16:01:46nsfsorry* :)
16:01:50nsftypo, nim
16:01:56nsfbut I don't use vim either
16:04:18alecticnsf: but do you plan to use it in the future or will you still prefer go for system tools?
16:06:51Tiberiumeuantor, and then I can define my proc like proc `name`(some args) ?
16:09:07nsfat the moment I don't plan anything
16:09:12nsfbut nim is an interesting language
16:10:09Tiberiumeuantor, but how can I do count if I call template from different places?
16:11:25Tiberiumeuantor, ah, It seems I fixed it, but
16:11:26alecticnsf: I was just curious what gophers think about nim, would be nice to see something like termbox written in nim at some point in the future :)
16:11:41Tiberiumeuantor, "lib/pure/asyncmacro.nim(283, 10) Error: Unknown name. error("Unknown name.")"
16:13:41nsfalectic: I like nim overall, but every language which has metaprogramming in it walks a very dangerous path, also it's hard to bit Go's "compilation from scratch" ecosystem
16:14:00nsfalectic: for example race detector from sanitizer tools is very hard to use with C
16:14:11nsfbecause you need to recompile everything from scratch (including libc)
16:14:18nsfand in Go it's easy
16:19:06nsfto beat*
16:19:45*McSoFake quit (Ping timeout: 245 seconds)
16:20:09*zachcarter joined #nim
16:21:04alecticnsf: The compilation process is what I like most about Go I think, it feels good to be almost completely free from C. Go has its good parts but starts to feel very limiting fast (because of its type system?), especially if you enjoy functional languages or languages that have functional elements in them.
16:21:45nsfyes, it's a valid point
16:22:26nsfyou do miss things like javascript's lodash in Go (or if you don't code in JS, .NET's LINQ)
16:22:49nsfand Go authors are aware of that problem
16:22:58nsfbut I also understand why they are so hesitant about generics
16:23:16nsfand other forms of metaprogramming
16:23:34nsfprogramming languages allow you to express graphs on paper
16:23:49nsfadding meta to it, is like adding portals to 3d world you live in
16:24:15nsfbut at the same time portals can be useful right
16:24:16*zachcarter_ joined #nim
16:24:19nsfif used carefully :D
16:24:31Calinoudom96: can you give me a screenshot of the Google Analytics stats please? :P
16:24:36Calinou(since site launch)
16:24:37*zachcarter quit (Ping timeout: 240 seconds)
16:24:37*zachcarter_ is now known as zachcarter
16:25:58libmanalectic: Go has a 50-horsepower compiler. Nim gives you a 1000-hp compiler for the same price: lots more power and features. But it does take some gas. ;-)
16:27:15alecticnsf: I understand why as well. At this point I don't know anymore if generics would help the language and its ecosystem or actually do more harm
16:28:22alecticlibman: they have different philosophies and goals, in my eyes they don't compete
16:28:25libmanAnd I guess in the car analogy this would be Haskell - https://i.ytimg.com/vi/JscQXDsSgco/hqdefault.jpg 3:)
16:29:44*nsf quit (Quit: WeeChat 1.7)
16:30:41*libman doesn't like the new site. But who cares what I think.
16:31:26Calinouhttp://www.commitstrip.com/en/2015/02/27/if-languages-were-cabs/
16:31:30Calinouthis too :P
16:33:18Tiberiumlibman, old website looked like "black magic" for me
16:33:32TiberiumI mean it was grey and black
16:33:36libmanThe new site looks like it was designed for people with phones, bleh.
16:33:57Tiberiumlibman, every second website looks like this today :)
16:35:02Calinouit's just modern design
16:35:07Calinoupersonally, I'm really fond of it
16:35:22libmanPay no attention to me. I'm just a grumpy old burned-out ex-programmer who did his best work in the 90s, then a decade of LAMP and a decade of nothing... Hey, maybe I should start a 90s style Nim BBS. :P
16:35:23Calinoudesign evolves daily, but most websites have looked like this since 2013-2014
16:35:28Calinou(I've seen tons of flat redesigns back then)
16:35:46Calinoulibman: "FINGER us at nim-lang.org!"
16:35:49Calinouinstant success :)
16:36:10*libman ponders n1m.pl
16:36:33Tiberiumhttp://nim.pl/ ?
16:36:43Tiberiumwat
16:36:49Tiberiumit says for me "welcome safari user"
16:36:53Tiberiumbut I'm a chrome user and I'm on mac
16:36:57Tiberiumoh sh*t
16:36:59TiberiumI'm on linux
16:37:16libmanDat's why all my vaporware project names stick a number in them.
16:38:12libmanOr n¡m (with inverted exclamation mark)
16:38:28Tiberiumhow can users type this?
16:39:41libmanA decent editor should have a macro for converting HTML character code keywork at cursor to the output unicode character. In this case that would be &iexcl;
16:40:44Tiberiumlibman, why editor? I thought we're talking about website
16:41:38libmanA decent operating system would reuse the same editor component everywhere, including URL input.
16:41:45FromGitter<mratsim> He is off course browsing from his editor
16:41:52FromGitter<mratsim> of*
16:42:00FromGitter<mratsim> but works either way I guess ;)
16:42:14*libman is Richard Stallman's evil twin. Still working on the beard though.
16:42:46FromGitter<mratsim> I don’t think Stallman would use Nim since it’s not GPLv3
16:42:47Calinoujust apt-get install beard
16:43:00CalinouStallman uses plenty of permissively licensed software, btw
16:43:11Calinouthe FSF even advises to use permissive licenses when your code is less than 300 lines
16:43:27*Matthias247 joined #nim
16:43:38libmanI once tried an experiment of setting up Gentoo Linux with as little permissive software as possible (the opposite of what I normally do on BSD). It wasn't pretty.
16:44:06libmanAnyway, this should be in #nim-offtopic.
16:44:09FromGitter<mratsim> I remember trying to setup a conf call with the FSF. They didn’t want to use, Skype, Hangouts, or anything >_>. Then I gave up.
16:44:38libmanWhy not IRC? Voice communication is overrated.
16:44:47Tiberiumvoice communication is faster
16:45:01Tiberiumbecause voice is our native feature
16:45:10Tiberiumand typing on keyboard isn't :)
16:45:16FromGitter<mratsim> That was to organize a conference. With actual people, not dev ;)
16:45:55libmanFaster != better. Imagine how much more annoying I would be if you had my undivided attention!?!
16:46:13Tiberiumyou still have possibility to write in the chat :D
16:48:52libmanHere's something slightly less off-topic... I got discouraged about maintaining a list of binary packages for various OS/distros when the site went Ruby, but I'm still slowly tinkering with it. Almost ready to push some HaikuOS packages.
16:50:07libmanHaikuOS compiles Nim like a champ. If you wanna play with Haiku, just be sure to download the right install ISO. Their "stable" release is ancient - don't use it. Get a nightly build.
16:52:06libmanhttps://download.haiku-os.org/nightly-images/x86_64 is the best install for 64-bit (also works great in qemu, only takes a minute to install). Don't get a "hybrid" version with gcc2 and gcc5, get one that only has the latter.
16:55:50FromGitter<mratsim> Regarding gcc5, I really wonder when CUDA starts supporting higher version ...
17:00:16libmanNim and Haiku could go great together. It's a very lean OS with OO C++ API. The latest security trend is to run your GUI in hypervisors (ex. KVM, bhybe, qemu, etc), in which case Haiku makes no less sense than visualizing another Unix layer with Xorg.
17:01:20FromGitter<barcharcraz> is that really a trend given that running a GUI in a hypervisor usually means giving up ... graphics support
17:01:55*yglukhov quit (Remote host closed the connection)
17:02:29*yglukhov joined #nim
17:02:38libmanIt's not for gamers, but normal GUI apps work fine.
17:03:11FromGitter<barcharcraz> idk most modern GUIs really benifit from at least like basic OpenGL 3.2 support
17:03:20FromGitter<barcharcraz> like modern compositors
17:04:59libmanAlso, if someone was looking to make a competitor for Android (Linux+Java) today, working on top of Haiku+Nim could make sense.
17:06:37*yglukhov quit (Ping timeout: 240 seconds)
17:08:45FromGitter<evacchi> does sending over a channel still causes a deep copy when using unmanaged ptrs ?
17:09:32FromGitter<evacchi> I am using a channel to pass a proc ptr around, but I fear memory is leaking
17:09:51FromGitter<evacchi> (where the proc is a closure)
17:12:48*Spume joined #nim
17:15:45*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
17:17:18euantorI'd prefer something like Alpine Linux + Nim or qubes + Nim
17:17:38euantorAlpine is nice and light for a phone OS, I haven't had any experience with Haiku
17:35:42*DungeonDude joined #nim
17:36:11DungeonDudedoes nim add any runtime checks when compiling signed integers to C?
17:36:35DungeonDudethere is a lot of undefined behaviour with them, e.g. on overflows etc.
17:36:52FromGitter<barcharcraz> I would like alpine if it used systemd
17:36:55FromGitter<barcharcraz> but it does not
17:37:31euantorSome would see that as an advantage. I like systems personally, but it gets a lot of hate for some decent reasons
17:38:21FromGitter<barcharcraz> I know. For me it's worth it just to be able to sit down at any random linux computer and kina know what's going on
17:42:40*yglukhov joined #nim
17:45:58*xmonader joined #nim
17:46:02FromGitter<Varriount> DungeonDude: Signed integers get overflow checks.
17:46:04*yglukhov quit (Remote host closed the connection)
17:46:22FromGitter<Varriount> I'm not sure about unsigned integers.
17:46:31FromGitter<barcharcraz> it's also harder to get into trouble in the first place since nim does not have implicit narrowing conversions
17:46:45*yglukhov joined #nim
17:47:08FromGitter<Varriount> I never did understand why C was designed to allow narrowing conversions implicitly.
17:47:12DungeonDudeC is so full of undefined features, i wonder how many of them nim abstracts away :S
17:47:28FromGitter<barcharcraz> I mean you can sorta see why when using a C API from nim
17:47:33FromGitter<Varriount> DungeonDude: The compiler turns off strict aliasing too
17:48:32FromGitter<barcharcraz> wow windows subsystem for linux is actually pretty neat
17:49:14Tiberiumyep
17:49:25TiberiumI've also installed oh-my-zsh with agnoster
17:49:29Tiberiumand special terminal emulator
17:49:58FromGitter<barcharcraz> like the coolest was when I installed gvim like "no way this'll work" and then lo and behold it pops up on my desktop
17:50:06FromGitter<barcharcraz> I had forgotten I had vcxsrv running
17:50:48Tiberiumbut there's no graphic acceleration :(
17:50:54Tiberiumfor cuda
17:50:59Tiberiumor for simple gui
17:51:02FromGitter<barcharcraz> really
17:51:06Tiberiumyep
17:51:11FromGitter<barcharcraz> I thought xming and vcxsrv supported glx
17:51:19FromGitter<barcharcraz> but I guess if you can't find the device
17:51:20Tiberiumwsl doesnt support it
17:51:25*gokr2 joined #nim
17:51:25FromGitter<barcharcraz> yeah
17:51:36Tiberiumyou can run opengl
17:51:41Tiberiumbut with software acceleration
17:52:19FromGitter<barcharcraz> :(
17:53:59DungeonDudeDoes idiomatic string handling in nim treat strings like byte arrays?
17:54:06DungeonDudeeg iterating, indexing
17:57:33FromGitter<Varriount> DungeonDude: yes
17:58:04FromGitter<Varriount> There are procedures for handling utf8 encodings though.
17:58:22DungeonDudewhy is this a default? this makes it too easy to mess up utf8 strings.
17:58:55libmanNim compiling to C does not make Nim any less safe than any language that compiles to ASM / machine code.
17:59:13*gokr2 quit (Ping timeout: 258 seconds)
17:59:25*chemist69 quit (Ping timeout: 240 seconds)
18:01:56FromGitter<Varriount> DungeonDude: Most indexing of strings is iteration or splitting, in which case utf8 makes no sense.
18:02:11*chemist69 joined #nim
18:02:15FromGitter<Varriount> Also, utf8 isn't the only encoding that exists.
18:02:49FromGitter<Varriount> Furthermore, Nim tends to interact quite a bit with C libraries, which expect C character arrays.
18:03:24DungeonDudeso it null-terminates them all the time, or only when passing to C? This would make splitting expensive
18:04:13FromGitter<Varriount> Strings are automatically null terminated, which is cheap (only a single character's worth or storage used).
18:04:30FromGitter<Varriount> However, the string data structure also contains a length field.
18:04:42DungeonDudeyes but this forbids splitting by just pointing into another string + capping length
18:05:14FromGitter<Varriount> DungeonDude: Which you can't do anyway, because Nim's strings are mutable, variably sized arrays.
18:05:34DungeonDudedoesn't it have slices?
18:05:48FromGitter<Varriount> Yes. Slicing creates a new string.
18:06:02*FromGitter * Varriount waits for looks of horror.
18:06:41DungeonDudeallocation minesweeper :P
18:07:06FromGitter<Varriount> DungeonDude: As much as I might wish differently, this is how Nim's strings are.
18:07:19FromGitter<Varriount> In practice, it's more of a pitfall to new programmers than anything.
18:07:35AraqJava switched from O(1) slices to O(n) slices fwiw
18:07:51AraqPython never had O(1) slicing but people think it has so it's fine
18:07:56zachcarterdom96: is it possible to check whether request.formData contains a key with Jester?
18:08:19FromGitter<Varriount> DungeonDude: As long as you keep in mind that sequences and strings are A: mutable, and B: Copy on assignment, it's not much of a performance problem.
18:08:19DungeonDudei like how d has cheap slices. But its standard lib is full of hidden gc allocatins :S
18:08:34FromGitter<Varriount> DungeonDude: What do you mean by hidden?
18:09:28DungeonDudea lot of standard functions allocate internally via the gc, even if its not obvious to the caller. Which wastes cpu cycles
18:10:17FromGitter<Varriount> DungeonDude: You might not like Nim's standard library then. The developer's aren't shy about using the garbage collector.
18:11:12FromGitter<Varriount> I mean, it's not used willy-nilly either, but there's very little manual memory management used.
18:12:16DungeonDudewell nim devs also don't discourage new users to avoid the gc like the plague
18:12:55FromGitter<Varriount> And the Nim GC doesn't pause programs for noticeable lengths of time either.either.
18:13:42*arnetheduck quit (Remote host closed the connection)
18:14:01Araqit's also thread local, call GC_disable and treat it as a memory region that is freed when the thread dies.
18:19:48DungeonDudeis nimble like the CMake equvalent for nim? Or should i use nake/nim c/...?
18:20:26demi-i'd use nimble for building libraries or executables
18:20:33demi-makes distribution much easier
18:21:11demi-i'm not sure i see a need for nake outside preference tbh
18:21:49TiberiumDungeonDude, nimble is like pip
18:21:59DungeonDudenever used pip
18:22:12Tiberiumsame as almost any language package manager
18:22:20DungeonDudei only had trouble with language package managers
18:22:27Tiberiumlol, why?
18:23:29DungeonDudethey poorly integrate into my system, instal like 20 different versions of the same library for various reasons and most of them don't even verify what they execute, ala `curl ... | sudo sh`
18:24:02DungeonDudeim glad nimble uses at least https trough git
18:24:39Araq^^ yep. 20 different versions of the same library is a problem. :-)
18:25:03demi-hopefully not, so long as the dep manager versions properly :)
18:25:20DungeonDudeand then these 20 versions have submodules, which pull in the same 20 libraries 15 nested times. Compile times going trough the roof :P
18:25:51DungeonDudei once saw the dir structure of your typical node.js project and jumped straight back to c/c++
18:27:49*yglukhov quit (Remote host closed the connection)
18:28:22*yglukhov joined #nim
18:29:19DungeonDudeif nimble builds your projects, how does koch differ?
18:29:54demi-koch is specifically for building nim compiler and tools
18:29:57TiberiumDungeonDude, look at this for node.js horror : https://github.com/jonschlinkert?utf8=%E2%9C%93&tab=repositories&q=color&type=&language=
18:30:10Tiberiumalso https://github.com/jonschlinkert/ansi-green/issues/1
18:30:20*yglukhov quit (Remote host closed the connection)
18:30:33*yglukhov joined #nim
18:30:38Tiberiumhttps://github.com/jonschlinkert/ansi-green/issues/1#issuecomment-250623396 12 million downloads of ansi-wrap and ansi-green
18:30:51DungeonDudeIs this serious? Or some "parody" like fizzbuzz enterprise
18:30:56Tiberiumyep it is
18:30:59Tiberium12kk downloads man
18:31:05Tiberiummaybe it's because JS doesn't have dead code elimination
18:32:36DungeonDudethis is cancer. I've glad node.js exists, so this type of people stay there, away from me :P
18:33:23*chemist69 quit (Ping timeout: 255 seconds)
18:33:57Tiberiumhopefully I don't use node.js
18:34:06TiberiumI find JS syntax too much noisy for me
18:34:10DungeonDudei guess when this dude ships his `print-color.sh`, he compiles in a webserver, his ide and half a web browser :S
18:34:59federico3can I cast a packed object into a string? How?
18:43:13zachcarterdom96: I have a working prototype of the playground thing
18:43:33zachcartergoing to get it hosted now
18:43:39Tiberiumzachcarter, yay
18:44:17zachcarter:D
18:44:30*yglukhov quit (Remote host closed the connection)
18:45:04*yglukhov joined #nim
18:46:58dom96zachcarter: awesome :D
18:47:03dom96that was quick :)
18:47:17zachcarterwell it’s not very feature rich yet but I think it works and it was pretty easy
18:47:25zachcarterwe’ll know soon :)
18:48:16Tiberiumzachcarter, pls link
18:48:22zachcarterwill do as soon as I get it up
18:48:22euantorIs it possible to use await within a template? I'm getting `undeclared identifier: 'await'`
18:49:15dom96euantor: not currently, you can use 'yield' though
18:49:26*yglukhov quit (Ping timeout: 260 seconds)
18:49:44euantorah, ok thanks
18:49:51zachcarterhttp://imgur.com/a/qpXt9
18:50:47euantorNot sure how much that helps. I'm trying to update the reds library to use asyncnet. I might just change `readSocket` entirely, but I'm not quite sure of the best approach
18:51:27Tiberiumeuantor, zachcarter posted his image about nim playground, not about your problem :)
18:51:40euantorYeah, I was talking to dom ;)
18:51:47*chemist69 joined #nim
18:52:17*kunev quit (Ping timeout: 260 seconds)
18:54:24*kunev joined #nim
18:55:06euantorAh, never mind I've worked it out :)
18:55:44dom96zachcarter: source code on github yet?
18:56:14*smt_ joined #nim
18:59:23*Spume left #nim (#nim)
18:59:40*smt quit (Ping timeout: 260 seconds)
19:02:49zachcarternot yet
19:03:00zachcarterbout to put it up
19:06:50FromGitter<Varriount> federico3: You'll have to use memory copying routines to copy the data into a string.
19:06:56euantorAny ideas what this might mean dom96: `internal error: expr: var not init dummyValFuture_216164`?
19:07:10euantorhttps://www.irccloud.com/pastebin/FhaBfNOZ/
19:07:23FromGitter<Varriount> zachcarter: What is that interface?
19:07:29zachcarterpostman
19:07:33dom96euantor: It's a compiler bug
19:07:38TiberiumVarriount: there's also "Advanced rest client" for Chrome
19:07:40euantoryay!
19:08:05Tiberiumit does something like postman does
19:08:30federico3Varriount: copyMme(addr mystring, addr myobj, size) ?
19:09:31FromGitter<Varriount> federico3: Yes
19:09:43FromGitter<Varriount> federico3: Don't forget to add the null byte
19:10:12FromGitter<Varriount> federico3: Although, wouldn't raw data from an object be better put in a sequence?
19:12:16federico3Varriount: I'm trying to pack/unpack a simple binary protocol, I'm open to suggestions. seq[uint8] ?
19:12:35FromGitter<Varriount> federico3: Yep.
19:15:39*TheLemonMan joined #nim
19:23:44zachcarterdom96: the code’s up on github now, working on getting it hosted, have to figure out a few things, I probably need to add another dockerfile
19:24:09zachcarterhttps://github.com/zacharycarter/nim-playground
19:26:53DungeonDudewas anyone of you a die-hard C++ fan before converting to nim?
19:28:28Tiberiumehh, still no success creating unique name in a template
19:28:46Tiberiumhow can I define a proc with name in "funName" variable (at compile time)?
19:30:01*Arrrr quit (Read error: Connection reset by peer)
19:32:08FromGitter<Varriount> Tiberium: https://nim-lang.org/docs/macros.html#genSym,NimSymKind,string ?
19:37:11TiberiumVarriount: something like this fails to compile - https://gist.github.com/TiberiumN/188ce2e7cba325e8402c1a9f0a20aa08
19:37:41Tiberiumah LOL
19:37:58TiberiumI need to do "newNimNode(nnkStmtList)"
19:38:07Tiberiumaaand still fails
19:38:10Tiberiummaybe because async?
19:38:51Tiberiumhttps://gist.github.com/TiberiumN/0e4db1bbc70ff2a4333ff986d21ab64e
19:39:17TrustableHi all, I want to cast a proc to pointer, get "Error: expression cannot be cast to pointer". Does anyone know how to do this or why this don't work? Example: https://gist.github.com/trustable-code/8bde3fa56307acf38f692f591dfead4a
19:41:34FromGitter<Varriount> Trustable: What's the calling convention you're targetting?
19:42:07TrustableI'm on Linux AMD64
19:42:44FromGitter<Varriount> Trustable: Need more information. cdecl?
19:43:25TrustableI don't know. How do I find out?
19:43:29TiberiumTrustable, you need pointer for C func?
19:43:38Tiberiumto pass your nim proc to C function?
19:43:46Trustableyes
19:43:56Tiberiumin my code I have
19:44:13Tiberiumtype MyFunc = proc(a: cdouble): cdouble {.cdecl.}
19:44:25Tiberiumthen
19:44:59Tiberiumvar funcPointer: MyFunc = myfunc
19:45:02FromGitter<Varriount> https://glot.io/snippets/ep4gy5b78y
19:45:03TrustableTiberium, thanks, this works :)
19:45:42Tiberiumhttps://gist.github.com/TiberiumN/0e4db1bbc70ff2a4333ff986d21ab64e can this be a bug in async support?
19:46:14Trustablebut why do I have to make it cdecl, to cast it to a pointer?
19:46:48TiberiumTrustable, because you will need to pass it to C function?
19:47:18Tiberiumhttps://en.wikipedia.org/wiki/Calling_convention
19:48:05Trustablethe proc I pass is not called from C, I just want to pass it through, it's call from the same Nim code
19:49:16TiberiumTrustable, why wouldn't you just pass it then?
19:49:32Tiberiumproc callMe(myproc: proc (a, b: int): int)
19:49:48Tiberiumso you would call it like callMe(myproc) if myproc has proc (a, b: int): int declaration
19:50:01Tiberiumno pointers required?
19:50:12Tiberium(i don't know really if this is a good way)
19:54:21*freevryheid joined #nim
19:54:56*Mat4 joined #nim
19:57:01freevryheidhowto get the type of another type defined as, say type A = array[2, T]
19:58:25Tiberiumfreevryheid, maybe you want to switch on types, not just get them?
19:58:59DungeonDudeisn't it a bit heavy to have all packages in one gigantic json file?
19:59:18TiberiumDungeonDude, it would change as I heard
19:59:32TiberiumDungeonDude, but nim has a few packages (~ 500), so it's only 300-400kb json
20:00:38demi-DungeonDude: i asked the same thing recently, but so far it seems like it will scale pretty well; baring any enormous spike in library contributions
20:00:55DungeonDudeif anyone can submit a pull request, is there any form of quality control of what gets in there, or not?
20:01:44demi-sorry? you mean like how nim-like they are or how useful?
20:02:00Tiberiumdemi-, maybe he meant if some libraries can be like "rm -rf /"
20:02:13demi-oh, i see
20:02:34demi-they get reviewed by someone on the dev team before they get merged
20:02:34DungeonDudeor maybe verify commits if signed.
20:02:39*DungeonDude puts on tinfoil hat
20:02:50*Mat4 quit (Quit: Mat4)
20:02:55TiberiumDungeonDude, probably dom96 quickly looks at source code
20:03:19Tiberiumyou know, its the same as buildbot of #pypy project, which has no password protection from stopping/starting builds
20:03:48Tiberiumbut nobody tries to grief it
20:04:00Tiberiumsame with nim probably :)
20:04:43def-Tiberium: yeah, i have fixed versions of the rosetta code examples on https://github.com/def-/nim-unsorted but too much work to update them on rosetta code
20:05:26Tiberiumdef-, oh, I don't like rosetta code (I like the idea) :) it's sloooow, much slower than typical web pages
20:05:54DungeonDudeit just would be nice to have some chain of trust so i can unlearn my fear of insecure package managers
20:06:39Tiberiumdef-, https://gtmetrix.com/reports/rosettacode.org/kpABtIyD 2.5 sec here,
20:06:58Tiberiumis their webserver is so slow?
20:07:38TiberiumTTFB waiting is almost 1.4 sec
20:08:01*Tiberium quit (Remote host closed the connection)
20:11:07*libman quit (Quit: Connection closed for inactivity)
20:11:16*Trustable quit (Remote host closed the connection)
20:12:17*rokups quit (Quit: Connection closed for inactivity)
20:13:31*nsf joined #nim
20:15:05*couven92 quit (Ping timeout: 255 seconds)
20:20:29DungeonDudehow does nims expressiveness/concisenes compare to scheme's?
20:24:02*Vladar quit (Quit: Leaving)
20:24:33ldleworkI wouldn't say expresiveness is the same as conciseness
20:24:44ldleworkthat said, Nim is both expressive and relatively consice
20:25:09DungeonDudedynamic typing kills lisps for me :S
20:25:11ldleworkScheme is a lisp, so it basically has no chance to be more concise than anything.
20:25:44*DungeonDude is on a quest to find a programming language
20:27:15ldleworkQuest over :)
20:27:30ldleworkThough... I admit to writing nothing but TypeScript for the last week! :O
20:27:37DungeonDudei hope so. Tomorrow i will invest some serious time into nim
20:27:45ldleworkDungeonDude: what do you want to use it for
20:28:29DungeonDudemessing around with small opengl games, automating my linux, writing tools like keystroke launchers, ...
20:29:36ldleworkcool
20:30:15FromGitter<TiberiumPY> https://github.com/mame/quine-relay
20:30:24FromGitter<TiberiumPY> There's nim too
20:30:25ldleworkDungeonDude: I wrote a small SDL2 library for writing games in Nim. I don't know how good your OpenGL is, but I could really use an upgrade to OpenGL with batch-backed sprites, etc
20:30:40ldleworkDunno if that interests you
20:30:53ldleworkDungeonDude: kinda like sdl-gpu but for nim
20:31:17DungeonDudeim a person with ideas, energy and motivation but no time :(
20:31:37ldleworkWelcome to the club of everyone else. :)
20:32:00freevryheidthis seems to work, the type of a type is T.T
20:32:46DungeonDudeldlework: i planned my own game engine for years, and already designed my own language on paper. But ...
20:34:05ldleworkDungeonDude: just make managable contributions to my thing instead :)
20:34:26DungeonDudei will write that down on my todo list. See you in march 2019
20:34:31ldlework;)
20:34:38*couven92 joined #nim
20:35:47DungeonDudewhich is almost as long as my list of unfinished projects
20:39:06*chemist69 quit (Ping timeout: 260 seconds)
20:40:56DungeonDudehow difficult is it, to write nim plugins intended to be loaded at runtime into a running nim program?
20:41:43demi-probably not terribly hard, i wrote a harness for doing that the other day, it is in nimble now
20:46:09zachcarterI’m slowly getting there with ngnix, docker compose, etc...
20:46:57ldleworkask for help if you need it
20:47:11zachcarterthanks I will
20:47:35*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
20:48:23*DungeonDude quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:51:57*freevryheid left #nim ("ERC (IRC client for Emacs 25.1.1)")
21:02:34FromGitter<TiberiumPY> demi- , what's the name of this nimble library?
21:03:31demi-TiberiumPY: plugin-manager, it allows you to load dylibs at runtime and register them for callbacks from your main application, PRs are welcome, i just happened to build out the functionality i needed from it
21:04:11FromGitter<TiberiumPY> Can it support async?
21:04:33demi-what do you mean by that?
21:05:10FromGitter<TiberiumPY> My callbacks needs to be async
21:05:41*chemist69 joined #nim
21:05:43*rauss quit (Quit: WeeChat 1.7)
21:06:09demi-the library expects you to implement a method that recieves the callbacks, but it expects you to handle doing whatever you are going to do with the callback asynchronously
21:06:59demi-so the hand-off between the app and the plugin isn't, but the plugin's work is expected to be async
21:07:50demi-does that make sense?
21:09:37FromGitter<TiberiumPY> Yes
21:16:46zachcarterIdlework: Can you have a docker container that has access to docker inside of it?
21:17:19ldleworkzachcarter: yeah just bind the socket
21:17:31ldleworkThis is a bad idea if its the container running user code
21:17:49*bjz joined #nim
21:18:02zachcarterit’s not
21:18:06zachcarterit’s the container spinning that one up
21:18:12*ldlework nods
21:18:25zachcarterbind the socket hrm I’ll have to figure that one out, thank you
21:20:05ldleworkzachcarter: -v /var/run/docker.sock:/var/run/docker.sock
21:20:14zachcarterah thanks
21:25:08zachcarterneed to figure out how to do this through docker compose
21:25:28ldleworkzachcarter: compose lets you mount things
21:25:36zachcarterokay
21:25:46ldleworkhttps://docs.docker.com/compose/compose-file/#volumes
21:26:02zachcarterthanks
21:32:19zachcarterwould I then need to add docker to the path or anything to use it? I can’t seem to get it working
21:33:26zachcarterhttps://gist.github.com/zacharycarter/799e3578a11371e0448dd38bbf4acd21
21:33:29zachcarteris my docker-compose.yml file
21:34:08zachcarterI’m calling docker inside the nim file that’s compiled inside the dockerfile but I’m getting : docker: command not found
21:38:02ldleworkzachcarter: yeah docker needs to be installed inside the container
21:38:14zachcarterah okay
21:38:46zachcarterthanks I’ll give doing that a shot
21:38:49ldleworkzachcarter: otherwise you can talk to the docker daemon right through the socket
21:38:52*xmonader quit (Ping timeout: 258 seconds)
21:38:55ldleworkvia the docker api
21:38:58demi-i don't think you typically docker your docker
21:38:59ldleworknot sure if there is a nim lib yet
21:39:22ldleworkthey are just running the binary as a subprocess
21:39:25ldleworkit isn't docker-in-docker
21:39:52zachcarterdemi-: I’m containerizing the app itself
21:39:57zachcarterwhich uses docker
21:40:08zachcarterthis is so I can easily deploy it to digital ocean etc
21:40:28zachcarterhrm so I guess I’m going to install nim from source in this image along with docker then
21:40:35zachcartererr in this container I mean
21:41:07ldleworkzachcarter: I would consider just using an http request to the socket
21:41:47ldleworkif you're going to include the binary, there's probably no reason to build it from source
21:41:52ldleworkAlso why are you building Nim from source?
21:42:02ldleworkThere are already official Nim images
21:42:04zachcarterwell presently I’m not
21:42:06zachcarterI’m using the nim image
21:42:36zachcarterokay I think I see what you mean / I’m doing wrong
21:46:25icebattleexit
21:46:26icebattleexit
21:46:27icebattleexit
21:46:40*icebattle quit (Quit: leaving)
21:48:06FromGitter<TiberiumPY> Wrong window?
21:49:27ldleworkcouldn't hit that /
21:50:41*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:55:49*xmonader joined #nim
21:56:30*gokr quit (Ping timeout: 258 seconds)
22:00:07zachcarterhrm I’m not sure how else I’d easily deploy this thing without using docker inside of docker or http request to the socket which doesn’t look like it’s going to work since I need timeout
22:04:07zachcarterdemi-: any suggestions?
22:05:07*xmonader quit (Ping timeout: 240 seconds)
22:06:29ldleworkzachcarter: what do you mean about timeout?
22:06:36zachcarterthe command timeout
22:06:57zachcarterI’m basically trying to restrict the length of execution of the docker container
22:07:18ldleworkzachcarter: what's the problem with that?
22:07:19zachcarterit works
22:07:38zachcarterwell I’m not sure how I’d use the command and issue a http request to the socket
22:07:47ldleworkyou mean httpclient?
22:07:56zachcarterI guess so :P
22:08:14ldleworkzachcarter: just start the container
22:08:21ldleworkthen create a scheduled event inside your nim process
22:08:26ldleworkand if the container is still runing at that point, kill it
22:08:47krux02I changed the way I iterate over my entities, now I get a segfault in glUnmapNamedBuffer
22:08:54krux02WTF
22:09:24ldleworktwo individual pieces of Nim code implementation that you think are functionally equivallent, usually isn't under Nim :(
22:09:26zachcarterIdlework it’s restricting the length of the container I’m spawning that I’m concerned with
22:09:35ldleworkzachcarter: that's what I'm saying
22:09:38zachcarteroh
22:09:52ldleworkjust schedule a time when you will check if the container is still running, and then kill it if it is
22:09:59zachcarteroh with the httpclient
22:10:08zachcarterhrm okay
22:10:35zachcarterI’ll need to play around with the httpclient, this adds some complexity I wasn’t expecting
22:10:35ldleworkzachcarter: Time to build nim-docker :)
22:10:41zachcarterugh I really want to avoid that
22:10:48zachcarteror anything like it :P
22:10:49krux02well I didn't use a container, I defined all entities as an iterator
22:10:50ldleworkI mean you'd only need like three endpoints to implement your app
22:10:57zachcarterokay
22:11:09ldleworkrun, inspect and kill
22:11:13krux02so I have an iterator that itself iterates
22:11:14ldleworkmaybe logs to get the logs
22:11:16ldlework:)
22:11:19ldleworkso
22:11:21ldlework4
22:13:18krux02well I got the problem
22:13:18zachcarterhttps://github.com/danielsuo/libdocker :)
22:13:35ldleworklmfao
22:13:40krux02my iterator produces too many entities and that writes over the boundaries of my mapped buffer
22:13:41ldleworkzachcarter: just build it in httpclient
22:13:45zachcarteryeah
22:13:47ldleworkif you open source it I'll probably contribute later
22:13:53ldleworkadd more endpoints
22:19:07*Sentreen quit (Ping timeout: 240 seconds)
22:19:15zachcarterwhere are the docs on the http api?
22:19:56ldleworkhttps://docs.docker.com/engine/api/v1.25/
22:20:15zachcarterthanks
22:20:56*alectic quit (Quit: leaving)
22:21:23krux02zachcarter: can it be that you wanted to make a tetris game example?
22:21:39zachcarterI can! I prety much am done with space invaders
22:22:02krux02well I just did one in opengl-sandbox
22:22:06zachcarteroh nice!
22:22:10krux02I took it as a challenge
22:22:55zachcartershould make a gif!
22:23:30zachcarterhttp://imgur.com/a/yTXyP
22:24:02ldleworkzachcarter: you need to use palette switch when using ffmpeg :)
22:24:33zachcarterit keeps telling me I can’t use rgba24 with my gif code even though I’m using gifsicle
22:24:40zachcartermakes me furious
22:24:42krux02well I don't have a setup ready for recording
22:24:54ldleworkkrux02: gtk-recordmydesktop is just an apt away
22:25:13krux02I use pacman
22:25:24zachcarterIncompatible pixel format 'rgb24' for codec 'gif', auto-selecting format 'rgb8'
22:25:26zachcarteris the crap it tells me
22:27:26krux02well gif can only 8 bit colors
22:27:46krux02and when you upload it to imgur it's converted to video file
22:27:59krux02mp4 I think
22:28:24krux02so you have compression artifacts from removing the colors and artifacts from the imgur algorithm
22:28:43krux02but anyway it works so no complaints
22:30:24*nsf quit (Quit: WeeChat 1.7)
22:30:50ldleworkhttp://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
22:32:04*Sentreen joined #nim
22:32:49krux02well my tetris has 3D graphics
22:32:59krux02but it lacks being pretty
22:34:02krux02and no animations
22:34:15krux02but hey it's tetris that game does only need 3D
22:39:53ldleworkdoes it even need 3d
22:40:36krux02http://i.imgur.com/ib209sZ.png
22:41:50krux02it's now at 425 lines without any external dependencies
22:42:21krux02I just render a plane as background and colored icosahedrons
22:45:41*kunev quit (Ping timeout: 260 seconds)
22:48:01zachcarternice
22:59:00*xmonader joined #nim
23:02:50krux02there is still something missing
23:03:02krux02the game does not count scrore
23:03:25krux02nore is there anything like level
23:13:26zachcartersame here
23:14:19krux02it is already fun though
23:14:35krux02I can put stones, I see the next stones and I can remove lines
23:14:45krux02so the important part is already working
23:21:30vlad1777dSorry, I'm newbie. Where can I found source code, which implements echo instruction ?
23:22:02vlad1777dTell me please filename, if you know, not to search me many time. Thanks.
23:25:03krux02vlad1777d: well when you have something that is implemeneted with magic, I recommend you to grep for that magic
23:26:13vlad1777dkrux02, thanks, I'm not best friend to grep, so I'll search manually =)
23:32:42krux02vlad1777d: better get used to it, it really helps in bigger code base
23:32:58krux02one of my main tools
23:33:12vlad1777dthanks
23:33:18vlad1777dI'll do it one time =)
23:34:11krux02grep -rni yourmagic
23:34:40krux02editors even have grep plugins
23:38:31vlad1777dkrux02, I'm searching on GitHub now, there are near 100 pages with match =)
23:40:45*chemist69 quit (Ping timeout: 255 seconds)
23:49:02*adeohluwa quit (Quit: Connection closed for inactivity)
23:49:13zachcarteranyone feel like trying out frag / the first level of space invaders?