00:04:22 | FromGitter | <Varriount> gokr: For what it's worth, I agree with you. |
00:06:00 | gokr | I 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:05 | demi- | ah that would do it |
00:07:14 | gokr | A 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:30 | demi- | i believe nim uses the system implementation of malloc |
00:08:40 | gokr | But 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:07 | gokr | Lots to read here: https://lifthrasiir.github.io/rustlog/why-is-a-rust-executable-large.html |
00:09:42 | demi- | nim can also take advantage of LTO |
00:09:48 | gokr | yep, true. |
00:11:38 | gokr | I 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:47 | sdw | D 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:14 | gokr | AFAICT - for the moment - the way to fully statically link Rust would be to use musl. |
00:12:21 | demi- | go may link statically on all platforms except OS X |
00:12:40 | demi- | since OS X doesn't support statically linked binaries |
00:12:52 | gokr | With Nim you can do it with libc too. I experimented with musl etc with Spry, works also great with Nim of course. |
00:13:25 | gokr | demi-: It turns out... that depending on what you use in Go - you can get some dynamic linking going. |
00:13:29 | gokr | At least with cgo. |
00:13:30 | FromGitter | <Varriount> Nim actually does get some benefit out of LTO - mainly for size. |
00:14:22 | FromGitter | <Varriount> demi-: How does OS X not support statically linked binaries? |
00:14:55 | gokr | Also, "upx --best hello_*" will cut down severely on my Linux. |
00:14:58 | demi- | Varriount: https://developer.apple.com/library/content/qa/qa1118/_index.html |
00:17:33 | sdw | so... it does support static libs |
00:17:40 | demi- | of course |
00:17:56 | sdw | you stated the opposite |
00:18:16 | demi- | no, i said it doesn't support statically linked binaries |
00:18:20 | FromGitter | <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:33 | sdw | oh, so definition game :D |
00:18:49 | demi- | sdw: did you read the page at all? |
00:19:01 | sdw | I read that they discourage static libs and stopped |
00:19:08 | demi- | no |
00:19:21 | demi- | that is not what that page says at all |
00:21:22 | demi- | a statically linked binaries doesn't rely on the OS or any other dependencies on the system it is running on |
00:21:37 | demi- | a static library is an archive of object files |
00:24:07 | sdw | it says shipping a statically linked binary is a compatibility risk |
00:24:23 | * | krux02 quit (Remote host closed the connection) |
00:24:51 | sdw | so 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:24 | demi- | 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:25 | sdw | I equated "not supported" with "not possible", so my BS detector went off. I misunderstood :) |
00:27:13 | demi- | for all intents and purposes it might as well be not possible |
00:27:38 | gokr | Btw, 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:43 | sdw | why does this stuff get measured? is there a compelling argument anywhere? |
00:28:50 | gokr | Without upx we get Go 1.6Mb, Rust 160kb, Nim 63kb. |
00:30:04 | gokr | Well, 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:39 | demi- | sdw: if you want to build statically compiled binaries, go bananas: https://opensource.apple.com/source/Csu/Csu-85/ |
00:33:11 | sdw | gokr: 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:05 | gokr | Because C sucks? :) |
00:34:15 | sdw | not for resource constrained... |
00:34:45 | gokr | I meant that it "sucks" when it comes to abstraction, usability etc. |
00:35:29 | gokr | Nim 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:47 | gokr | I would like to play with it on my ESP32 for example, haven't had time. |
00:35:48 | sdw | those come at a cost. rust advertises "zero cost" abstractions, or something, I think. Those are what you would need to sell |
00:36:07 | gokr | Nim has zero cost stuff too. |
00:37:08 | gokr | But even on smaller platforms much "worse" beasts are gaining traction - like micropython, espruino, Lua etc. Nim fits much better IMHO. |
00:37:29 | sdw | but that is what needs to be shown, not hello world sizes |
00:37:48 | sdw | when I read that it has the opposite effect: these guys are not serious players |
00:37:51 | gokr | Yeah, but harder to compare languages. |
00:37:59 | sdw | then leave it out |
00:38:18 | gokr | hello world measures mainly overhead - but I agree - it gets a bit meaningless without an analysis. |
00:38:55 | sdw | I 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:26 | sdw | D 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:51 | Araq | dunno, 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:52 | gokr | I tend to agree. It may be better to just show/explain how Nim does things and the end result. |
00:40:53 | sdw | "what else are they lying about?" |
00:42:33 | gokr | In 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:37 | sdw | Araq: then show that |
00:43:23 | Araq | why 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:45 | Araq | you're an amateur if you don't long for something better. |
00:45:03 | sdw | this argument is what does the PR chart achieve |
00:45:19 | rauss | gokr: Have you gotten your ardunimo lib to run on Unos and Nanos and whatnot? |
00:45:40 | gokr | Nah, haven't touched that stuff since I made it. |
00:45:55 | gokr | But... I do itch to take another stab at ESP32. |
00:46:59 | rauss | gokr: Do you think it's reasonable for me to change things in ardunimo to be able to use it for other AVRs? |
00:47:09 | FromGitter | <Varriount> gokr: That name always reminds me of x86 registers |
00:47:29 | gokr | Unos 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:31 | demi- | 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:42 | gokr | demi-: Good :) |
00:48:02 | gokr | rauss: Yeah, well, I hope so. |
00:48:17 | demi- | swift is still evolving and is extremely overburdened with keywords and boilerplate syntax |
00:48:20 | gokr | rauss: What platforms are you interested in? |
00:48:41 | gokr | demi-: Do you know of any other contender? |
00:48:43 | rauss | gokr: I have been coding in C++ for an arduino nano project, and would love to use nim |
00:49:47 | demi- | gokr: not that i am aware of, there is swift (and derivatives), rust, go, nim, ¯\_(ツ)_/¯ |
00:50:00 | demi- | and the older statically typed languages i guess |
00:50:13 | gokr | demi-: I wouldn't really consider rust (I want a GC). |
00:50:21 | krux02 | the new homepage of nim doesn't even mention that nim can do metaprogramming |
00:50:26 | rauss | I 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:42 | gokr | rauss: Wrapping C libs is trivially easy. |
00:50:51 | ldlework | gokr: will you wrap sdl-gpu pls |
00:50:58 | gokr | Wrapping C++ libs is harder, but Araq has done most of the heavy lifting. |
00:51:00 | demi- | ah i see, yeah i don't know then, i'm not much of a language enthusiast |
00:51:01 | rauss | gokr: Right, but running the wrapped code on an AVR is not :) |
00:51:02 | krux02 | gokr: no it's more a "it depends" thing |
00:51:09 | krux02 | wrapping C is not generally easy |
00:51:34 | gokr | krux02: Well, ok, sure. But for the libs I have tried I wouldn't say it was that hard. |
00:51:56 | krux02 | try to wrap open dynamics engine |
00:52:09 | krux02 | or something with callbacks |
00:52:49 | krux02 | but anyway good night folks |
00:52:50 | * | krux02 quit (Remote host closed the connection) |
00:53:14 | gokr | callbacks doesn't have to be hard. But sure, it all depends. |
00:53:28 | ldlework | nah wrap sdl-gpu plsss |
00:54:17 | gokr | rauss: What are you doing with the nano? |
00:54:43 | FromGitter | <Varriount> zachcarter: Hows progress going on the game? |
00:54:53 | gokr | rauss: 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:56 | zachcarter | Varriount: almost done i think, adding enemy bombs now |
00:55:23 | FromGitter | <Varriount> zachcarter: I trust you were able to convert the tracker module into something playable? |
00:55:23 | zachcarter | going to try to finish it tonight |
00:55:26 | rauss | gokr: I'm working with this library ( https://github.com/NicoHood/Nintendo ) to mess with signals to/from the gamecube |
00:56:03 | zachcarter | I haven’t tried yet but that’s on my short list |
00:56:12 | gokr | rauss: cool |
00:56:21 | rauss | zachcarter: We should add a link to the new discourse on the website |
00:56:41 | gokr | rauss: Any reason you couldn't use a slightly stronger thingy? |
00:56:45 | zachcarter | we can - I was going to do some clean up on it first, just haven’t gotten around to it yet |
00:57:11 | FromGitter | <Varriount> discourse? |
00:57:13 | zachcarter | http://community.fragworks.io/ |
00:57:14 | rauss | gokr: Size, and the fact that the Nano works perfectly for this when nim isn't in the picture |
00:57:36 | gokr | My fav right now it the ESP32 Thing from Sparkfun. |
00:57:49 | FromGitter | <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:01 | zachcarter | yeah I was going to try to go for ogg |
00:58:02 | gokr | rauss: I actually have a few nanos here too. |
00:58:02 | zachcarter | if possible |
00:58:29 | gokr | rauss: 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:15 | rauss | gokr: 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:41 | zachcarter | Varriount: I’m thinking about working on a little repl type thing for a nim playground for the website too |
01:00:10 | FromGitter | <Varriount> Yeah, I saw |
01:00:21 | gokr | I could give it a shot |
01:00:28 | rauss | :D:D:D::D:D:D:D:D:D :D |
01:00:33 | zachcarter | looking forward to that |
01:00:53 | gokr | Since I do plan on working on the Moteino - it's the same Atmega328p. |
01:01:02 | rauss | Right |
01:02:11 | gokr | I should sleep now though. But bug me here regularly :) |
01:02:32 | rauss | Will 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:14 | gokr | Araq: etcpriv? |
01:17:31 | * | gangstacat quit (Quit: Ĝis!) |
01:17:34 | gokr | seems 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:01 | zachcarter | cool space invaders is pretty much done minus levels |
02:07:04 | pydsigner | Grats |
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:56 | zachcarter | thanks |
02:48:22 | zachcarter | Idlework: are you around? |
02:48:53 | ldlework | zachcarter: its ldlework to you mr. |
02:49:01 | ldlework | whats up |
02:49:12 | zachcarter | I have a question about Docker |
02:49:48 | zachcarter | ah nm I think I just figured it out |
02:49:56 | ldlework | glad I could help. |
02:49:59 | zachcarter | I was looking for data volumes :P |
02:50:00 | ldlework | summon my presence anytime. |
02:50:04 | zachcarter | lol 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:16 | zachcarter | Varriount: are you around by any chance? |
04:11:16 | FromGitter | <Varriount> zachcarter: yes |
04:11:45 | zachcarter | o/ do you have any ideas on how I might achieve this playground thing - in terms of hosting the compiler |
04:13:04 | zachcarter | I was thinking of using docker but demi- was suggesting a repl like interface |
04:13:09 | zachcarter | not sure it would be responsive enough for that |
04:13:10 | FromGitter | <Varriount> Hm. |
04:13:32 | FromGitter | <Varriount> Well, docker + limiting the stdlib would probably help. |
04:13:42 | zachcarter | okay |
04:13:52 | zachcarter | I can give that a shot |
04:14:08 | zachcarter | think I have a basic idea of how to do this |
04:14:15 | zachcarter | going to give it a go and see what happens |
04:15:23 | zachcarter | thanks for the suggestion |
05:01:06 | gangstacat | on 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:25 | FromGitter | <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:06 | FromGitter | <Bennyelg> Printable of the book is already available right? |
06:48:36 | * | Tiberium joined #nim |
06:51:36 | * | gokr joined #nim |
06:54:08 | FromGitter | <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:08 | FromGitter | <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:33 | FromGitter | <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:48 | Guest17309 | Hey |
07:00:39 | dom96 | zachcarter: 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:26 | dom96 | i.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:30 | Guest17309 | O |
07:01:48 | dom96 | Bennyelg: not yet. |
07:02:03 | * | Guest17309 is now known as BennyElg |
07:02:44 | dom96 | zachcarter: 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:48 | dom96 | *give me |
07:02:51 | BennyElg | Just now I bought it anyway. |
07:02:58 | dom96 | BennyElg: thanks :) |
07:03:22 | BennyElg | Cheers! Hope to switch from python to Nim fast :D |
07:03:33 | FromGitter | <mratsim> agree with dom96 :) |
07:03:47 | ldlework | +1 |
07:03:50 | BennyElg | @dom96 are you from germany ? |
07:04:20 | Tiberium | how to get "ptr" of the first element in array? |
07:04:37 | Tiberium | addr(data[0]) ? |
07:04:40 | FromGitter | <mratsim> add your array[0] |
07:04:44 | FromGitter | <mratsim> add* |
07:04:49 | FromGitter | <mratsim> addr |
07:04:59 | FromGitter | <mratsim> yes |
07:06:37 | Tiberium | basically I want to make something like https://github.com/codeplea/tinyexpr#binding-to-custom-functions |
07:06:54 | dom96 | BennyElg: Nope, Polish but lived in the UK for most of my life |
07:06:56 | dom96 | bbl |
07:07:11 | Tiberium | but 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:17 | Tiberium | ah, nvm |
07:07:29 | Tiberium | ok, can I get name of function in proc that accepts function? |
07:07:47 | FromGitter | <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:21 | Tiberium | it works for me |
07:08:37 | Tiberium | but there's another problem: get name of proc passed into my proc |
07:08:44 | Tiberium | I have "proc genFunc[T](fun: T): te_variable = " |
07:09:10 | Tiberium | and I want to know the name of "fun" (it would be a proc, but with different number of args) |
07:09:25 | Tiberium | ah, nevermind |
07:09:34 | Tiberium | I'll just add new argument to my proc - funcName: cstring |
07:10:29 | FromGitter | <mratsim> you may be able to use astToStr |
07:11:35 | FromGitter | <mratsim> found that:https://stackoverflow.com/questions/31565006/how-to-get-string-representation-of-an-expr-in-nim-template |
07:11:57 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58f85f40d32c6f2f09222b5b] |
07:13:10 | gangstacat | dom96, do you want a PR for what I spoke about? |
07:13:54 | Tiberium | mratsim: astToStr just gives me "fun" which is name of argument in proc |
07:14:51 | FromGitter | <mratsim> not inside the function, use a wrapper function that can call asttostr |
07:15:21 | BennyElg | dom96: Nice I'm working on Gett (Former gettaxi if you ever hear of them) |
07:15:24 | FromGitter | <mratsim> Here is an example: https://github.com/mratsim/nimfp/blob/master/config.nims |
07:16:06 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58f860398fcce56b201bfd55] |
07:16:30 | couven92 | BTW, 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:53 | FromGitter | <mratsim> instead of exec nim you could use a let func_name =, and then use that as input to your function |
07:17:08 | FromGitter | <mratsim> so you don’t have to add that manually everywhere |
07:17:18 | couven92 | Question is: Is a hardlink better than batch file? |
07:17:42 | FromGitter | <mratsim> There is hardlinks on windows :O ? |
07:17:56 | couven92 | @mratsim yes there is |
07:18:46 | * | chemist69 quit (Ping timeout: 260 seconds) |
07:18:48 | couven92 | @mratsim `MKLINK /?` will tell you that `/H` creates a hardlink instead of a symlink |
07:19:09 | Tiberium | mratsim: 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:11 | FromGitter | <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:19 | Tiberium | can I make this a "case" statement somehow? https://gist.github.com/TiberiumN/f19f2c989ec564ca9ce33f1cbc19c4de |
07:25:23 | FromGitter | <mratsim> is the input a vararg? |
07:25:48 | FromGitter | <mratsim> if yes you can use case varargs.len: ⏎ of: |
07:25:55 | Tiberium | mratsim: I have a generic proc (to accept procs with different number of args) |
07:26:08 | Tiberium | ah, maybe I can get number of proc arguments? |
07:26:25 | Tiberium | proc genFunc[T](fun: T, name: cstring): te_variable = |
07:32:32 | Tiberium | ok, 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:57 | Tiberium | can 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:29 | Tiberium | I can only think of "if someFloat == float(int(someFloat)):" |
07:48:15 | ldlework | Tiberium: https://nim-lang.org/docs/math.html#floor,float64 |
07:48:48 | * | couven92 quit (Read error: Connection reset by peer) |
07:49:11 | Tiberium | ldlework, "if someFloat == floor(someFloat):" ? |
07:49:43 | ldlework | sure |
07:49:57 | BennyElg | how do I request.get("someURL") on Nim |
07:50:23 | ldlework | BennyElg: did you look in the available libraries? |
07:50:45 | BennyElg | I am still pretty new to all (2nd day of investigrating) |
07:50:48 | Tiberium | BennyElg, getContent in httpclient |
07:50:52 | BennyElg | investigating |
07:51:02 | Tiberium | but it's not high level as requests is |
07:51:04 | BennyElg | Thanks I'll get look into the Nimble thing |
07:51:09 | Tiberium | it's not nimble |
07:51:11 | Tiberium | it's in stdlib |
07:51:25 | Tiberium | BennyElg, https://nim-lang.org/docs/httpclient.html |
07:51:27 | ldlework | BennyElg: https://nim-lang.org/docs/lib.html |
07:51:48 | BennyElg | Oh, 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:36 | ldlework | BennyElg: That is what nimble is. He's telling you that httpclient is a standard library. |
07:52:42 | ldlework | Not a third party package installed with Nimble. |
07:52:46 | ldlework | IE, you already have it. |
07:53:11 | * | gokr quit (Ping timeout: 252 seconds) |
07:53:20 | Tiberium | BennyElg, 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:26 | Tiberium | so I can live without these easily |
07:53:33 | Tiberium | and depend only on stdlib |
08:12:42 | Tiberium | zachcarter, hi, what do you use for gif recording? |
08:19:40 | euantor | You probably don't even need colorize: https://nim-lang.org/docs/terminal.html#setForegroundColor.t,ForegroundColor |
08:20:00 | Tiberium | euantor, colorize is just easy to use :) |
08:20:06 | Tiberium | "my string".fgRed.bold |
08:20:14 | euantor | Perfectly good reason :) |
08:20:18 | Tiberium | would produce red and bold string |
08:20:26 | Tiberium | and it can be evaluated at compile time |
08:20:57 | Tiberium | because fgRed and bold are just procs which accept string and return string |
08:21:37 | Araq | does colorize work on Windows? |
08:21:53 | Tiberium | Araq, probably it doesn't |
08:22:03 | Tiberium | because it just emits ANSI color codes |
08:22:24 | Tiberium | it should work in powershell |
08:22:27 | Tiberium | but not in default cmd |
08:22:41 | Tiberium | but anyway powershell will become default cmd in windows |
08:23:21 | * | yglukhov joined #nim |
08:24:26 | Araq | well you can always patch echo to translate color codes into Win API calls |
08:24:53 | Tiberium | Araq, wait, so "terminal" works on both windows and linux ? |
08:25:03 | Araq | of course it does. |
08:25:25 | Araq | but I doubt colorize does. |
08:25:41 | Tiberium | Araq, it doesn't |
08:25:46 | Tiberium | (I mean not in default cmd) |
08:26:05 | Araq | but hey, unportable code is sexy when you do it to fight evil M$ |
08:26:35 | Tiberium | Araq, 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:52 | Tiberium | "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:39 | Tiberium | and powershell supports ansi codes |
08:28:14 | Tiberium | Araq, but thanks for info about terminal! |
08:28:14 | Araq | I use a custom command prompt on Windows not Powershell ;-) |
08:28:28 | Araq | Powershell is stupid. |
08:28:36 | Tiberium | custom? |
08:29:01 | Araq | forgot its name, but it can do constrol-cursor to jump over words |
08:29:06 | Araq | *control |
08:29:18 | Tiberium | btw, there's powershell for mac and linux |
08:29:27 | Araq | making it more pleasant to use than anything I ever found for Unix. |
08:29:41 | Tiberium | under MIT license https://github.com/powershell/powershell |
08:30:01 | euantor | I 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:02 | Tiberium | Araq, you mean "ctrl+left arrow" or "ctrl+right arrow" ? |
08:31:19 | Tiberium | because in my oh-my-zsh I have this feature |
08:34:15 | Araq | yeah :-) |
08:35:33 | Tiberium | ah, and some distros seems to provide mappings for "ctrl+left/right arrow" too |
08:35:34 | Tiberium | http://stackoverflow.com/questions/5029118/bash-ctrl-to-move-cursor-between-words-strings |
08:36:23 | Tiberium | ah, 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:34 | FromGitter | <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:24 | zachcarter | dom96: I’m a quarter Polish :P maternal grandparents last name is Pawenski :) |
11:44:40 | zachcarter | anywho do you think using docker to compile and run the code is the right way to go? |
11:45:02 | ldlework | yes |
11:45:05 | zachcarter | Tiberium: 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:15 | zachcarter | okay 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:39 | FromGitter | <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:42 | euantor | Yeah, 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:26 | Tiberium | btw, about "More examples at RosettaCode…" - some of them doesn't work |
12:44:29 | * | BennyElg quit (Remote host closed the connection) |
12:44:35 | Tiberium | for example because "typeless arguments are obsolete" |
12:46:13 | tankfeeder | fix it |
12:46:22 | Tiberium | yep |
12:46:59 | * | yglukhov joined #nim |
12:52:22 | Tiberium | btw, I don't like slowness of rosetta code :( |
12:52:29 | Tiberium | pages load slowly |
12:53:07 | tankfeeder | they under cloudflare, its ok |
12:53:31 | Tiberium | not for me |
12:53:38 | Tiberium | for me wikipedia is 3x faster than rosetta code |
12:57:03 | tankfeeder | wgy you compare ? |
12:57:05 | tankfeeder | why |
12:57:09 | tankfeeder | forget it |
12:57:32 | Tiberium | but really, rosetta code is annoyingly slow |
12:57:49 | * | vivus quit (Quit: Leaving) |
12:59:17 | Tiberium | wat |
12:59:21 | Tiberium | "proc sqrt*(x: int64): float {.importc: "sqrt", header: "<math.h>".}" |
12:59:35 | Tiberium | there wasn't sqrt in "math" stdlib module some time ago? |
13:03:12 | * | BennyElg joined #nim |
13:03:14 | tankfeeder | https://nim-lang.org/docs/math.html#sqrt,float32 |
13:03:49 | BennyElg | Nim In action (Reading in progress - semi review: Great book - recommended) |
13:04:39 | tankfeeder | nothing special :) |
13:05:28 | Tiberium | tankfeeder, 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:09 | dom96 | BennyElg: Glad you like it :) |
13:49:25 | * | krux02 joined #nim |
13:53:45 | * | BennyElg joined #nim |
13:56:11 | Tiberium | how to make this work? https://gist.github.com/TiberiumN/a636674dbe6d6cdced38b18fe5a66db2 |
13:56:23 | Tiberium | "Error: undeclared identifier: 'msg'" |
13:56:50 | Tiberium | call.handle is a call for my proc, problem isn't there |
13:57:27 | Tiberium | in base.nim there's some imports, including "meta.nim" |
13:58:00 | Tiberium | hmm |
13:58:04 | Tiberium | {.dirty.} helped |
14:00:31 | dom96 | you need to use the inject pragma |
14:00:43 | dom96 | try applying it to the parameter |
14:01:32 | Tiberium | dom96, how? proc call(api {.inject.}: VkApi) {.async.} like this? |
14:01:45 | dom96 | no idea |
14:02:02 | Tiberium | dom96, ah, you mean after "command" I need to inject two variables? |
14:04:17 | Tiberium | dom96, 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:29 | Tiberium | I mean not users, but commands :) |
14:04:38 | Tiberium | (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:51 | dom96 | dirty is deprecated though IIRC |
14:19:51 | Tiberium | dom96, why? |
14:21:46 | * | tankfeeder quit (Quit: Leaving) |
14:30:29 | Tiberium | oh no, I've met same issue - https://github.com/nim-lang/Nim/issues/4753 |
14:31:08 | Tiberium | the 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:34 | Tiberium | so how to define a proc in template with a unique name? |
14:33:40 | Tiberium | random doesn't work at compile time |
14:33:53 | Araq | dirty is not deprecated. |
14:33:54 | adeohluwa | Araq: custom shell on WIN baboon? cygwin? |
14:39:46 | * | BennyElg quit (Remote host closed the connection) |
14:52:14 | zachcarter | dom96: is using threadpool with asyncdispatch okay? |
14:55:53 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:58:36 | dom96 | zachcarter: yes |
14:58:50 | zachcarter | alright 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:36 | FromGitter | <Varriount> zachcarter: You still can't magically have memory cross thread boundaries easily |
15:27:47 | zachcarter | right |
15:33:46 | * | zachcarter quit (Quit: zachcarter) |
15:40:23 | dom96 | wow, the new site launch has given us the biggest spike in visitors ever |
15:41:05 | PMunch | Nice! |
15:48:41 | * | PMunch quit (Quit: leaving) |
15:50:46 | * | Vladar joined #nim |
15:51:06 | Tiberium | dom96, can you share some stats? |
15:51:13 | Tiberium | just curious :) |
15:51:21 | demi- | dom96: it is a very nice new design :) |
15:52:45 | Tiberium | also 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:28 | Tiberium | nsf, wow, there's russian nim users :) |
15:54:41 | dom96 | Tiberium: What stats would you like? |
15:55:02 | dom96 | We had just under 25k page views yesterday |
15:55:07 | Tiberium | oh wow |
15:55:08 | Tiberium | nice then |
15:58:22 | Tiberium | dom96, 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:15 | euantor | Easy solution is to have a count, so the first time you create one it'll be `someproc1`, the next is `someproc2`, etc |
16:01:33 | nsf | Tiberium: I don't use vim, just linger here... |
16:01:42 | nsf | oops soory |
16:01:45 | Tiberium | nsf, :D |
16:01:46 | nsf | sorry* :) |
16:01:50 | nsf | typo, nim |
16:01:56 | nsf | but I don't use vim either |
16:04:18 | alectic | nsf: but do you plan to use it in the future or will you still prefer go for system tools? |
16:06:51 | Tiberium | euantor, and then I can define my proc like proc `name`(some args) ? |
16:09:07 | nsf | at the moment I don't plan anything |
16:09:12 | nsf | but nim is an interesting language |
16:10:09 | Tiberium | euantor, but how can I do count if I call template from different places? |
16:11:25 | Tiberium | euantor, ah, It seems I fixed it, but |
16:11:26 | alectic | nsf: 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:41 | Tiberium | euantor, "lib/pure/asyncmacro.nim(283, 10) Error: Unknown name. error("Unknown name.")" |
16:13:41 | nsf | alectic: 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:00 | nsf | alectic: for example race detector from sanitizer tools is very hard to use with C |
16:14:11 | nsf | because you need to recompile everything from scratch (including libc) |
16:14:18 | nsf | and in Go it's easy |
16:19:06 | nsf | to beat* |
16:19:45 | * | McSoFake quit (Ping timeout: 245 seconds) |
16:20:09 | * | zachcarter joined #nim |
16:21:04 | alectic | nsf: 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:45 | nsf | yes, it's a valid point |
16:22:26 | nsf | you do miss things like javascript's lodash in Go (or if you don't code in JS, .NET's LINQ) |
16:22:49 | nsf | and Go authors are aware of that problem |
16:22:58 | nsf | but I also understand why they are so hesitant about generics |
16:23:16 | nsf | and other forms of metaprogramming |
16:23:34 | nsf | programming languages allow you to express graphs on paper |
16:23:49 | nsf | adding meta to it, is like adding portals to 3d world you live in |
16:24:15 | nsf | but at the same time portals can be useful right |
16:24:16 | * | zachcarter_ joined #nim |
16:24:19 | nsf | if used carefully :D |
16:24:31 | Calinou | dom96: can you give me a screenshot of the Google Analytics stats please? :P |
16:24:36 | Calinou | (since site launch) |
16:24:37 | * | zachcarter quit (Ping timeout: 240 seconds) |
16:24:37 | * | zachcarter_ is now known as zachcarter |
16:25:58 | libman | alectic: 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:15 | alectic | nsf: 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:22 | alectic | libman: they have different philosophies and goals, in my eyes they don't compete |
16:28:25 | libman | And 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:26 | Calinou | http://www.commitstrip.com/en/2015/02/27/if-languages-were-cabs/ |
16:31:30 | Calinou | this too :P |
16:33:18 | Tiberium | libman, old website looked like "black magic" for me |
16:33:32 | Tiberium | I mean it was grey and black |
16:33:36 | libman | The new site looks like it was designed for people with phones, bleh. |
16:33:57 | Tiberium | libman, every second website looks like this today :) |
16:35:02 | Calinou | it's just modern design |
16:35:07 | Calinou | personally, I'm really fond of it |
16:35:22 | libman | Pay 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:23 | Calinou | design evolves daily, but most websites have looked like this since 2013-2014 |
16:35:28 | Calinou | (I've seen tons of flat redesigns back then) |
16:35:46 | Calinou | libman: "FINGER us at nim-lang.org!" |
16:35:49 | Calinou | instant success :) |
16:36:10 | * | libman ponders n1m.pl |
16:36:33 | Tiberium | http://nim.pl/ ? |
16:36:43 | Tiberium | wat |
16:36:49 | Tiberium | it says for me "welcome safari user" |
16:36:53 | Tiberium | but I'm a chrome user and I'm on mac |
16:36:57 | Tiberium | oh sh*t |
16:36:59 | Tiberium | I'm on linux |
16:37:16 | libman | Dat's why all my vaporware project names stick a number in them. |
16:38:12 | libman | Or n¡m (with inverted exclamation mark) |
16:38:28 | Tiberium | how can users type this? |
16:39:41 | libman | A 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 ¡ |
16:40:44 | Tiberium | libman, why editor? I thought we're talking about website |
16:41:38 | libman | A decent operating system would reuse the same editor component everywhere, including URL input. |
16:41:45 | FromGitter | <mratsim> He is off course browsing from his editor |
16:41:52 | FromGitter | <mratsim> of* |
16:42:00 | FromGitter | <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:46 | FromGitter | <mratsim> I don’t think Stallman would use Nim since it’s not GPLv3 |
16:42:47 | Calinou | just apt-get install beard |
16:43:00 | Calinou | Stallman uses plenty of permissively licensed software, btw |
16:43:11 | Calinou | the FSF even advises to use permissive licenses when your code is less than 300 lines |
16:43:27 | * | Matthias247 joined #nim |
16:43:38 | libman | I 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:06 | libman | Anyway, this should be in #nim-offtopic. |
16:44:09 | FromGitter | <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:38 | libman | Why not IRC? Voice communication is overrated. |
16:44:47 | Tiberium | voice communication is faster |
16:45:01 | Tiberium | because voice is our native feature |
16:45:10 | Tiberium | and typing on keyboard isn't :) |
16:45:16 | FromGitter | <mratsim> That was to organize a conference. With actual people, not dev ;) |
16:45:55 | libman | Faster != better. Imagine how much more annoying I would be if you had my undivided attention!?! |
16:46:13 | Tiberium | you still have possibility to write in the chat :D |
16:48:52 | libman | Here'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:07 | libman | HaikuOS 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:06 | libman | https://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:50 | FromGitter | <mratsim> Regarding gcc5, I really wonder when CUDA starts supporting higher version ... |
17:00:16 | libman | Nim 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:20 | FromGitter | <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:38 | libman | It's not for gamers, but normal GUI apps work fine. |
17:03:11 | FromGitter | <barcharcraz> idk most modern GUIs really benifit from at least like basic OpenGL 3.2 support |
17:03:20 | FromGitter | <barcharcraz> like modern compositors |
17:04:59 | libman | Also, 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:45 | FromGitter | <evacchi> does sending over a channel still causes a deep copy when using unmanaged ptrs ? |
17:09:32 | FromGitter | <evacchi> I am using a channel to pass a proc ptr around, but I fear memory is leaking |
17:09:51 | FromGitter | <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:18 | euantor | I'd prefer something like Alpine Linux + Nim or qubes + Nim |
17:17:38 | euantor | Alpine is nice and light for a phone OS, I haven't had any experience with Haiku |
17:35:42 | * | DungeonDude joined #nim |
17:36:11 | DungeonDude | does nim add any runtime checks when compiling signed integers to C? |
17:36:35 | DungeonDude | there is a lot of undefined behaviour with them, e.g. on overflows etc. |
17:36:52 | FromGitter | <barcharcraz> I would like alpine if it used systemd |
17:36:55 | FromGitter | <barcharcraz> but it does not |
17:37:31 | euantor | Some would see that as an advantage. I like systems personally, but it gets a lot of hate for some decent reasons |
17:38:21 | FromGitter | <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:02 | FromGitter | <Varriount> DungeonDude: Signed integers get overflow checks. |
17:46:04 | * | yglukhov quit (Remote host closed the connection) |
17:46:22 | FromGitter | <Varriount> I'm not sure about unsigned integers. |
17:46:31 | FromGitter | <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:08 | FromGitter | <Varriount> I never did understand why C was designed to allow narrowing conversions implicitly. |
17:47:12 | DungeonDude | C is so full of undefined features, i wonder how many of them nim abstracts away :S |
17:47:28 | FromGitter | <barcharcraz> I mean you can sorta see why when using a C API from nim |
17:47:33 | FromGitter | <Varriount> DungeonDude: The compiler turns off strict aliasing too |
17:48:32 | FromGitter | <barcharcraz> wow windows subsystem for linux is actually pretty neat |
17:49:14 | Tiberium | yep |
17:49:25 | Tiberium | I've also installed oh-my-zsh with agnoster |
17:49:29 | Tiberium | and special terminal emulator |
17:49:58 | FromGitter | <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:06 | FromGitter | <barcharcraz> I had forgotten I had vcxsrv running |
17:50:48 | Tiberium | but there's no graphic acceleration :( |
17:50:54 | Tiberium | for cuda |
17:50:59 | Tiberium | or for simple gui |
17:51:02 | FromGitter | <barcharcraz> really |
17:51:06 | Tiberium | yep |
17:51:11 | FromGitter | <barcharcraz> I thought xming and vcxsrv supported glx |
17:51:19 | FromGitter | <barcharcraz> but I guess if you can't find the device |
17:51:20 | Tiberium | wsl doesnt support it |
17:51:25 | * | gokr2 joined #nim |
17:51:25 | FromGitter | <barcharcraz> yeah |
17:51:36 | Tiberium | you can run opengl |
17:51:41 | Tiberium | but with software acceleration |
17:52:19 | FromGitter | <barcharcraz> :( |
17:53:59 | DungeonDude | Does idiomatic string handling in nim treat strings like byte arrays? |
17:54:06 | DungeonDude | eg iterating, indexing |
17:57:33 | FromGitter | <Varriount> DungeonDude: yes |
17:58:04 | FromGitter | <Varriount> There are procedures for handling utf8 encodings though. |
17:58:22 | DungeonDude | why is this a default? this makes it too easy to mess up utf8 strings. |
17:58:55 | libman | Nim 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:56 | FromGitter | <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:15 | FromGitter | <Varriount> Also, utf8 isn't the only encoding that exists. |
18:02:49 | FromGitter | <Varriount> Furthermore, Nim tends to interact quite a bit with C libraries, which expect C character arrays. |
18:03:24 | DungeonDude | so it null-terminates them all the time, or only when passing to C? This would make splitting expensive |
18:04:13 | FromGitter | <Varriount> Strings are automatically null terminated, which is cheap (only a single character's worth or storage used). |
18:04:30 | FromGitter | <Varriount> However, the string data structure also contains a length field. |
18:04:42 | DungeonDude | yes but this forbids splitting by just pointing into another string + capping length |
18:05:14 | FromGitter | <Varriount> DungeonDude: Which you can't do anyway, because Nim's strings are mutable, variably sized arrays. |
18:05:34 | DungeonDude | doesn't it have slices? |
18:05:48 | FromGitter | <Varriount> Yes. Slicing creates a new string. |
18:06:02 | * | FromGitter * Varriount waits for looks of horror. |
18:06:41 | DungeonDude | allocation minesweeper :P |
18:07:06 | FromGitter | <Varriount> DungeonDude: As much as I might wish differently, this is how Nim's strings are. |
18:07:19 | FromGitter | <Varriount> In practice, it's more of a pitfall to new programmers than anything. |
18:07:35 | Araq | Java switched from O(1) slices to O(n) slices fwiw |
18:07:51 | Araq | Python never had O(1) slicing but people think it has so it's fine |
18:07:56 | zachcarter | dom96: is it possible to check whether request.formData contains a key with Jester? |
18:08:19 | FromGitter | <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:19 | DungeonDude | i like how d has cheap slices. But its standard lib is full of hidden gc allocatins :S |
18:08:34 | FromGitter | <Varriount> DungeonDude: What do you mean by hidden? |
18:09:28 | DungeonDude | a lot of standard functions allocate internally via the gc, even if its not obvious to the caller. Which wastes cpu cycles |
18:10:17 | FromGitter | <Varriount> DungeonDude: You might not like Nim's standard library then. The developer's aren't shy about using the garbage collector. |
18:11:12 | FromGitter | <Varriount> I mean, it's not used willy-nilly either, but there's very little manual memory management used. |
18:12:16 | DungeonDude | well nim devs also don't discourage new users to avoid the gc like the plague |
18:12:55 | FromGitter | <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:01 | Araq | it's also thread local, call GC_disable and treat it as a memory region that is freed when the thread dies. |
18:19:48 | DungeonDude | is nimble like the CMake equvalent for nim? Or should i use nake/nim c/...? |
18:20:26 | demi- | i'd use nimble for building libraries or executables |
18:20:33 | demi- | makes distribution much easier |
18:21:11 | demi- | i'm not sure i see a need for nake outside preference tbh |
18:21:49 | Tiberium | DungeonDude, nimble is like pip |
18:21:59 | DungeonDude | never used pip |
18:22:12 | Tiberium | same as almost any language package manager |
18:22:20 | DungeonDude | i only had trouble with language package managers |
18:22:27 | Tiberium | lol, why? |
18:23:29 | DungeonDude | they 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:02 | DungeonDude | im glad nimble uses at least https trough git |
18:24:39 | Araq | ^^ yep. 20 different versions of the same library is a problem. :-) |
18:25:03 | demi- | hopefully not, so long as the dep manager versions properly :) |
18:25:20 | DungeonDude | and 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:51 | DungeonDude | i 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:19 | DungeonDude | if nimble builds your projects, how does koch differ? |
18:29:54 | demi- | koch is specifically for building nim compiler and tools |
18:29:57 | Tiberium | DungeonDude, look at this for node.js horror : https://github.com/jonschlinkert?utf8=%E2%9C%93&tab=repositories&q=color&type=&language= |
18:30:10 | Tiberium | also 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:38 | Tiberium | https://github.com/jonschlinkert/ansi-green/issues/1#issuecomment-250623396 12 million downloads of ansi-wrap and ansi-green |
18:30:51 | DungeonDude | Is this serious? Or some "parody" like fizzbuzz enterprise |
18:30:56 | Tiberium | yep it is |
18:30:59 | Tiberium | 12kk downloads man |
18:31:05 | Tiberium | maybe it's because JS doesn't have dead code elimination |
18:32:36 | DungeonDude | this 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:57 | Tiberium | hopefully I don't use node.js |
18:34:06 | Tiberium | I find JS syntax too much noisy for me |
18:34:10 | DungeonDude | i guess when this dude ships his `print-color.sh`, he compiles in a webserver, his ide and half a web browser :S |
18:34:59 | federico3 | can I cast a packed object into a string? How? |
18:43:13 | zachcarter | dom96: I have a working prototype of the playground thing |
18:43:33 | zachcarter | going to get it hosted now |
18:43:39 | Tiberium | zachcarter, yay |
18:44:17 | zachcarter | :D |
18:44:30 | * | yglukhov quit (Remote host closed the connection) |
18:45:04 | * | yglukhov joined #nim |
18:46:58 | dom96 | zachcarter: awesome :D |
18:47:03 | dom96 | that was quick :) |
18:47:17 | zachcarter | well it’s not very feature rich yet but I think it works and it was pretty easy |
18:47:25 | zachcarter | we’ll know soon :) |
18:48:16 | Tiberium | zachcarter, pls link |
18:48:22 | zachcarter | will do as soon as I get it up |
18:48:22 | euantor | Is it possible to use await within a template? I'm getting `undeclared identifier: 'await'` |
18:49:15 | dom96 | euantor: not currently, you can use 'yield' though |
18:49:26 | * | yglukhov quit (Ping timeout: 260 seconds) |
18:49:44 | euantor | ah, ok thanks |
18:49:51 | zachcarter | http://imgur.com/a/qpXt9 |
18:50:47 | euantor | Not 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:27 | Tiberium | euantor, zachcarter posted his image about nim playground, not about your problem :) |
18:51:40 | euantor | Yeah, 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:06 | euantor | Ah, never mind I've worked it out :) |
18:55:44 | dom96 | zachcarter: 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:49 | zachcarter | not yet |
19:03:00 | zachcarter | bout to put it up |
19:06:50 | FromGitter | <Varriount> federico3: You'll have to use memory copying routines to copy the data into a string. |
19:06:56 | euantor | Any ideas what this might mean dom96: `internal error: expr: var not init dummyValFuture_216164`? |
19:07:10 | euantor | https://www.irccloud.com/pastebin/FhaBfNOZ/ |
19:07:23 | FromGitter | <Varriount> zachcarter: What is that interface? |
19:07:29 | zachcarter | postman |
19:07:33 | dom96 | euantor: It's a compiler bug |
19:07:38 | Tiberium | Varriount: there's also "Advanced rest client" for Chrome |
19:07:40 | euantor | yay! |
19:08:05 | Tiberium | it does something like postman does |
19:08:30 | federico3 | Varriount: copyMme(addr mystring, addr myobj, size) ? |
19:09:31 | FromGitter | <Varriount> federico3: Yes |
19:09:43 | FromGitter | <Varriount> federico3: Don't forget to add the null byte |
19:10:12 | FromGitter | <Varriount> federico3: Although, wouldn't raw data from an object be better put in a sequence? |
19:12:16 | federico3 | Varriount: I'm trying to pack/unpack a simple binary protocol, I'm open to suggestions. seq[uint8] ? |
19:12:35 | FromGitter | <Varriount> federico3: Yep. |
19:15:39 | * | TheLemonMan joined #nim |
19:23:44 | zachcarter | dom96: 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:09 | zachcarter | https://github.com/zacharycarter/nim-playground |
19:26:53 | DungeonDude | was anyone of you a die-hard C++ fan before converting to nim? |
19:28:28 | Tiberium | ehh, still no success creating unique name in a template |
19:28:46 | Tiberium | how 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:08 | FromGitter | <Varriount> Tiberium: https://nim-lang.org/docs/macros.html#genSym,NimSymKind,string ? |
19:37:11 | Tiberium | Varriount: something like this fails to compile - https://gist.github.com/TiberiumN/188ce2e7cba325e8402c1a9f0a20aa08 |
19:37:41 | Tiberium | ah LOL |
19:37:58 | Tiberium | I need to do "newNimNode(nnkStmtList)" |
19:38:07 | Tiberium | aaand still fails |
19:38:10 | Tiberium | maybe because async? |
19:38:51 | Tiberium | https://gist.github.com/TiberiumN/0e4db1bbc70ff2a4333ff986d21ab64e |
19:39:17 | Trustable | Hi 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:34 | FromGitter | <Varriount> Trustable: What's the calling convention you're targetting? |
19:42:07 | Trustable | I'm on Linux AMD64 |
19:42:44 | FromGitter | <Varriount> Trustable: Need more information. cdecl? |
19:43:25 | Trustable | I don't know. How do I find out? |
19:43:29 | Tiberium | Trustable, you need pointer for C func? |
19:43:38 | Tiberium | to pass your nim proc to C function? |
19:43:46 | Trustable | yes |
19:43:56 | Tiberium | in my code I have |
19:44:13 | Tiberium | type MyFunc = proc(a: cdouble): cdouble {.cdecl.} |
19:44:25 | Tiberium | then |
19:44:59 | Tiberium | var funcPointer: MyFunc = myfunc |
19:45:02 | FromGitter | <Varriount> https://glot.io/snippets/ep4gy5b78y |
19:45:03 | Trustable | Tiberium, thanks, this works :) |
19:45:42 | Tiberium | https://gist.github.com/TiberiumN/0e4db1bbc70ff2a4333ff986d21ab64e can this be a bug in async support? |
19:46:14 | Trustable | but why do I have to make it cdecl, to cast it to a pointer? |
19:46:48 | Tiberium | Trustable, because you will need to pass it to C function? |
19:47:18 | Tiberium | https://en.wikipedia.org/wiki/Calling_convention |
19:48:05 | Trustable | the 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:16 | Tiberium | Trustable, why wouldn't you just pass it then? |
19:49:32 | Tiberium | proc callMe(myproc: proc (a, b: int): int) |
19:49:48 | Tiberium | so you would call it like callMe(myproc) if myproc has proc (a, b: int): int declaration |
19:50:01 | Tiberium | no pointers required? |
19:50:12 | Tiberium | (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:01 | freevryheid | howto get the type of another type defined as, say type A = array[2, T] |
19:58:25 | Tiberium | freevryheid, maybe you want to switch on types, not just get them? |
19:58:59 | DungeonDude | isn't it a bit heavy to have all packages in one gigantic json file? |
19:59:18 | Tiberium | DungeonDude, it would change as I heard |
19:59:32 | Tiberium | DungeonDude, but nim has a few packages (~ 500), so it's only 300-400kb json |
20:00:38 | demi- | 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:55 | DungeonDude | if anyone can submit a pull request, is there any form of quality control of what gets in there, or not? |
20:01:44 | demi- | sorry? you mean like how nim-like they are or how useful? |
20:02:00 | Tiberium | demi-, maybe he meant if some libraries can be like "rm -rf /" |
20:02:13 | demi- | oh, i see |
20:02:34 | demi- | they get reviewed by someone on the dev team before they get merged |
20:02:34 | DungeonDude | or maybe verify commits if signed. |
20:02:39 | * | DungeonDude puts on tinfoil hat |
20:02:50 | * | Mat4 quit (Quit: Mat4) |
20:02:55 | Tiberium | DungeonDude, probably dom96 quickly looks at source code |
20:03:19 | Tiberium | you know, its the same as buildbot of #pypy project, which has no password protection from stopping/starting builds |
20:03:48 | Tiberium | but nobody tries to grief it |
20:04:00 | Tiberium | same with nim probably :) |
20:04:43 | def- | 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:26 | Tiberium | def-, oh, I don't like rosetta code (I like the idea) :) it's sloooow, much slower than typical web pages |
20:05:54 | DungeonDude | it just would be nice to have some chain of trust so i can unlearn my fear of insecure package managers |
20:06:39 | Tiberium | def-, https://gtmetrix.com/reports/rosettacode.org/kpABtIyD 2.5 sec here, |
20:06:58 | Tiberium | is their webserver is so slow? |
20:07:38 | Tiberium | TTFB 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:29 | DungeonDude | how does nims expressiveness/concisenes compare to scheme's? |
20:24:02 | * | Vladar quit (Quit: Leaving) |
20:24:33 | ldlework | I wouldn't say expresiveness is the same as conciseness |
20:24:44 | ldlework | that said, Nim is both expressive and relatively consice |
20:25:09 | DungeonDude | dynamic typing kills lisps for me :S |
20:25:11 | ldlework | Scheme 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:15 | ldlework | Quest over :) |
20:27:30 | ldlework | Though... I admit to writing nothing but TypeScript for the last week! :O |
20:27:37 | DungeonDude | i hope so. Tomorrow i will invest some serious time into nim |
20:27:45 | ldlework | DungeonDude: what do you want to use it for |
20:28:29 | DungeonDude | messing around with small opengl games, automating my linux, writing tools like keystroke launchers, ... |
20:29:36 | ldlework | cool |
20:30:15 | FromGitter | <TiberiumPY> https://github.com/mame/quine-relay |
20:30:24 | FromGitter | <TiberiumPY> There's nim too |
20:30:25 | ldlework | DungeonDude: 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:40 | ldlework | Dunno if that interests you |
20:30:53 | ldlework | DungeonDude: kinda like sdl-gpu but for nim |
20:31:17 | DungeonDude | im a person with ideas, energy and motivation but no time :( |
20:31:37 | ldlework | Welcome to the club of everyone else. :) |
20:32:00 | freevryheid | this seems to work, the type of a type is T.T |
20:32:46 | DungeonDude | ldlework: i planned my own game engine for years, and already designed my own language on paper. But ... |
20:34:05 | ldlework | DungeonDude: just make managable contributions to my thing instead :) |
20:34:26 | DungeonDude | i will write that down on my todo list. See you in march 2019 |
20:34:31 | ldlework | ;) |
20:34:38 | * | couven92 joined #nim |
20:35:47 | DungeonDude | which is almost as long as my list of unfinished projects |
20:39:06 | * | chemist69 quit (Ping timeout: 260 seconds) |
20:40:56 | DungeonDude | how difficult is it, to write nim plugins intended to be loaded at runtime into a running nim program? |
20:41:43 | demi- | probably not terribly hard, i wrote a harness for doing that the other day, it is in nimble now |
20:46:09 | zachcarter | I’m slowly getting there with ngnix, docker compose, etc... |
20:46:57 | ldlework | ask for help if you need it |
20:47:11 | zachcarter | thanks 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:34 | FromGitter | <TiberiumPY> demi- , what's the name of this nimble library? |
21:03:31 | demi- | 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:11 | FromGitter | <TiberiumPY> Can it support async? |
21:04:33 | demi- | what do you mean by that? |
21:05:10 | FromGitter | <TiberiumPY> My callbacks needs to be async |
21:05:41 | * | chemist69 joined #nim |
21:05:43 | * | rauss quit (Quit: WeeChat 1.7) |
21:06:09 | demi- | 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:59 | demi- | so the hand-off between the app and the plugin isn't, but the plugin's work is expected to be async |
21:07:50 | demi- | does that make sense? |
21:09:37 | FromGitter | <TiberiumPY> Yes |
21:16:46 | zachcarter | Idlework: Can you have a docker container that has access to docker inside of it? |
21:17:19 | ldlework | zachcarter: yeah just bind the socket |
21:17:31 | ldlework | This is a bad idea if its the container running user code |
21:17:49 | * | bjz joined #nim |
21:18:02 | zachcarter | it’s not |
21:18:06 | zachcarter | it’s the container spinning that one up |
21:18:12 | * | ldlework nods |
21:18:25 | zachcarter | bind the socket hrm I’ll have to figure that one out, thank you |
21:20:05 | ldlework | zachcarter: -v /var/run/docker.sock:/var/run/docker.sock |
21:20:14 | zachcarter | ah thanks |
21:25:08 | zachcarter | need to figure out how to do this through docker compose |
21:25:28 | ldlework | zachcarter: compose lets you mount things |
21:25:36 | zachcarter | okay |
21:25:46 | ldlework | https://docs.docker.com/compose/compose-file/#volumes |
21:26:02 | zachcarter | thanks |
21:32:19 | zachcarter | would I then need to add docker to the path or anything to use it? I can’t seem to get it working |
21:33:26 | zachcarter | https://gist.github.com/zacharycarter/799e3578a11371e0448dd38bbf4acd21 |
21:33:29 | zachcarter | is my docker-compose.yml file |
21:34:08 | zachcarter | I’m calling docker inside the nim file that’s compiled inside the dockerfile but I’m getting : docker: command not found |
21:38:02 | ldlework | zachcarter: yeah docker needs to be installed inside the container |
21:38:14 | zachcarter | ah okay |
21:38:46 | zachcarter | thanks I’ll give doing that a shot |
21:38:49 | ldlework | zachcarter: otherwise you can talk to the docker daemon right through the socket |
21:38:52 | * | xmonader quit (Ping timeout: 258 seconds) |
21:38:55 | ldlework | via the docker api |
21:38:58 | demi- | i don't think you typically docker your docker |
21:38:59 | ldlework | not sure if there is a nim lib yet |
21:39:22 | ldlework | they are just running the binary as a subprocess |
21:39:25 | ldlework | it isn't docker-in-docker |
21:39:52 | zachcarter | demi-: I’m containerizing the app itself |
21:39:57 | zachcarter | which uses docker |
21:40:08 | zachcarter | this is so I can easily deploy it to digital ocean etc |
21:40:28 | zachcarter | hrm so I guess I’m going to install nim from source in this image along with docker then |
21:40:35 | zachcarter | err in this container I mean |
21:41:07 | ldlework | zachcarter: I would consider just using an http request to the socket |
21:41:47 | ldlework | if you're going to include the binary, there's probably no reason to build it from source |
21:41:52 | ldlework | Also why are you building Nim from source? |
21:42:02 | ldlework | There are already official Nim images |
21:42:04 | zachcarter | well presently I’m not |
21:42:06 | zachcarter | I’m using the nim image |
21:42:36 | zachcarter | okay I think I see what you mean / I’m doing wrong |
21:46:25 | icebattle | exit |
21:46:26 | icebattle | exit |
21:46:27 | icebattle | exit |
21:46:40 | * | icebattle quit (Quit: leaving) |
21:48:06 | FromGitter | <TiberiumPY> Wrong window? |
21:49:27 | ldlework | couldn'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:07 | zachcarter | hrm 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:07 | zachcarter | demi-: any suggestions? |
22:05:07 | * | xmonader quit (Ping timeout: 240 seconds) |
22:06:29 | ldlework | zachcarter: what do you mean about timeout? |
22:06:36 | zachcarter | the command timeout |
22:06:57 | zachcarter | I’m basically trying to restrict the length of execution of the docker container |
22:07:18 | ldlework | zachcarter: what's the problem with that? |
22:07:19 | zachcarter | it works |
22:07:38 | zachcarter | well I’m not sure how I’d use the command and issue a http request to the socket |
22:07:47 | ldlework | you mean httpclient? |
22:07:56 | zachcarter | I guess so :P |
22:08:14 | ldlework | zachcarter: just start the container |
22:08:21 | ldlework | then create a scheduled event inside your nim process |
22:08:26 | ldlework | and if the container is still runing at that point, kill it |
22:08:47 | krux02 | I changed the way I iterate over my entities, now I get a segfault in glUnmapNamedBuffer |
22:08:54 | krux02 | WTF |
22:09:24 | ldlework | two individual pieces of Nim code implementation that you think are functionally equivallent, usually isn't under Nim :( |
22:09:26 | zachcarter | Idlework it’s restricting the length of the container I’m spawning that I’m concerned with |
22:09:35 | ldlework | zachcarter: that's what I'm saying |
22:09:38 | zachcarter | oh |
22:09:52 | ldlework | just schedule a time when you will check if the container is still running, and then kill it if it is |
22:09:59 | zachcarter | oh with the httpclient |
22:10:08 | zachcarter | hrm okay |
22:10:35 | zachcarter | I’ll need to play around with the httpclient, this adds some complexity I wasn’t expecting |
22:10:35 | ldlework | zachcarter: Time to build nim-docker :) |
22:10:41 | zachcarter | ugh I really want to avoid that |
22:10:48 | zachcarter | or anything like it :P |
22:10:49 | krux02 | well I didn't use a container, I defined all entities as an iterator |
22:10:50 | ldlework | I mean you'd only need like three endpoints to implement your app |
22:10:57 | zachcarter | okay |
22:11:09 | ldlework | run, inspect and kill |
22:11:13 | krux02 | so I have an iterator that itself iterates |
22:11:14 | ldlework | maybe logs to get the logs |
22:11:16 | ldlework | :) |
22:11:19 | ldlework | so |
22:11:21 | ldlework | 4 |
22:13:18 | krux02 | well I got the problem |
22:13:18 | zachcarter | https://github.com/danielsuo/libdocker :) |
22:13:35 | ldlework | lmfao |
22:13:40 | krux02 | my iterator produces too many entities and that writes over the boundaries of my mapped buffer |
22:13:41 | ldlework | zachcarter: just build it in httpclient |
22:13:45 | zachcarter | yeah |
22:13:47 | ldlework | if you open source it I'll probably contribute later |
22:13:53 | ldlework | add more endpoints |
22:19:07 | * | Sentreen quit (Ping timeout: 240 seconds) |
22:19:15 | zachcarter | where are the docs on the http api? |
22:19:56 | ldlework | https://docs.docker.com/engine/api/v1.25/ |
22:20:15 | zachcarter | thanks |
22:20:56 | * | alectic quit (Quit: leaving) |
22:21:23 | krux02 | zachcarter: can it be that you wanted to make a tetris game example? |
22:21:39 | zachcarter | I can! I prety much am done with space invaders |
22:22:02 | krux02 | well I just did one in opengl-sandbox |
22:22:06 | zachcarter | oh nice! |
22:22:10 | krux02 | I took it as a challenge |
22:22:55 | zachcarter | should make a gif! |
22:23:30 | zachcarter | http://imgur.com/a/yTXyP |
22:24:02 | ldlework | zachcarter: you need to use palette switch when using ffmpeg :) |
22:24:33 | zachcarter | it keeps telling me I can’t use rgba24 with my gif code even though I’m using gifsicle |
22:24:40 | zachcarter | makes me furious |
22:24:42 | krux02 | well I don't have a setup ready for recording |
22:24:54 | ldlework | krux02: gtk-recordmydesktop is just an apt away |
22:25:13 | krux02 | I use pacman |
22:25:24 | zachcarter | Incompatible pixel format 'rgb24' for codec 'gif', auto-selecting format 'rgb8' |
22:25:26 | zachcarter | is the crap it tells me |
22:27:26 | krux02 | well gif can only 8 bit colors |
22:27:46 | krux02 | and when you upload it to imgur it's converted to video file |
22:27:59 | krux02 | mp4 I think |
22:28:24 | krux02 | so you have compression artifacts from removing the colors and artifacts from the imgur algorithm |
22:28:43 | krux02 | but anyway it works so no complaints |
22:30:24 | * | nsf quit (Quit: WeeChat 1.7) |
22:30:50 | ldlework | http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html |
22:32:04 | * | Sentreen joined #nim |
22:32:49 | krux02 | well my tetris has 3D graphics |
22:32:59 | krux02 | but it lacks being pretty |
22:34:02 | krux02 | and no animations |
22:34:15 | krux02 | but hey it's tetris that game does only need 3D |
22:39:53 | ldlework | does it even need 3d |
22:40:36 | krux02 | http://i.imgur.com/ib209sZ.png |
22:41:50 | krux02 | it's now at 425 lines without any external dependencies |
22:42:21 | krux02 | I just render a plane as background and colored icosahedrons |
22:45:41 | * | kunev quit (Ping timeout: 260 seconds) |
22:48:01 | zachcarter | nice |
22:59:00 | * | xmonader joined #nim |
23:02:50 | krux02 | there is still something missing |
23:03:02 | krux02 | the game does not count scrore |
23:03:25 | krux02 | nore is there anything like level |
23:13:26 | zachcarter | same here |
23:14:19 | krux02 | it is already fun though |
23:14:35 | krux02 | I can put stones, I see the next stones and I can remove lines |
23:14:45 | krux02 | so the important part is already working |
23:21:30 | vlad1777d | Sorry, I'm newbie. Where can I found source code, which implements echo instruction ? |
23:22:02 | vlad1777d | Tell me please filename, if you know, not to search me many time. Thanks. |
23:25:03 | krux02 | vlad1777d: well when you have something that is implemeneted with magic, I recommend you to grep for that magic |
23:26:13 | vlad1777d | krux02, thanks, I'm not best friend to grep, so I'll search manually =) |
23:32:42 | krux02 | vlad1777d: better get used to it, it really helps in bigger code base |
23:32:58 | krux02 | one of my main tools |
23:33:12 | vlad1777d | thanks |
23:33:18 | vlad1777d | I'll do it one time =) |
23:34:11 | krux02 | grep -rni yourmagic |
23:34:40 | krux02 | editors even have grep plugins |
23:38:31 | vlad1777d | krux02, 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:13 | zachcarter | anyone feel like trying out frag / the first level of space invaders? |