00:09:25 | FromGitter | <watzon> (https://files.gitter.im/nim-lang/Nim/1QK1/image.png) |
00:09:44 | FromGitter | <watzon> What is this madness? The js compiler is also a php compiler? |
00:11:51 | GitDisc | <GooRoo> JS and PHP, best languages ever… |
00:12:08 | GitDisc | <GooRoo> especially in combination |
00:28:35 | FromGitter | <watzon> Lol for real |
00:29:17 | watzon | What's the best way to make an http request to a JSON api in nim? |
00:29:27 | watzon | Any good libraries? |
00:32:21 | SunDwarf | pipe httpclient into jsondecode |
00:35:15 | FromGitter | <Yardanico> watzon: stdlib is your best friend |
00:47:15 | * | sleepyqt quit (Quit: Leaving) |
00:55:29 | skrylar | libcurl is nice for such things |
01:53:38 | skrylar | wonder if there would be any point to dbase support in nim |
01:57:07 | FromGitter | <qqtop> dbase no , firebird yes |
02:00:58 | * | user3382 joined #nim |
02:01:54 | user3382 | if i wanted to write my own language more as an exercise in semantics and logic flow than a truly seperate language, would nim be ideal for this? |
02:02:45 | GitDisc | <GooRoo> dbase no, firebird no, influx yes |
02:03:07 | GitDisc | <GooRoo> @user3382, just use MPS, dude |
02:03:59 | user3382 | thats a dsl on java thou? |
02:04:10 | user3382 | what if i want to redefine how c++ works to make it legible and straightfoward to use |
02:05:02 | GitDisc | <GooRoo> like for example? |
02:06:52 | * | AlexMax joined #nim |
02:10:22 | * | mwbrown quit (Quit: Exiting) |
02:15:56 | user3382 | like nim does but more |
02:22:32 | * | user3382 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
02:23:07 | * | mwbrown joined #nim |
02:25:38 | GitDisc | <GooRoo> I believe that Nim is good enough for this. However to be more precise you'd better give us more details |
02:26:00 | GitDisc | <GooRoo> Have you already filled this checklist? http://colinm.org/language_checklist.html |
02:30:25 | * | vlad1777d quit (Ping timeout: 248 seconds) |
02:34:10 | * | def-pri-pub joined #nim |
02:40:49 | FromGitter | <gogolxdong> Is there anything like py2nim? |
02:45:25 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:01:18 | FromGitter | <Varriount> user3382: Making a programming language is a non-trivial project. |
03:01:25 | FromGitter | <Varriount> Especially if it's compiled. |
03:02:02 | FromGitter | <Varriount> You need a tokenizer/parser, abstract syntax tree, semantic checker, and backend emitter at the very least. |
03:02:43 | FromGitter | <Varriount> For compiled languages, you need details about the architecture that you're targeting too. |
03:34:26 | * | Nobabs27 joined #nim |
03:34:51 | AlexMax | https://forum.nim-lang.org/t/3254/2 |
03:35:22 | AlexMax | I think I know the answer to this, but why a no-GC runtime slower overall? |
03:41:39 | * | Nobabs27 quit (Quit: Leaving) |
03:57:58 | * | smt` joined #nim |
04:00:58 | * | smt quit (Ping timeout: 255 seconds) |
04:17:46 | * | def-pri-pub quit (Quit: Leaving.) |
04:22:57 | * | dddddd quit (Remote host closed the connection) |
05:25:51 | * | miran joined #nim |
05:44:30 | * | nhywyll joined #nim |
05:44:56 | * | nsf joined #nim |
06:01:05 | * | couven92 joined #nim |
06:08:59 | skrylar | AlexMax, because GCs are faster (short version) than manual alloc |
06:09:50 | skrylar | longer version: depends on the GC, and the application, but the cost of memory fiddling can be amortized in to time your program is idle anyway, whereas auto refcounters are paying that cost 100% of the time |
06:10:12 | skrylar | like if you are waiting on IO, you can do some collection cycles instead of just doing nothing |
06:13:19 | * | miran quit (Ping timeout: 248 seconds) |
06:34:08 | * | PMunch joined #nim |
06:43:41 | * | miran joined #nim |
06:44:20 | * | gokr joined #nim |
06:44:32 | FromGitter | <mratsim> @user3382 check what @gokr did with is own lang written in Nim: http://goran.krampe.se/2016/08/26/benchmarking-spry-vs-squeak/ |
06:45:39 | FromGitter | <gokr> Might be easier to start at http://www.sprylang.org |
06:46:24 | FromGitter | <gokr> And my articles on the journey so far: http://goran.krampe.se/category/spry/ |
06:47:12 | gokr | Oh, he is not around anymore |
06:47:59 | * | nhywyll quit (Quit: nhywyll) |
06:56:41 | * | Arrrr joined #nim |
06:56:41 | * | Arrrr quit (Changing host) |
06:56:41 | * | Arrrr joined #nim |
07:07:47 | PMunch | Nice talk subsetpark :) |
07:09:17 | GitDisc | <GooRoo> Could you, guys, please share a link to the talk. I missed it somehow. |
07:11:25 | miran | https://www.youtube.com/watch?v=IVgNVJdizHg |
07:11:45 | GitDisc | <GooRoo> Thanks |
07:12:54 | * | claudiuinberlin joined #nim |
07:20:40 | Arrrr | Ah, i see this link on reddit |
07:30:40 | * | Arrrr quit (Ping timeout: 255 seconds) |
07:38:11 | * | Arrrr joined #nim |
07:38:12 | * | Arrrr quit (Changing host) |
07:38:12 | * | Arrrr joined #nim |
07:42:29 | FromGitter | <alehander42> @mratsim unittest works fine with js for me too |
07:49:52 | * | libman quit (Quit: Connection closed for inactivity) |
07:50:00 | * | hogeland joined #nim |
07:51:39 | hogeland | okay time to stop getting spammed by gitter and instead idle in irc |
07:54:53 | FromGitter | <mratsim> Just deactivate gitter notifications except on mentions |
08:02:52 | * | hogeland is now known as kh |
08:02:59 | * | kh is now known as hogeland |
08:24:15 | * | floppydh joined #nim |
08:24:39 | floppydh | can I import modules from a libraries private dir? |
08:24:41 | floppydh | outside of it |
08:24:52 | FromGitter | <mratsim> I don't know if @johnnovak is hanging there but very interesting piece on game rendering HDR, contrast, Tone mapping, https://ventspace.wordpress.com/2017/10/20/games-look-bad-part-1-hdr-and-tone-mapping/ |
08:24:58 | * | hogeland quit (Quit: leaving) |
08:25:13 | FromGitter | <mratsim> @floppydh, with the path |
08:25:34 | floppydh | mratsim so like somelib.private ? |
08:26:07 | floppydh | mratsim ah got it like this somelib/private/... |
08:28:11 | * | hogeland joined #nim |
08:29:32 | * | ibutra joined #nim |
08:31:49 | * | skrylar reads over said article anyway |
08:33:01 | skrylar | I don't know really. |
08:33:42 | skrylar | Innovation happens on the small scale, and the small scale doesn't have access to the "training" he keeps going on about |
08:34:00 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:35:05 | * | claudiuinberlin joined #nim |
08:36:21 | skrylar | i know there are also some oddities in that artists really prefer stuff to look like it does in their editors, and it can be hard/impossible to change the way your modeler grades the viewport |
08:37:31 | skrylar | that issue doesn't exist in VFX tools, since ex. Nuke/Natron will just let you dump a grading node in place |
08:38:03 | * | hogeland quit (Quit: Lost terminal) |
08:38:27 | * | hogeland joined #nim |
08:58:16 | gokr | Just published one of those "here's how to get cracking with Nim" blog post, for fun. Anyone want to proof-run through it? |
08:58:45 | gokr | I should put in some fun memes too - but don't have time right now ;) |
08:58:55 | gokr | http://goran.krampe.se/2017/10/24/nim-crash-course-inside-lxc/ |
09:08:19 | PMunch | "but much more lightweight similar to Docker." maybe a comma after "lightweight"? |
09:08:41 | PMunch | "Contrary to Docker thoigh", assume you meant "though" |
09:08:58 | miran | "I should put in some fun memes too" - nah, you're fine without it |
09:09:15 | miran | and i say that before reading a word from the link |
09:09:40 | PMunch | miran, haha agreed |
09:10:28 | PMunch | I get the need to put in some images or something that can break the monotomy of pure text (my own posts are pretty bad at this, very wall-of-texty) |
09:10:51 | PMunch | But it's so strange when it's just images trying to express some reaction |
09:11:25 | PMunch | It is a bit hard though writing about computer languages or programming in general and find related images.. |
09:11:40 | PMunch | Seing how most of it is just text based anyways.. |
09:12:25 | miran | you (general you) can break a pure text with section names and stuff like that (more text to break text monotony :)) |
09:13:06 | PMunch | True, but that requires that you actually change subject |
09:13:27 | miran | just scrolled through the link and - text is already nicely broke into parts. really no need for memes |
09:14:02 | * | chuqkyjhgq joined #nim |
09:14:03 | * | chuqkyjhgq left #nim (#nim) |
09:14:07 | PMunch | Yeah, I was talking more in-general |
09:14:25 | PMunch | Take an example from my site for example: https://peterme.net/cross-platform-guis-and-nim-macros.html |
09:14:50 | PMunch | Text galore.. |
09:15:31 | miran | well, you have section names. without them, this would be impossible to read |
09:16:14 | PMunch | Yeah, fair enough |
09:16:45 | miran | and this probably looks like lots of text because of large font size (which is much better than small font size which might look like less text) |
09:17:03 | PMunch | Yeah, it was even larger before but I tuned it down a bit |
09:17:26 | PMunch | I feel this is a good compromise |
09:17:59 | miran | i prefer large text. on typical sites/blogs i need to zoom in to read comfortably, not the case with your blog |
09:19:55 | * | sz0 joined #nim |
09:22:28 | miran | gokr: "I am not going to explain the code" - maybe you could explain it just a bit for the beginners, for example: what is `discard`, why you use `result` variable (without `var`), etc. |
09:23:02 | gokr | Ok, back, cool - I will scan all you wrote here |
09:23:58 | PMunch | miran, yeah readability was a large focus for my site. Limiting the width of the text, giving it maximum vertical size by moving the bar to the side, giving you the option to collapse the bar to remove distractions, choosing a font that is known for being nice to read (LaTeX default font) etc. |
09:24:34 | ibutra | I must admit I don't quite understand why you put the LXC in there. Does it help undestand somethin? |
09:24:48 | ibutra | In addition the nimble install will install into the path of the LXC or not? |
09:24:51 | miran | PMunch: Computer Modern (LaTeX default font) is nice, but there are better (more readable) fonts, IMO |
09:25:16 | ibutra | that could be a little counterintuitive for beginners |
09:26:00 | PMunch | miran, sure. But the LaTeX default was an easy way to go |
09:26:14 | PMunch | Plus I really like it personally :) |
09:26:43 | miran | PMunch: like many many users of LaTeX :) |
09:27:40 | miran | btw, i use Palatino when writing in LaTeX, and Merriweather as my serif font in browser's reader mode |
09:27:58 | PMunch | Oooh, I'll be sure to check those out |
09:28:06 | PMunch | Always on the lookout for good fonts :) |
09:28:21 | PMunch | But now I'm off for lunch |
09:28:28 | gokr | ibutra: I agree, the LXC was just because... I experimented with it ;) |
09:28:48 | FromGitter | <mratsim> I have a font collection, in Latex I'm fond of Fontin, Fontin Sans, Audimat and Delicious |
09:28:59 | miran | PMunch: take my advice - don't go on the lookout for good fonts - this is a road without end. it's disastrous! |
09:29:09 | gokr | ibutra: The whole rest of the article is done inside the LXC container. It's like a VM. |
09:30:11 | FromGitter | <mratsim> @gokr, I'm even further than you, I'm using Nim in LXC running GPU code from the container |
09:30:46 | FromGitter | <gokr> :) |
09:30:56 | ibutra | I get that experimenting thing. But I imagine some beginner scratching his head why his program isn't working in his normal environment. Maybe a small addition in the end that it is installed inside the container and added to its path would help? |
09:31:43 | FromGitter | <gokr> Yeah, sure. And also, one of the ideas of doing the whole excercise inside a fresh LXC - was for avoiding inconsistencies. |
09:31:57 | FromGitter | <mratsim> https://andre-ratsimbazafy.com/cuda-gpu-passthrough-to-a-lxc-container/ |
09:54:06 | Arrrr | I need a way to provide a default value to untyped in a template. Is such a thing possible? |
09:57:49 | PMunch | Haha miran I know. The trick is to not go looking, but note down the ones you like so you have them for later ;) |
09:58:27 | miran | good luck with that :) |
09:58:54 | PMunch | miran, just had to find a good small caps font though. That was quite a project.. |
09:59:24 | miran | btw, to me - Computer Modern is a font that looks good on the paper and with small size on the screen. for larger sizes (like on your blog), i would look for another font :) |
10:00:32 | * | ibutra_ joined #nim |
10:02:33 | * | ibutra__ joined #nim |
10:04:15 | * | ibutra quit (Ping timeout: 258 seconds) |
10:04:48 | * | gggs joined #nim |
10:04:51 | * | ibutra joined #nim |
10:06:22 | * | ibutra_ quit (Ping timeout: 264 seconds) |
10:06:53 | watzon | What's the easiest way to write to a new file in nim? |
10:07:06 | watzon | Someone told me the other day, but I forgot |
10:07:15 | watzon | It was one command |
10:07:28 | * | ibutra__ quit (Ping timeout: 240 seconds) |
10:08:06 | FromGitter | <ephja> writeFile(filename, content: string) |
10:08:15 | FromGitter | <mratsim> @Arrrr can't you use var default: type(your_untyped_input) ? |
10:08:42 | watzon | ephja that's it! |
10:11:08 | watzon | How about checking for the existence of a file? |
10:13:10 | FromGitter | <gokr> https://nim-lang.org/docs/theindex.html#fileExists |
10:13:19 | FromGitter | <gokr> The index is your friend. |
10:14:06 | dom96 | Kinda sucks a bit that the devs of Starbound decided to use Rust for their next game, but let's see what comes of this: https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/dot8gr2/ |
10:14:34 | Arrrr | no, the issue is that arg: untyped = DefaultVal doesn't work |
10:14:36 | FromGitter | <ephja> https://nim-lang.org/docs/system.html |
10:14:59 | federico3 | http://pyvideo.org/pygotham-2017/nim-a-new-option-for-optimizing-inner-loops.html |
10:15:04 | Arrrr | for example, default could be (discard 0) |
10:17:19 | floppydh | so I just realized I don't get includes, if I include foo that includes bar I can't see the symbols of bar unless they're exported? |
10:17:54 | Arrrr | In theory, if a includes b a b includes c, a should be able to see c |
10:18:02 | floppydh | in theory |
10:19:04 | PMunch | dom96, it would be amazing if they did it in Nim instead |
10:19:09 | Arrrr | If that doesn't work, you can always include both b and c from a |
10:19:12 | dom96 | floppydh: why are you using includes in the first place? |
10:19:23 | dom96 | an include is essentially copy and pasting the file into where the include is |
10:19:24 | floppydh | dom96: I try to access nonexported stuff from nigui |
10:19:34 | dom96 | floppydh: why? |
10:19:40 | floppydh | dom96: because it wraps some nice windows stuff |
10:20:02 | Arrrr | Report it as a bug and see what araq has to say |
10:20:18 | floppydh | note that a doesn't include at the top, it defines some stuff, then includes, defines other stuff and includes something else, so I'd basically have to copy a |
10:20:36 | floppydh | well I guess I'll just copy paste it out of there for now |
10:20:43 | dom96 | floppydh: in that case it may be worth submitting a PR to expose it |
10:21:05 | PMunch | floppydh, grep "include .*" nimui.nim |
10:21:17 | * | xet7 quit (Quit: Leaving) |
10:21:20 | floppydh | PMunch: thats not the issue, a defines stuff that the include relies upon |
10:21:43 | floppydh | dom96: I guess that would be the right thing |
10:22:00 | floppydh | thanks everyone tho |
10:25:31 | watzon | Question about the posix `mkdir` proc. What is the mode exactly? `mkdir(a1: cstring; a2: Mode): cint` |
10:25:50 | watzon | It's of type `cint`, but there's no documentation as to what int means what |
10:27:47 | dom96 | http://pubs.opengroup.org/onlinepubs/009695399/functions/mkdir.html |
10:28:02 | dom96 | Why are you using it directly? |
10:28:20 | * | ibutra_ joined #nim |
10:28:40 | * | xet7 joined #nim |
10:29:21 | watzon | dom96: Is there a better way? |
10:29:34 | dom96 | os.createDir |
10:29:55 | floppydh | okay its all fine, as I suspected, it was a mistake on my part, include works fine |
10:30:14 | dom96 | also, welcome to you both watzon and floppydh :) |
10:30:45 | watzon | dom96: Oh I've been here for a while haha. Just came back though after a long break, so thanks :) |
10:30:48 | floppydh | dom96: oh thank ya, I'm a lurker tho with different names I've been welcomed before |
10:30:53 | floppydh | hah watzon |
10:31:42 | floppydh | the move-pointer-less stuff Araq did a cast on looked really lovely, you guys are doing a great job |
10:32:08 | * | ibutra quit (Ping timeout: 240 seconds) |
10:50:10 | * | dddddd joined #nim |
11:00:48 | * | Viktor_ joined #nim |
11:01:41 | * | ibutra_ quit (Ping timeout: 240 seconds) |
11:02:27 | * | Snircle joined #nim |
11:02:54 | * | ibutra_ joined #nim |
11:03:44 | Viktor_ | Do you guys expect Nim adoption to explode after 1.0 release? It has everything to going for it, great performance, great productivity, wide array of usage possibilities (system, embedded, web server etc.). |
11:04:56 | Calinou | I don't think so, Rust adoption didn't explode after 1.0 either |
11:05:05 | Calinou | it's getting slowly and surely popular |
11:05:17 | Calinou | (I've seen a job offer from my university, asking for a C++ and Rust programmer. However, they pay like crap) |
11:05:26 | Calinou | (good old "If you ask for a Superman, all you'll get is a Deadpool") |
11:06:23 | PMunch | Viktor_, I think one of the things that's holding it back is the lack of common packages. AWS is for some reason mentioned very often for example |
11:06:51 | PMunch | But it's a bit of a chicken and egg problem. If there are no libraries you don't get users, but without users you don't get libraries. |
11:08:42 | floppydh | I enjoy nim being more on the experimental side, I love seeing new stuff put in, be it language features etc. without actually having to be shoe-horned into the whol thing for a big project, so I'm really just fine with how it is :3 |
11:09:14 | crem | Yes, hopefully nim will never be 1.0 :) |
11:09:43 | crem | I know it will, but still hope.. |
11:09:57 | * | Arrrr quit (Ping timeout: 240 seconds) |
11:10:59 | Araq | I'd throw away the version number at this point and release Nim 2017 |
11:11:21 | * | derlafff quit (Quit: No Ping reply in 180 seconds.) |
11:12:06 | crem | After 1.0 there's no really easy way to do breaking changes. I remember people disappointment when D v2.0 was released. |
11:12:17 | federico3 | how about freezing the spec in 2.0 instead? |
11:12:27 | * | derlafff joined #nim |
11:12:34 | * | Arrrr joined #nim |
11:12:34 | * | Arrrr quit (Changing host) |
11:12:34 | * | Arrrr joined #nim |
11:12:43 | Viktor_ | federico3 then there is not much point calling it 1.0 |
11:14:02 | federico3 | Viktor_: it sends a message. A large number of features can be frozen in 1.0, just not everything. |
11:15:13 | * | sleepyqt joined #nim |
11:16:30 | * | derlafff quit (Read error: Connection reset by peer) |
11:16:56 | miran | federico3: and then be prepared for users' hate when 2.0 breaks some things |
11:17:36 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:18:10 | FromGitter | <krux02> federico3: is there a language spec of Nim? |
11:18:28 | federico3 | miran: not if the freeze is very clerly spelled out |
11:18:31 | crem | I like rolling updates more than annual releases! |
11:18:50 | FromGitter | <krux02> always break it a little bit |
11:19:05 | crem | yes |
11:19:14 | crem | That keeps developers alert. |
11:19:32 | crem | And they constantly keep context of what's happenning in the code. |
11:19:49 | crem | Otherwise it's easy to forget what you wrote. |
11:19:49 | FromGitter | <krux02> well nothing is for free |
11:19:58 | Araq | krux02: yeah, that's exactly what we need to stop doing |
11:20:15 | FromGitter | <krux02> when the language can change at any time, people do not want to have huge codebases, because small changes can cause big problems |
11:21:09 | FromGitter | <krux02> Araq: there are minor things in Nim, where I see breaking changes inevitable. |
11:21:22 | Araq | list them |
11:21:32 | FromGitter | <krux02> you know them |
11:21:42 | Araq | I don't know if I know them all |
11:21:54 | * | elrood joined #nim |
11:21:56 | FromGitter | <krux02> int and int64 are different type, float and float64 are identical |
11:22:26 | Araq | int as a builtin type has its advantages though |
11:22:29 | FromGitter | <krux02> and ``mySeq.isNil`` should be derecated and always return false |
11:22:58 | Araq | tried that in a branch, causes weird crashes |
11:22:58 | FromGitter | <krux02> well but it is kind of weird when I write functions for different types |
11:24:08 | FromGitter | <krux02> and then ``proc f(arg: float32) `` and ``proc f(arg: float64)`` is enough to support all floating point types, but for integers I have to also support ``int`` |
11:24:30 | FromGitter | <krux02> it happened to me when writing a wrapper |
11:24:50 | FromGitter | <krux02> I tried it, too |
11:25:05 | FromGitter | <krux02> as you said, weird crashes |
11:25:30 | * | derlafff joined #nim |
11:26:12 | FromGitter | <krux02> it would also be nice, when you could see that int is just an alias for either int32 or int64 depending onthe architecture |
11:26:17 | miran | just x-posted the video about optimizing inner loops to /r/python - they might be more interested than the general /r/programming public |
11:26:30 | FromGitter | <krux02> I mean if you could see that in the system module |
11:26:59 | FromGitter | <krux02> when [[is64bitArchitecture]]: type int = int64 ... |
11:27:20 | dom96 | krux02: maybe you could just `SomeNumber` instead? |
11:27:40 | dom96 | as for seeing what 'int' actually is, that's a docgen feature |
11:27:43 | FromGitter | <krux02> no, that doesn't solve the problem |
11:27:44 | Araq | krux02: these things must not block v1 anymore, they take months to correct |
11:27:45 | dom96 | that I have had planned for a while |
11:28:06 | Araq | there will be a version 2 anyway which will be closer to perfection |
11:28:14 | dom96 | Me and Araq are probably gonna do a livestream discussing v1 at some point |
11:28:29 | Araq | the point of a v1 is to say "ok, you can use it now and |
11:28:36 | Araq | **fixes will be backported** |
11:28:46 | Arrrr | How is that closer to perfection if you kill GC |
11:29:38 | Araq | Arrrr, that's a whole different discussion and "ref got more expensive but supports threading now" is not killing the GC anyway |
11:30:42 | Araq | it's just a GC that works with destructors properly then |
11:31:10 | PMunch | Is there a better way to load a dynamic library and give it access to your procedures than to pass them all in a setup call? |
11:31:52 | dom96 | GC won't be killed before v1 |
11:32:24 | Arrrr | How can i do sensitive work with var seqs if everything works inside a try catch?. The trolling about GC being slow is going to be a trifle in comparison to this |
11:32:52 | Araq | I don't understand you. |
11:33:05 | FromGitter | <BigEpsilon> Hi, I have a little problem, I have this code that does not compile, but I'm not sure if it is a bug or not : https://play.nim-lang.org/?gist=7bba38b15f29e20ac6412fd65c0f119a |
11:33:17 | FromGitter | <krux02> dom96: http://ix.io/BIr |
11:33:40 | * | Viktor_ quit (Ping timeout: 260 seconds) |
11:34:24 | GitDisc | <GooRoo> is there any public roadmap available? |
11:34:33 | PMunch | For reference this is what I do now: https://pastebin.com/xMUr8Qnc https://pastebin.com/acK0dAXS which works fine for a couple procs. But this is about 80+ procs, some with just different signatures which would have to be wrapped in a template or something.. |
11:34:48 | dom96 | I hope I get an answer on reddit though. I'm curious if that developer considered using a real-time GC |
11:35:06 | dom96 | This has been how we've been "marketing" Nim's GC for forever. |
11:35:10 | dom96 | Is it wrong? |
11:35:39 | Araq | let me say it again then: |
11:36:10 | FromGitter | <BigEpsilon> somehow VecAll[T, 3] can not be instantiated, and sorry for coming in the middle of an ongoing conversation |
11:36:12 | Araq | there is nothing wrong with Nim's GC, especially not "omg, unpredicted pauses" |
11:36:22 | dom96 | BigEpsilon: tough one, possibly a bug. |
11:36:34 | dom96 | (or just a known limitation) |
11:36:40 | Araq | it's just that all GCs share certain problems |
11:36:59 | FromGitter | <krux02> dom96: the code I just sent you doesn't compile and I think that's a problem |
11:36:59 | Araq | which is interop with runtimes that use no/a different GC |
11:37:21 | Araq | as well as encouraging logical leaks |
11:37:35 | * | derlafff quit (Remote host closed the connection) |
11:37:59 | dom96 | krux02: cast to largest int type? |
11:37:59 | FromGitter | <krux02> because when I would add a workaround to make it compile, then actually making int an alias type would not compile with the workaround |
11:38:04 | Araq | and unclear ownership rules which makes code harder to multi thread and comprehend |
11:39:18 | Araq | Arrrr, the try is really cheap when compiling to C++ or LLVM. |
11:39:51 | FromGitter | <krux02> dom96: so you dismiss that calling the function with a 32 bit int argument might actually have importance? |
11:39:57 | dom96 | Araq: Sadly most of Nim code is still compiled to C though |
11:39:58 | Arrrr | Well i hope that performance cost is not too high because not every software, at every function, needs interop with C or multithreads |
11:40:27 | Arrrr | but the change seems to affect everything |
11:40:34 | dom96 | krux02: sorry, I really don't know. Just trying to guess a workaround for you. |
11:41:21 | * | Yardanico joined #nim |
11:41:36 | FromGitter | <krux02> dom96: I have a workaround, but I think it's ugly and the workaround would crash as soon as int64 and int become the same type |
11:41:48 | FromGitter | <krux02> therefore I would like to have this happer rather sooner than later |
11:43:35 | FromGitter | <BigEpsilon> Thanks @dom96 ! If any one have a workaround I'll take it gladly : https://play.nim-lang.org/?gist=7bba38b15f29e20ac6412fd65c0f119a |
11:44:10 | Araq | bigepsilon: default parameters don't store the dependency to the 'T' here, just use an overload? |
11:45:02 | FromGitter | <BigEpsilon> ok thanks Araq I'll try that |
11:45:41 | Araq | Arrrr, dom96 I know it's a pervasive change in the implementation, spec-wise it's mostly compatible with today's Nim |
11:46:22 | Araq | it's a tremendous amount of work which is why it's detached from Nim version 1 |
11:48:09 | dom96 | okay, maybe I need to read the blog post again |
11:50:02 | miran | let's bring in some new python crowd to nim - https://www.reddit.com/r/Python/comments/78f2y9/nim_a_new_option_for_optimizing_inner_loops/ |
11:50:11 | miran | upvote for visibility :) |
11:50:30 | dom96 | upvoted :) |
11:51:11 | miran | dom96: and be prepared to answer nim-related questions, if there will be any :) |
11:51:55 | PMunch | Is something like this: https://stackoverflow.com/a/17099137 possible in Nim? |
11:51:59 | dom96 | Araq: What's your plan with destructors for Nim v1? |
11:52:01 | PMunch | Or the answer above it for that matter |
11:52:29 | Arrrr | Everybody makes fun of "Rewrite in rust" evangelism, so beware of spamming nim links. |
11:53:02 | dom96 | Posting such links isn't the same |
11:53:29 | Arrrr | i hope they think the same |
11:54:08 | miran | dom96: are you sure you didn't downvote? :D |
11:54:14 | Araq | dom96, I would like to get them stable as "opt-in", so you can write your own seqs and strings but the existing GC infrastructure/runtime stays as it is and doesn't use them |
11:54:47 | dom96 | miran: Reddit fuzzes the score |
11:55:03 | dom96 | But yes, I'm sure |
11:55:13 | miran | :) |
11:55:17 | dom96 | Araq: Okay, but can we use them in the stdlib? |
11:56:02 | Araq | dom96, probably |
11:56:13 | FromGitter | <BigEpsilon> I think my issue is related to https://github.com/nim-lang/Nim/issues/5595 |
11:56:28 | dom96 | Araq: Essentially I want to use it for `close` |
11:57:34 | arnetheduck | Yardanico, I am now |
11:59:14 | Yardanico | arnetheduck, I wanted to ask you about compiling/running nlvm |
11:59:26 | Yardanico | I've added -fpermissive to compile nim compiler successfully |
11:59:30 | Yardanico | but it fails at linker step |
12:00:11 | Yardanico | arnetheduck, https://gist.github.com/Yardanico/7422b7c80ae945387538b7ced59cc1aa |
12:02:14 | arnetheduck | what are you compiling with? |
12:03:12 | arnetheduck | and does /home/tiber/stuff/nlvm/nlvm/nimcache/wrapper.o exist? |
12:03:21 | arnetheduck | I've noticed nim forgets to compile it sometimes |
12:03:38 | Yardanico | arnetheduck, g++ versionb is 7.2.0 |
12:03:42 | Yardanico | *version |
12:03:57 | Yardanico | arnetheduck, yeah, wrapper.o doesn't exist |
12:04:27 | dom96 | try passing '-f' to Nim |
12:04:58 | arnetheduck | I usually do some trivial modification to llvm/wrapper.cc and then nim will recompile it |
12:05:10 | Yardanico | arnetheduck, ok |
12:05:35 | Yardanico | arnetheduck, ah, sorry |
12:05:36 | Araq | dom96, for files that requires working moves |
12:05:37 | Yardanico | wrapper.o is here |
12:05:45 | Yardanico | in nlvm/nlvm/nimcache/wrapper.o |
12:06:13 | Araq | or maybe not |
12:06:58 | arnetheduck | though clearly something is broken with the way nim detects if {.compile.} files need recompiling |
12:08:41 | Yardanico | arnetheduck, IDK really, wrapper.o is here |
12:08:45 | arnetheduck | anyway, the stuff you're getting linker errors for are in that file, not sure why they're not being picked up.. can try removing it |
12:09:05 | dom96 | Araq: why would it require moves? |
12:10:59 | Yardanico | arnetheduck, even if I remove wrapper.o, so it's recompiled - linker still errors |
12:12:41 | Araq | dom96, let f = open(); s.add(f); # escapes, injected destroy(f) must be a nop |
12:13:30 | dom96 | Araq: Indeed, I would expect destructors to handle this. |
12:13:46 | * | Vladar joined #nim |
12:13:49 | dom96 | this can happen for everything really |
12:13:58 | dom96 | so if destructors fail at this then they're not working properly |
12:14:51 | arnetheduck | Yardanico, actually, now that I removed my old copy and rebuilt it, I'm getting errors to.. will have a look |
12:16:28 | Araq | dom96, you don't understand |
12:17:55 | Araq | the problem is that usually assignments for 'File' copy some handle/pointer, we need to overwrite assignment here so that either it's disallowed and only moves are allowed or that refcounts the usages in order to not close the file too early |
12:19:07 | FromGitter | <mratsim> @bigp |
12:19:10 | dom96 | hrm |
12:20:08 | FromGitter | <BigEpsilon> yes @mratsim :) |
12:20:15 | FromGitter | <mratsim> @BigEpsilon @dom96 maybe try to add a dummy static default parameter for https://github.com/nim-lang/Nim/issues/5595, it worked for me in https://github.com/nim-lang/Nim/issues/6343 |
12:20:52 | FromGitter | <mratsim> it’s ugly but you gotta do what you gotta do :P |
12:21:08 | arnetheduck | bah, it worked with gcc 6.x, but not with 7.x |
12:21:34 | dom96 | Araq: I thought File was just a file descriptor. |
12:21:43 | * | Viktor_ joined #nim |
12:22:12 | dom96 | So what can we do? |
12:22:17 | Yardanico | arnetheduck, well I can install gcc 6 for now |
12:22:41 | dom96 | Is it too difficult, should we give up on using destructors in the stdlib for v1? |
12:23:48 | arnetheduck | Yardanico, looks like travis is broken too, it's something genuinely wrong that maybe worked because I had an old wrapper.o lying around |
12:24:00 | watzon | How do you cross compile for windows? |
12:24:05 | Yardanico | watzon, use mingw |
12:24:40 | watzon | From linux? I've never done that before haha |
12:24:44 | Yardanico | watzon, yes, from linux |
12:24:50 | Yardanico | install mingw using your package manager |
12:24:54 | Yardanico | and then use it instead of gcc :) |
12:25:14 | Yardanico | watzon, example config https://github.com/VKBots/Nickel/blob/fd1fe80931b0255fca5a23f12c0b2bfe3c6e5a6d/src/nim.cfg#L15 (don't look at comments) |
12:25:20 | FromGitter | <BigEpsilon> @mratsim I think the problem here is different. In my case it seems that default arguments do not store enough information to instantiate their generic parameters |
12:25:26 | watzon | Ahh so you can't cross compile a windows executable from nim itself? |
12:25:40 | Yardanico | watzon, nim compiles to C++/C |
12:25:52 | Yardanico | you can still output C code for windows |
12:25:56 | Yardanico | and then compile C code under windows |
12:25:59 | Yardanico | but it's easier with mingw |
12:26:02 | FromGitter | <BigEpsilon> same with dom96 issue |
12:26:14 | Yardanico | nim itself is a Nim2C compiler, not Nim2Binary |
12:27:26 | FromGitter | <BigEpsilon> @mratsim , other example : https://play.nim-lang.org/?gist=7bba38b15f29e20ac6412fd65c0f119a |
12:28:25 | FromGitter | <BigEpsilon> the workaround for my specific problem is use overloading insteed of default paramter as Araq suggested |
12:30:42 | Yardanico | arnetheduck, ah, fails with g++-6 too |
12:36:05 | arnetheduck | Yardanico, pushed a small fix, can you try make clean;make |
12:37:25 | Yardanico | arnetheduck, works! |
12:37:32 | Yardanico | with g++ 7 too |
12:37:35 | Yardanico | yay |
12:38:05 | arnetheduck | great - when do I get the first pull req? ;) |
12:38:15 | Yardanico | arnetheduck, xD |
12:38:29 | Araq | dom96, dunno, too early to decide on that |
12:39:17 | * | Arrrr quit (Read error: Connection reset by peer) |
12:39:20 | dom96 | Araq: If we want v1 by January then I don't think it is :) |
12:39:44 | Yardanico | dom96, so deadline for 1.0 is january? |
12:41:01 | dom96 | It would certainly be nice :) |
12:41:48 | FromGitter | <Varriount> dom96, araq: The problem is similar to why sequences must be copied, right? Unless you have a refcount with the file object, the destructor will still be called, even if there are other copies of the file handle in the program. |
12:42:43 | Yardanico | arnetheduck, and what can be the reason of /usr/bin/ld: /home/tiber/projects/experiments/nimcache/genpi.o: relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC ? |
12:43:43 | arnetheduck | -fPIC compile flag is missing somewhere? ;) |
12:44:14 | arnetheduck | likely you're trying to create a shared lib somewhere which nlvm doesn't even try to support.. |
12:46:39 | miran | Araq, dom96: if v1.0 is planned for january (or whatever), have you maybe considered some kind of "month of bugfixes" before the release where we (the community) would try to close as many issues as possible? |
12:47:44 | miran | from what i could tell, currently there are more new issues than closes (in the same period of time) |
12:47:51 | dom96 | miran: nope, maybe you could organise one :) |
12:48:16 | watzon | Damn I can't get this mingw stuff working |
12:48:19 | dom96 | For v1 though it's more important to focus on breaking changes than bug fixes. |
12:48:40 | Yardanico | watzon, ? |
12:48:53 | watzon | I installed it and set up my nim.cfg file similar to Nickel's |
12:49:05 | miran | dom96: i would gladly help, but my nim knowledge is quite limited.... as you have probably seen - i've submitted only PRs for some very easy issues |
12:49:06 | watzon | But I keep getting `fatal error: io.h: No such file or directory` |
12:49:28 | watzon | Which it the same thing that happens with no mingw |
12:49:50 | miran | dom96: but then again, those issues are probably quite boring for you more experienced guys, and your time is better spent on those breaking changes that you mention |
12:49:54 | watzon | Would this be the right command to use? `nimble build -d:release --os:windows` |
12:50:33 | Yardanico | watzon, I've never used nimble for cross-compiling |
12:50:36 | dom96 | watzon: you likely need to specify --cc: as well |
12:50:39 | Yardanico | only nim compiler itself |
12:50:46 | Yardanico | and yeah, you need to specify mingw compiler |
12:50:55 | Yardanico | dom96, ah, sorry, you don't need it |
12:51:03 | Yardanico | you need to specify gcc path and executable |
12:51:12 | dom96 | yes |
12:52:00 | Yardanico | arnetheduck, it worked when I took LLVM IR compiled by nlvm, ran "opt" on it, then llc -filetype=obj -relocation-model=pic , and finally "gcc data.o -o a.out" |
12:53:37 | Yardanico | and hello world executable is smaller than nim with C backend :P |
12:56:54 | Yardanico | and we hit 1,100 issues again :( |
12:57:26 | * | ryanhowe joined #nim |
12:57:49 | FromGitter | <data-man> Hi, Nim lovers! |
12:58:03 | Yardanico | hi |
12:58:03 | miran | Yardanico: are you volunteering for the mentioned "month of bugfixes"? :) |
12:58:09 | watzon | What would I use for the --cc: param? |
12:58:15 | Yardanico | watzon, don't use it |
12:58:22 | watzon | Oh ok haha |
12:58:30 | Yardanico | watzon, did you see https://github.com/VKBots/Nickel/blob/fd1fe80931b0255fca5a23f12c0b2bfe3c6e5a6d/src/nim.cfg#L15 ? |
12:58:33 | Yardanico | do the same |
12:58:39 | FromGitter | <data-man> https://github.com/nim-lang/Nim/pull/6582 Please, (Enj|Destr)oy! :) |
12:59:10 | watzon | I did, and it's in the same spot. How do I make sure nim is using that config file? |
12:59:42 | Yardanico | well your config file should be in the same directory as your main source file |
13:00:02 | Yardanico | or you can compile via a command like this: |
13:00:02 | Yardanico | nim c --gcc.linkerexe="mingw binary" --gcc.exe="mingw binary" --gcc.path="mingw binary path" --gcc.options.linker="" --os:"windows" -d:windows |
13:00:03 | watzon | It is |
13:00:34 | Yardanico | watzon, well did you copy crosswin part as well? |
13:00:39 | Yardanico | e.g. @if crosswin @end ? |
13:00:53 | watzon | Yeah |
13:00:54 | Yardanico | gotcha! |
13:01:10 | Yardanico | I've added this "if" so it would cross-compile if you specify -d:crosswin |
13:01:12 | Yardanico | just try |
13:01:17 | Yardanico | nimble ... -d:crosswin |
13:01:22 | miran | data-man - nice speedups! |
13:01:22 | watzon | Oh! |
13:02:30 | watzon | It worked! |
13:04:15 | Yardanico | watzon, but generally you should use visual studio compiler (vcc). it usually produces faster/smaller binaries than mingw |
13:04:22 | Yardanico | but you can use it only from windows AFAIK |
13:04:33 | watzon | Of course haha |
13:04:49 | watzon | Well I have windows, I just prefer to do my development in Fedora |
13:05:05 | Yardanico | watzon, well ok, it won't hurt you anyway |
13:05:12 | Yardanico | until you have some high-performance program |
13:05:52 | watzon | Yeah I figured |
13:06:17 | Yardanico | also don't forget that, if you've used SSL, you'll need to provide ssl dll's |
13:06:52 | watzon | ssl dlls? |
13:07:03 | Yardanico | watzon, OpenSSL DLLs |
13:07:11 | Yardanico | watzon, if you've used httpclient with some https websites |
13:07:20 | Yardanico | or compiled with -d:ssl |
13:07:24 | watzon | With the -d:ssl flag right? or is there something else? |
13:07:30 | Yardanico | yes, with -d:ssl flag |
13:07:42 | Yardanico | if you don't use it - you don't need them |
13:07:48 | watzon | Ok yeah I've got that |
13:07:57 | watzon | I figured that out early on haha |
13:08:11 | Yardanico | https://nim-lang.org/download/dlls.zip in case you'll need them |
13:08:49 | watzon | How do you specify an output directory when using the `nim c` command? |
13:10:03 | Yardanico | watzon, usually you do --out:mybinarypath |
13:10:17 | FromGitter | <BigEpsilon> @data-man , seems great ! |
13:10:40 | Yardanico | watzon, e..g nim c -d:release -o:myfolder/mybinary myfile.nim |
13:10:58 | watzon | Perfect, thanks :) |
13:13:39 | FromGitter | <data-man> @miran, @BigEpsilon, Thanks! |
13:14:07 | PMunch | Okay, I've made some progress. By defining the procs as {.importc.} they get resolved on load-time. Only problem is that the name of the proc now has to be the Nim-mangled name.. |
13:14:46 | arnetheduck | Yardanico, well, nlvm compiles (internally, same as you did with opt etc) with whatever defaults there are, which probably means non-pic.. |
13:16:00 | * | claudiuinberlin joined #nim |
13:16:50 | dom96 | Anyone wanna write an article on how to cross-compile with Nim? :) |
13:17:23 | Yardanico | dom96, it's not enough for an article |
13:17:33 | Yardanico | one command or one small config file |
13:17:38 | Yardanico | better to add it to wiki probably |
13:20:01 | PMunch | Hmm, is Nim procedure mangling deterministic? Ie will I get the same name every time? |
13:20:25 | dom96 | Yardanico: It is enough. |
13:20:52 | dom96 | but add it to wiki if you prefer |
13:21:01 | dom96 | then add a link to it in nim-lang.org docs |
13:27:44 | Yardanico | PMunch, yes |
13:27:58 | Yardanico | it was non-deterministic before |
13:28:35 | Yardanico | PMunch, https://github.com/nim-lang/Nim/commit/4b0ba5e3f1b78b3c45a3f1576ed3d60f9a8b6d80 |
13:29:11 | Yardanico | but I may be mistaken |
13:30:24 | * | vlad1777d joined #nim |
13:30:41 | PMunch | Hmm, what I tried to do didn't really work anyways though.. |
13:30:48 | Yardanico | PMunch, Araq should know everything about that :) |
13:31:48 | * | Yardanico quit (Remote host closed the connection) |
13:32:14 | PMunch | Argh, this is so annoying. I feel like it should be possible somehow, seeing how it is possible in C. But I can't get it to work.. |
13:34:44 | PMunch | The main executable has the symbol defined, and the DLL has it undefined. But it still doesn't trickle down to the DLL.. |
13:36:15 | FromGitter | <andreaferretti> @Yardanico I fail to see how it can be one command or one small config file. Surely you must have installed stuff like clib for your target architecture? |
13:36:22 | FromGitter | <andreaferretti> I must admit I never tried |
13:36:47 | FromGitter | <andreaferretti> But i wouldn't think it could work out of the box to - say - compile an executable for Mac on a Linux box |
13:37:11 | FromGitter | <andreaferretti> Without installing something you copy from XCode or whatever |
13:37:59 | FromGitter | <andreaferretti> It seems to me there will be some nontrivial setup that maybe you are giving for granted |
13:39:35 | Araq | PMunch, use '.extern' to set an external name |
13:39:54 | PMunch | I tried that, but it didn't work.. |
13:43:41 | PMunch | Well it works in that I do get an undefined symbol in the .so file I create |
13:44:34 | PMunch | But when I try to load it into an executable that has the symbol defined (checked with "nm -g") I get nil from loadLib and dlerror (added with .emit.) returns that the symbol is not defined |
13:44:46 | PMunch | So the symbol does not get overwritten as it should be the loader |
13:44:58 | FromGitter | <ephja> meep meep |
13:46:12 | PMunch | According to the dlopen manpage it should resolve missing symbols on load |
13:46:30 | PMunch | And I did --passC:"-export-dynamic" when I compiled the main binary |
13:58:10 | * | zolk3ri joined #nim |
14:00:35 | * | derlafff joined #nim |
14:02:01 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:02:52 | PMunch | Phew, got it working now |
14:03:05 | PMunch | I was passing -rdynamic to --passC and not --passL |
14:10:14 | PMunch | Got to write this down.. |
14:14:23 | * | derlafff quit (Remote host closed the connection) |
14:27:06 | * | claudiuinberlin joined #nim |
14:27:06 | * | claudiuinberlin quit (Client Quit) |
14:29:39 | * | PMunch quit (Quit: Leaving) |
14:29:52 | * | claudiuinberlin joined #nim |
14:42:18 | * | PMunch joined #nim |
14:48:43 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
14:57:12 | * | ibutra_ quit (Read error: Connection reset by peer) |
15:00:24 | PMunch | Hmm, is there a way to get the name Nim will mangle a procedure to? |
15:00:36 | PMunch | I want to try and automate the process of the symbol lookup |
15:00:36 | * | derlafff joined #nim |
15:03:56 | * | arnetheduck quit (Remote host closed the connection) |
15:05:11 | PMunch | Hmm, I see --genMapping in the docs |
15:05:30 | * | arnetheduck joined #nim |
15:05:54 | PMunch | No idea how to call it though.. |
15:06:27 | PMunch | I tried with "nim c --genMapping <nim file>" and that just fails with gcc: error: libregex.c: No such file or directory |
15:08:30 | FromGitter | <mratsim> Seems like regex are Nim nemesis |
15:08:39 | PMunch | Haha :P |
15:12:21 | PMunch | https://github.com/nim-lang/Nim/issues/1592 |
15:12:32 | PMunch | Apparently it's been a bug since 2014.. |
15:13:40 | * | TjYoco joined #nim |
15:18:38 | * | zolk3ri quit (Quit: Lost terminal) |
15:19:17 | * | zolk3ri joined #nim |
15:22:50 | dom96 | It is low priority though :) |
15:24:14 | * | captainkraft joined #nim |
15:24:38 | captainkraft | Wow, I haven't been here since July. I hope things are still going strong :-) |
15:25:29 | captainkraft | I'm working on some debugging tools for C and was considering either Nim, Odin, or C++ for the project. I used Nim for a little while and enjoyed writing it. I also noticed there is a binding out there for Nuklear, the imgui library in C. |
15:25:45 | captainkraft | Odin has Dear Imgui bindings, but the language is very young. |
15:26:16 | captainkraft | And C++, well, it's C++ |
15:27:53 | SunDwarf | i wonder what recommendation youre gonna get in here :thinking: |
15:28:10 | gokr | Got some connection with the snap guys - to add Nim as a build plugin. |
15:29:52 | dom96 | captainkraft: welcome back :) |
15:31:17 | * | Trustable joined #nim |
15:31:50 | PMunch | captainkraft, haven't used Nuklear myself but I'll always recommend Nim :) |
15:38:39 | * | gokr quit (Ping timeout: 248 seconds) |
15:43:14 | * | PMunch quit (Quit: leaving) |
15:58:42 | * | ketralnis quit (Read error: Connection reset by peer) |
15:59:10 | * | ketralnis joined #nim |
16:02:39 | * | floppydh quit (Quit: WeeChat 1.9.1) |
16:03:16 | * | nsf quit (Quit: WeeChat 1.9) |
16:06:04 | * | claudiuinberlin joined #nim |
16:09:14 | * | dhalinar joined #nim |
16:12:37 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:15:40 | * | dhalinar2 joined #nim |
16:17:45 | * | dhalinar quit (Remote host closed the connection) |
16:19:11 | * | arnetheduck quit (Ping timeout: 248 seconds) |
16:19:30 | * | Viktor_ quit (Ping timeout: 260 seconds) |
16:19:48 | * | claudiuinberlin joined #nim |
16:21:08 | * | gokr joined #nim |
16:25:25 | FromGitter | <alehander42> how can I not escape symbols in a cstring ? e.g. `cstring"\t"` to be "\t" not "\\t" |
16:33:43 | * | gokr quit (Ping timeout: 258 seconds) |
16:43:02 | captainkraft | Can bindings be written in Nim for C++ libraries? |
16:45:40 | FromGitter | <BigEpsilon> yes |
16:45:52 | onionhammer | im │ dave24 |
16:45:55 | onionhammer | │10:24:38 captainkraft | Wow, I haven't been here since July. I hope things are still going strong |
16:46:01 | onionhammer | https://github.com/onionhammer/clibpp |
16:46:05 | onionhammer | sorry* wrong paste |
16:46:09 | FromGitter | <BigEpsilon> you can use c2nim to do some of the initial work |
16:46:20 | FromGitter | <BigEpsilon> and compile with cpp target |
16:46:44 | dave24 | what is this |
16:46:52 | dave24 | I got pinged by somebody claiming to be me!! |
16:46:55 | dave24 | outrage |
16:47:11 | * | sz0 quit (Quit: Connection closed for inactivity) |
16:47:17 | onionhammer | idk how that got in my clipboard lol |
16:51:42 | captainkraft | onionhammer: do you use Weechat? |
16:53:56 | * | kafke quit () |
16:55:21 | onionhammer | i do yes |
17:02:20 | captainkraft | I have that same clipboard issue sometimes. Somehow I highlight the wrong line and it just lives in my clipboard when I think something else is there. |
17:06:08 | captainkraft | Have you heard of, or have you experienced yourself, struggling as a Nim programmer to find work where you are allowed to use Nim? Contractors and consultants seem to have more control over their tools, but if you are delivering a software product, do the clients/customers expect it to be written in a language they are familiar with? |
17:06:45 | * | JappleAck joined #nim |
17:07:25 | * | Arrrr joined #nim |
17:07:25 | * | Arrrr quit (Changing host) |
17:07:25 | * | Arrrr joined #nim |
17:09:45 | * | dhalinar2 quit (Ping timeout: 258 seconds) |
17:10:46 | * | Jesin joined #nim |
17:23:45 | * | martinium joined #nim |
17:23:56 | subsetpark | yes :) |
17:24:34 | subsetpark | As a "professional Nim programmer", I would find it insane to suggest Nim to a client |
17:30:07 | captainkraft | Why is that? What kind of products would you be delivering? |
17:30:49 | captainkraft | s. How large are they compared to something similar in C++? |
17:30:55 | captainkraft | wtf.. |
17:31:30 | federico3 | captainkraft: it really depends on the client. Also, sometimes you provide a service, not software. |
17:31:30 | captainkraft | Off topic: I've read in the recent survey that Nim produces large binaries. How large are they compared to something similar written in C++? |
17:32:11 | federico3 | captainkraft: no, they are tiny, unless something went really wrong. |
17:32:34 | dom96 | what, where in the survey did you read that? |
17:34:49 | federico3 | dom96: IIRC it was one of the free-form answers in the survey |
17:38:46 | captainkraft | There were at least two responses that said "HUGE binaries" |
17:38:52 | captainkraft | I'll go back and check again |
17:39:22 | captainkraft | "Compiler doesn’t conform to Unix traditions and outputs HUGE binaries." |
17:40:00 | captainkraft | Oh, haha. The second one was the same quote, just put twice on the page. I took that as more than one person saying something similar :-/ |
17:40:09 | captainkraft | Good to know that's not true, then |
17:40:13 | * | Viktor joined #nim |
17:40:52 | federico3 | https://hookrace.net/blog/nim-binary-size/ |
17:44:54 | captainkraft | Very cool |
17:45:21 | dom96 | You shouldn't put such high trust in survey respondent's anyway :P |
17:45:43 | captainkraft | In that survey, there was also a complaint about exceptions and the standard library's reliance on them. Is that a common concern? |
17:48:11 | dom96 | I wouldn't say so. |
17:48:38 | dom96 | But if others think so then please speak up, stdlib is under review now. |
17:48:54 | SunDwarf | probably a go user got let out of their if err != nil cage |
17:49:12 | dom96 | lol |
17:49:42 | SunDwarf | also, if the stdlib is under review, I have some things about asyncdispatch |
17:49:52 | captainkraft | I've heard that exceptions are especially hated in the game making community. |
17:49:59 | SunDwarf | such as the lack of built-in async primitives such as locks or queues |
17:50:12 | SunDwarf | since ive come from python which has asyncio and etc which has all that stuff included |
17:50:44 | SunDwarf | unless i'm missing something in the docs somewhere |
17:51:23 | subsetpark | there are both locks and queues |
17:51:39 | subsetpark | (queues being implemented on deques) |
17:51:47 | SunDwarf | those are sync stuff for threads though, aren't they? |
17:53:37 | dom96 | locks are locks, they can be used for threads and async procs if you really want |
17:53:48 | dom96 | same for queues |
17:54:19 | dom96 | They don't do any IO so whether they are synchronous or asynchronous doesn't matter. |
17:55:14 | SunDwarf | I guess i'm missing something about how asyncdispatch works because i dont see how they wouldn't block everything |
17:55:32 | captainkraft | Can exceptions be disabled? Would that make a large chunk of the standard library useless? |
17:56:18 | FromGitter | <Yardanico> why would you want to disable them? |
17:56:30 | dom96 | SunDwarf: In fact, I don't see a reason why you'd need locks for async |
17:57:15 | SunDwarf | acquiring a lock whilst a proc does something such as wait on i/o so that no other proc can do that specific operation at the same time? |
17:57:33 | dom96 | can you give a concrete example? |
17:57:59 | FromGitter | <Varriount> captainkraft: You can, in a way. What would procedures do when they encounter an error condition though? |
17:59:24 | SunDwarf | e.g. i have a proc that makes a http request which is ratelimited, and I don't want anything else to be able to make a http request whilst the ratelimit is active, so the first proc holds the lock until it expires |
18:00:22 | FromGitter | <Varriount> SunDwarf: Have a global lastCallTime variable? |
18:00:25 | FromGitter | <data-man> IMO, the stdlib must have a functions to determine the capabilities of the processor. isSSE(), isSSE2(), etc. |
18:02:07 | SunDwarf | the particular service I use is really really touchy about not hitting the ratelimits, so having two requests happen where one exhausts the rate limit and sets lastCallTime and the other starts before it's set can't happen |
18:02:20 | dom96 | SunDwarf: Okay, so that would be a good use for locks. (I'd probably just have a counter called 'activeConnections' and not let anything exceed that, but both approaches will work). |
18:02:36 | dom96 | s/that/my max connections/ |
18:03:08 | dom96 | hrm |
18:03:17 | dom96 | I think I see what the potential problem would be |
18:03:29 | dom96 | Acquiring the lock would block everything |
18:04:26 | FromGitter | <kdheepak> > how can I not escape symbols in a cstring ? e.g. `cstring"\t"` to be "\t" not "\\\t" @alehander42 I'm also curious about this. Did you figure this out? |
18:06:44 | FromGitter | <Varriount> @kdheepak Where are you getting the cstring from, and how are you displaying it? |
18:07:09 | dom96 | SunDwarf: Make an issue :) |
18:08:00 | * | Viktor_ joined #nim |
18:08:21 | * | Viktor quit (Quit: Page closed) |
18:08:21 | * | Viktor_ is now known as Viktor |
18:08:42 | FromGitter | <Varriount> SunDwarf: Huh. But async things aren't preemptively scheduled. |
18:09:33 | FromGitter | <Varriount> It's possible to check and update that lastCallTime "atomically", unless you decide to yield in-between the check and set. |
18:11:20 | dom96 | Yeah, in general I still don't think locks are desperately needed for async. |
18:11:48 | dom96 | For this rate limiting use case you'd likely want a queue anyway |
18:11:55 | dom96 | And that would work fine with async |
18:12:34 | dom96 | I decided to do the boring work of finally merging upcoming async https://github.com/nim-lang/Nim/pull/6585 |
18:13:33 | * | ryanhowe quit (Quit: WeeChat 1.4) |
18:13:38 | * | dddddd quit (Ping timeout: 246 seconds) |
18:14:41 | subsetpark | dom96: that's not your unification of the threading and async await, is it? |
18:14:52 | dom96 | nope |
18:15:11 | dom96 | support for threading in asynchttpserver is on my todo list though |
18:15:26 | dom96 | But who knows whether it's even possible to achieve in a satisfactory manner right now |
18:15:52 | captainkraft | Varriount: I guess if a language has exceptions, there might not be a way to detect errors. So, maybe it is a serious problem for people who don't like exceptions. |
18:16:18 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:16:26 | dom96 | captainkraft: Yes, but Nim has checked exceptions. So this isn't a problem in general. |
18:16:40 | FromGitter | <Varriount> But exceptions *are*the way to detect errors. |
18:16:53 | dom96 | (optional checked exceptions, we're not Java :)) |
18:17:30 | SunDwarf | issue made, im not very good at writing them |
18:17:43 | captainkraft | How did people detect errors before exceptions were invented? |
18:17:49 | SunDwarf | apart from that ive absolutely fallen in love with nim in the last few weeks |
18:17:59 | FromGitter | <Varriount> There are two main models (that I know of). Either exceptions are represented a language mechanism, or they are returned as error codes/values |
18:18:34 | captainkraft | dom96: tbh, I'm not very familiar with exceptions. What do you mean checked exceptions and how is this better? |
18:19:10 | dom96 | proc foo() {.raises: [].} = raise newException(OSError, "") # Compile-time error: foo() raises OSError |
18:19:18 | FromGitter | <Yardanico> but this is not enforced in nim |
18:19:20 | FromGitter | <Yardanico> :) |
18:19:24 | dom96 | !eval proc foo() {.raises: [].} = raise newException(OSError, ""); foo() |
18:19:25 | NimBot | Compile failed: in.nim(1, 65) Error: statement not allowed after 'return', 'break', 'raise' or 'continue' |
18:19:25 | FromGitter | <Yardanico> as dom96 said |
18:19:27 | * | claudiuinberlin joined #nim |
18:19:31 | captainkraft | I've only heard others' complaints about exceptions. Performance overhead and unnecessary code to add all over the place are the common issues, iirc. |
18:19:37 | dom96 | oh heh |
18:19:44 | dom96 | !eval (proc foo() {.raises: [].} = raise newException(OSError, "")); foo() |
18:19:45 | NimBot | Compile failed: in.nim(1, 7) Error: ')' expected |
18:19:47 | FromGitter | <Yardanico> captainkraft: you don't need to add unnecessary code |
18:19:52 | dom96 | well that sucks |
18:20:12 | FromGitter | <Yardanico> dom96: nim is indentation based |
18:20:18 | dom96 | lol? |
18:20:32 | FromGitter | <Yardanico> !eval let myproc = (proc foo() {.raises: [].} = raise newException(OSError, "")); myproc() |
18:20:33 | NimBot | Compile failed: in.nim(1, 20) Error: ')' expected |
18:20:37 | FromGitter | <Yardanico> :D |
18:20:47 | FromGitter | <Yardanico> don't expect to be able to have everything on one line |
18:21:17 | FromGitter | <Varriount> captainkraft: Were they using C, C++, or Java? |
18:21:45 | FromGitter | <Varriount> Depending on the compiler, C++ exceptions can have very little overhead. |
18:21:56 | captainkraft | either C or C++. Most of the programmers I talk with are C and C++ devs. Many of them interested in game development. |
18:22:21 | FromGitter | <Yardanico> well exceptions in nim are not annoying |
18:22:30 | FromGitter | <Yardanico> if you don't need to check for an exception - you don't do it |
18:22:50 | FromGitter | <Varriount> captiankraft: Regarding errors, the only other method is to return an error code through the return value. |
18:23:00 | FromGitter | <Yardanico> and this is mostly ugly |
18:23:01 | FromGitter | <Varriount> In which case you still have to add logic to check for the error. |
18:23:27 | dom96 | Problem is that the way !eval works: you can't have more than one line. |
18:23:31 | dom96 | And you shouldn't need to. |
18:23:55 | FromGitter | <Yardanico> why "you shouldn't need to"? |
18:23:58 | FromGitter | <Yardanico> nim is not C++ with brackets |
18:24:16 | * | bkerin joined #nim |
18:24:48 | * | gokr joined #nim |
18:24:56 | dom96 | !eval let foo = (proc () {.raises: [].} = raise newException(OSError, "")); foo() |
18:24:56 | bkerin | cd |
18:24:57 | NimBot | Compile failed: in.nim(1, 37) Error: can raise an unlisted exception: ref OSError |
18:24:58 | dom96 | There we go |
18:25:19 | FromGitter | <Varriount> captainkraft: The only big arguments I've heard against C++ and Java-style exceptions are that they have a performance penalty, and add another mechanism to the programming language. |
18:25:54 | Arrrr | !eval echo "Not a bad argument" |
18:25:57 | NimBot | Not a bad argument |
18:26:07 | Arrrr | nimbot agrees |
18:26:23 | bkerin | is it possible to get an off-line copy of docs |
18:26:36 | FromGitter | <Varriount> bkerin: What browser do you use? |
18:26:54 | FromGitter | <Yardanico> bkerin: yes! |
18:27:14 | * | FromGitter * Varriount is going to take a nap now |
18:27:22 | FromGitter | <Yardanico> you can: ⏎ 1) download all pages docs ⏎ 2) generate docs yourself (if you have nim repo) ⏎ 3) use devdocs.nim, but they have nim 0.17.2 [https://gitter.im/nim-lang/Nim?at=59ef860a0182fa5f4d7205aa] |
18:27:26 | FromGitter | <Yardanico> *nim 0.17.0 |
18:27:39 | FromGitter | <kdheepak> @Varriount ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ef861bb20c64242941dc47] |
18:27:45 | FromGitter | <Yardanico> *devdocs.io |
18:28:23 | bkerin | i tried devdocs but it didn't have e.g. OOP Macro example and there was some stuff about voting for docs which turned me off |
18:29:17 | FromGitter | <Yardanico> it's nice actually |
18:29:23 | FromGitter | <Yardanico> and oop macro isn't official |
18:29:36 | FromGitter | <Yardanico> OOP macro is from "nim by example" |
18:30:19 | FromGitter | <Varriount> @kdheepak Ugh, I told @Araq the string prefix semantics were confusing. |
18:30:25 | FromGitter | <kdheepak> @Varriount on an unrelated note, I'm interested in working on the nlvm and adding features to allow a working REPL. I see that you've posted an issue there. I was wondering if you had used it / had any thoughts on where I could start |
18:30:44 | FromGitter | <Varriount> @kdheepak Use cstring("...") instead |
18:31:14 | FromGitter | <Varriount> @kdheepak What was the issue? |
18:31:42 | FromGitter | <Yardanico> @kdheepak I don't think you should start doing a REPL based on NLVM |
18:32:00 | FromGitter | <kdheepak> This repo (https://github.com/arnetheduck/nlvm). I'm just curious if you've used it. |
18:32:11 | FromGitter | <Yardanico> Firstly NLVM should have all features Nim has, e.g. threads |
18:32:35 | hogeland | bkerin: The docs are all checked in: https://github.com/nim-lang/Nim/tree/devel/doc |
18:33:16 | FromGitter | <kdheepak> @Yardanico Can you elaborate? I'm new enough to Nim that I don't know what the best way to go about this would be. |
18:33:32 | hogeland | bkerin: And for any individual modules you can generate the docs: https://github.com/nim-lang/Nim/tree/devel/doc/docgen.rst |
18:33:45 | FromGitter | <kdheepak> Perhaps I should open a forum thread regarding this, so that this conversation is easier to reference. |
18:33:57 | FromGitter | <Yardanico> @kdheepak NLVM is developed only by one developer |
18:34:12 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:35:23 | GitDisc | <GooRoo> the usual concern regarding exceptions in C++ is possible problems during unrolling the stack |
18:35:23 | FromGitter | <Yardanico> I think really nim should make all stdlib modules in pure-nim (without importc), and then LLVM backend would be really good |
18:35:54 | GitDisc | <GooRoo> that was for previous discussion |
18:38:19 | FromGitter | <Yardanico> the problem with LLVM is: it's yet another backend for nim |
18:38:21 | dom96 | Yardanico: That's impossible |
18:38:22 | FromGitter | <kdheepak> Perhaps importc could use FFI instead? |
18:38:29 | FromGitter | <Yardanico> dom96: it IS possible |
18:38:31 | FromGitter | <Yardanico> why not? |
18:38:38 | FromGitter | <Varriount> @Yardanico And I would love it if we had a wealthy company or donor to back Nim. |
18:38:46 | dom96 | Because the OS APIs are implemented in C |
18:38:47 | FromGitter | <Yardanico> yeah, that's the only problem :P |
18:38:55 | FromGitter | <Yardanico> well you can have FFI to support them |
18:38:59 | FromGitter | <Yardanico> I mean direct "importc" |
18:39:07 | dom96 | You mean without 'header' |
18:39:14 | dom96 | That's what the problem is for the LLVM backend |
18:39:20 | dom96 | dynlib is fine |
18:39:26 | FromGitter | <kdheepak> @dom96 this would be possible if we used shared libraries and dynamic loading, yes? |
18:39:28 | FromGitter | <Yardanico> well yes, I know that dynlib is fine |
18:39:29 | FromGitter | <Varriount> How do other languages using LLVM interface with the OS? |
18:40:28 | FromGitter | <kdheepak> @Varriount I believe Julia ( which uses LLVM ) does it using dynamic loaded libraries |
18:40:58 | * | claudiuinberlin joined #nim |
18:44:40 | dom96 | kyrenn is awesome https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/dotvkdj/?context=3 |
18:45:25 | * | ibutra joined #nim |
18:45:33 | FromGitter | <kdheepak> @Varriount To clarify, (to my understanding) the dynamic loaded libraries discussion is relevant only because we are interested in using importc functions in a REPL environment. |
18:46:30 | bkerin | with the ref counting garbage collector, is the descturcotr guaranteed to be called when an object goes out of scope? |
18:46:36 | bkerin | if its the last ref? |
18:47:20 | dom96 | Good question. You might wish to use a finaliser instead, AFAIK destructors don't work this way. |
18:47:51 | bkerin | that's probably what I meant, I know destructors are WIP still |
18:48:09 | dom96 | I think you do get a guarantee in that case, but maybe Araq can confirm |
18:51:04 | bkerin | ref counting collector is the only gc where it seems like it might. The compiler doc shows --gc:refc|v2|markAndSweep|boehm|go|none|regions and I recall reading elsewhere that gc can be tuned is there a more detailed description of that somewhere? |
18:51:16 | captainkraft | Is nimx the best solution for GUI applications in Nim, currently? |
18:55:11 | captainkraft | dom96: you mentioned checked exceptions and then showed how !eval gave a compilation error. Is that to demonstrate that you can't use a function that raises an exception without handling it? Sorry, I'm not following. |
18:55:23 | dom96 | yep, precisely |
18:55:48 | dom96 | !eval let foo = (proc () = raise newException(OSError, "")); foo() |
18:55:49 | Araq | bkerin, the RC'ed GC offers no such guarantee either because it's *deferred* RC |
18:55:51 | NimBot | <no output> |
18:55:58 | dom96 | Well that's disappointing. |
18:56:02 | captainkraft | haha |
18:56:05 | dom96 | It should show the error, but anyway, now it compiles |
18:56:05 | * | dddddd joined #nim |
18:56:15 | captainkraft | Doesn't that make exceptions more annoying? I can't just ignore them? |
18:56:41 | dom96 | captainkraft: you can, the point is that you have the option to get the compiler to annoy you about them. |
18:57:09 | Araq | captainkraft, depends, nimx is game focussed being based on SDL, for native GUI we also have the usual huge messy gtk/wxWidgets etc wrappers |
18:57:17 | dom96 | So you can decide "Okay, I don't want function `foo` to raise any exceptions, I want to handle all of them explicitly." |
18:57:31 | dom96 | You mark it with {.raises: [].} and the compiler tells you the exceptions you need to handle |
18:57:42 | bkerin | Araq ok I though probably but worth an ask. something has to do unref I though maybe could be made immediate somehow |
18:59:00 | captainkraft | Araq: I found a wrapper for iup and nuklear as well. Not much in the way of tools built in Nim, it seems. |
18:59:13 | captainkraft | The Nuklear bindings might be just what I need, though |
18:59:38 | captainkraft | dom96: I see, so optional compile-time checking as well as a way to handle errors at runtime? |
18:59:39 | Araq | captainkraft, for browser based UIs I would use 'karax' but I wrote it so I'm biased |
19:00:00 | dom96 | captainkraft: yep |
19:00:00 | GitDisc | <GooRoo> has anyone tried https://github.com/filcuc/nimqml for UI? |
19:00:22 | dom96 | Araq: What's the status of ormin? |
19:00:23 | captainkraft | My goal is to write desktop applications as standalone programming tools. A simple debugger for C is what I'm working on now. |
19:02:19 | captainkraft | dom96: do the standard library functions that raise exceptions have the compile-time checking built in by default? |
19:02:54 | dom96 | captainkraft: the compiler infers everything automatically :) |
19:06:15 | FromGitter | <mratsim> Would love to see @data-man suggestion somewhere: isSSE, isAVX, etc to detect CPU capabilities |
19:07:51 | * | miran_ joined #nim |
19:08:31 | captainkraft | What is the preferred way of keeping Nim and libraries up-to-date? |
19:08:56 | captainkraft | Ubuntu's Nim package is way out of date, and I recall reading about a tool that does this for you? |
19:09:16 | FromGitter | <Varriount> captainkraft: Nimble |
19:09:26 | federico3 | captainkraft: no, Nim is at 0.17.2 in artful |
19:09:46 | FromGitter | <Varriount> GooRoo: I might try it on my Windows laptop later today, if I have time. |
19:10:27 | FromGitter | <Varriount> Though, it looks to have been only tested on Linux |
19:10:34 | * | nsf joined #nim |
19:11:19 | dom96 | captainkraft: choosenim |
19:12:41 | captainkraft | choosenim, that's the one |
19:14:30 | * | rauss quit (Quit: WeeChat 1.9.1) |
19:17:56 | captainkraft | dom96: Araq: What do you think is keeping Nim from more wide adoption? Are you confident that will change after 1.0? |
19:18:38 | miran_ | captainkraft: small amount of packages/libraries |
19:18:38 | dom96 | captainkraft: A Mozilla/Google/Facebook/Microsoft |
19:18:48 | miran_ | and that's because of small community |
19:18:56 | dom96 | Whether that is strictly necessary for wide adoption is an open question |
19:19:04 | miran_ | and that's because of small amount of packages/libraries, and that... |
19:19:38 | captainkraft | Will that change? How? |
19:20:03 | dom96 | But if myself and Araq (and some others, notably zahary) were able to work on Nim full-time, with sponsorship from a big company, Nim would move a lot faster and we would have more time to market it |
19:20:04 | * | Arrrr quit (Read error: Connection reset by peer) |
19:20:09 | federico3 | Python never had [in]famous tech companies pushing it, yet... |
19:20:34 | miran_ | but things might change for better after v1.0 is out - if that is not just renamed v0.18, and it guarantees more stability and less breaking in the future versions |
19:20:41 | dom96 | Indeed. That gives me hope, but it also feels like we're living in a different age these days |
19:20:57 | GitDisc | <GooRoo> Python didn't need it because there was no good competitor in fact |
19:21:06 | * | PMunch joined #nim |
19:22:22 | GitDisc | <GooRoo> Ruby was created in 2005, but became famous only in 2001 or 2002 with the release of Ruby on Rails |
19:22:51 | PMunch | GooRoo, got that backwards? |
19:23:11 | captainkraft | 2011/12 perhaps? |
19:23:14 | FromGitter | <data-man> @mratsim, a programs should work fast on any hardware. :) ⏎ For e.g., in the Delphi (and in the FreePascal), a functions that are optimized for a specific set of processor instructions are dynamically assigned at run time. |
19:23:21 | GitDisc | <GooRoo> sorry, in 1995 |
19:23:36 | hogeland | >Python never had [in]famous tech companies pushing it, |
19:23:37 | GitDisc | <GooRoo> missed 10 years accidentally ) |
19:23:46 | ibutra | Araq, dom96 can I have some input on https://github.com/nim-lang/Nim/issues/6541 |
19:23:59 | hogeland | that's not totally true, since Guido worked at Google on Python for yeards |
19:24:05 | hogeland | *years |
19:24:21 | hogeland | But yeah it wasn't popular because of a corporate push |
19:24:39 | captainkraft | dom96: what's a good way to ease into contributing to the language itself? Should new Nim users wait until they are much more familiar with the language before attempting to contribute? |
19:24:43 | bkerin | well noob perspective here: im trying nim because: C and JS backends, typed, fast compiled |
19:24:51 | FromGitter | <Varriount> hogeland: However Python did not have 3 different company-sponsored languages competing against it (Go, Rust, Swift) |
19:24:51 | dom96 | hogeland: wasn't that after it became somewhat mainstream? |
19:24:54 | federico3 | hogeland: the language was already popular before that |
19:25:37 | bkerin | it seems like the best choice with these features to me, so if it does get polish and maybe some backing it would seem to be logical choice for lots of uses |
19:26:04 | hogeland | Varriount: that's very true |
19:26:15 | dom96 | ibutra: sorry, wish I could help but this is a question for Araq |
19:26:21 | ibutra | captainkraft I am quite new with nim and I just look at the issues labled easy or really interest me and try my best. (Just spend the last 5 hours after I was done working figuring out where assignments are generated ;) ) |
19:27:04 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:27:12 | ibutra | dom96 don't worry I will just wait for him then :) |
19:29:41 | PMunch | Hmm, is there no way to get the mapping from nim procedure definition to C-mangled symbol? |
19:30:28 | * | demi- quit (Ping timeout: 240 seconds) |
19:30:30 | ibutra | If I recall correctly there is a pragma to turn off mangling for a procedure. would that help? |
19:31:13 | PMunch | Not really, turning it off won't work for multiple procs with the same name but different signatures (as C doesn't allow this) |
19:31:19 | * | Jesin quit (Quit: Leaving) |
19:31:50 | PMunch | I could of course use the extern pragma to define the mangled name of each proc myself, but that's just as much work.. |
19:32:34 | * | demi- joined #nim |
19:32:43 | dom96 | PMunch: I think you'll have to define the names yourself |
19:32:54 | dom96 | you can use a macro for this |
19:33:16 | PMunch | Hmmm |
19:33:30 | PMunch | Why couldn't --genMapping just work :P |
19:33:50 | PMunch | Would've made this process so much easier.. |
19:34:14 | PMunch | Hmm, maybe I can parse the GDB debugger symbols.. |
19:34:25 | PMunch | Those tell you what proc it is right? |
19:34:37 | * | craigger joined #nim |
19:36:53 | * | claudiuinberlin joined #nim |
19:39:15 | * | Sentreen quit (Ping timeout: 258 seconds) |
19:39:32 | PMunch | --embedsrc embeds everything as comments, expect proc definitions.. |
19:40:40 | * | sleepyqtx joined #nim |
19:42:44 | GitDisc | <treeform> Hey dom96, on HN you said "Indeed, Araq's plan is to release v1 ASAP (he said by the end of this year on IRC) and implement the ideas described in this article afterwards for a Nim v2." Is there any more about time lines and what nim team plans are? |
19:44:01 | * | sleepyqt quit (Ping timeout: 248 seconds) |
19:44:25 | dom96 | Not really. I think in general though the consensus is that v1 has been taking too long, and we all want it out ASAP. |
19:44:57 | dom96 | But we really don't have any timelines ourselves. It will be ready when it's ready. |
19:45:19 | * | martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:45:57 | GitDisc | <treeform> Sounds good. That is how I operate too. Can't blame others. |
19:47:37 | PMunch | Is there really no default way to get something like a mangling table? |
19:47:55 | PMunch | Seems like something that would be pretty easy to put in.. |
19:48:05 | PMunch | After all Nim has to know the mapping at some point |
19:48:13 | dom96 | But if you're thinking of holding off on Nim until after v1, please don't. We still have time to make breaking changes, and the more people use it now the higher the chances that we will be able to find out what changes need to be made. |
19:48:42 | dom96 | PMunch: why do you need this? |
19:49:26 | PMunch | I'm dynamically loading code into the program, and it needs to get some procedures from the main program |
19:49:42 | PMunch | By some I mean 80+ so passing them in a setup function wouldn't work |
19:50:18 | PMunch | Currently I have something like: proc define(i: In): ref MinScope {.importc, extern: "define_HtvBzo0skz2GBYAKuFddKA".} |
19:50:34 | PMunch | Which I've written manually for the five procs I used in a test |
19:50:53 | PMunch | And it works fine, but adding all 80 would be really tedious.. |
19:51:19 | ipjk | Why won't the non-mangling pragma work? Why do you need to mangle the names? |
19:51:44 | PMunch | Because I have many procs with the same name but different signatures, and C doesn't allow that |
19:51:52 | PMunch | So they would have to map to different symbols |
19:51:59 | PMunch | And I would have to do the mapping manually again |
19:52:09 | * | Sentreen joined #nim |
19:52:11 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
19:52:19 | ibutra | But don't you need a manual step for those anyway? |
19:52:41 | PMunch | I was hoping that I could use --genMapping and write a script that would automatically rewrite that into the procedure definition code |
19:52:49 | GitDisc | <treeform> dom96, naa I am using nim. Convincing other people though... i bet they would just complain about other things. People hate change. |
19:53:06 | ibutra | or are you parsing the types of the arguments somewhere to know which one to call if you had the mangling mapping? |
19:53:18 | PMunch | If I had a file with something like "proc define(i: In): ref MinScope -> define_HtvBzo0skz2GBYAKuFddKA" it would be dead easy to do |
19:54:33 | PMunch | I'm just defining them as "don't worry, you'll find this symbol when you're running" and the compiler spits out a file with undeclared symbols in it. When the program loads them it will allow it to read from it's symbols table and therefore get the definition for the symbol. |
19:58:30 | ibutra | you could try to find out where the mangling is done and see if it is deterministic. If so you could reproduce it |
19:58:41 | Araq | PMunch, the name mangling is deterministic |
19:58:43 | gokr | hogeland: I am not fully certain, but I suspect one strong factor pushing Python along was Redhat's move to focus entirely on it. |
19:59:03 | Araq | you can rely on the name define_HtvBzo0skz2GBYAKuFddKA (but really shouldn't...) |
19:59:20 | PMunch | Yes, but I don't want to manually get all 90 of these |
19:59:28 | PMunch | And especially not if it suddenly changes |
19:59:42 | Araq | there was an awesome hack for this |
19:59:47 | Araq | oh yeah |
19:59:57 | PMunch | Is the name mangling defined somewhere so I can easily copy it? |
20:00:12 | PMunch | It's not like the md5 hash of the signature or something |
20:00:23 | Araq | PMunch, muhahaha welcome to world of namespaces |
20:00:54 | Araq | we need to hash an awful lot to guarantee distinct hashes |
20:01:15 | PMunch | Oh right, good point |
20:01:23 | PMunch | So how are they generated? |
20:01:38 | PMunch | Just a counter somewhere? |
20:01:50 | Araq | compiler/sighashes.nim |
20:02:05 | Araq | you don't want to copy these 300 lines of code |
20:02:21 | Araq | it's not a counter, I said it's deterministic now |
20:02:36 | * | gokr noticing a certain boost in number of people here... |
20:02:57 | dom96 | gokr: 2018 will surely be the year of Nim |
20:03:05 | dom96 | :) |
20:03:16 | gokr | Hehe |
20:03:29 | PMunch | Oh, it's that deterministic |
20:03:30 | miran_ | dom96: and the year of linux, from what i heard :D :D |
20:03:41 | PMunch | Araq, so what should I do then? |
20:03:43 | dom96 | For those of you that didn't see, based on this reply it seems that Nim really is perfect for game dev https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/dotvkdj/ |
20:03:56 | gokr | The year of Linux on the Desktop! Eh... no, that was another year. |
20:03:59 | dom96 | (Developer of Stardew Valley/Starbound) |
20:04:06 | * | dom96 is awestruck |
20:04:11 | PMunch | I got nim to compile with --genMapping by setting --nimcache to the current directory and copying in nimbase.h |
20:04:24 | PMunch | But the Symbols table in the mapping.txt file is still empty.. |
20:05:04 | miran_ | gokr: that year was in the past or in the future? :P |
20:05:11 | miran_ | or both? :D |
20:06:35 | gokr | dom96: That is indeed a really nice post. Hope he pops in here also so that Araq can help him out with that evaluation |
20:06:40 | miran_ | Araq, dom96: "Nim has its roots in a mash-up of Python and Pascal, and it borrows a lot of bad ideas from Pascal/Delphi. You can take the developer out of Pascal but it's very hard to take the Pascal out of the developer" |
20:06:58 | miran_ | seen in this thread: https://www.reddit.com/r/Python/comments/78f2y9/nim_a_new_option_for_optimizing_inner_loops/ |
20:07:25 | FromGitter | <Yardanico> https://www.reddit.com/r/Python/comments/78f2y9/nim_a_new_option_for_optimizing_inner_loops/dotzvsn/ |
20:08:02 | Araq | miran_, so? people are free to have this opinion. |
20:08:21 | Araq | at least I didn't take the bad ideas of Python. |
20:08:27 | miran_ | hehehe |
20:08:36 | Araq | which would be pretty much everything beyond its basic syntax. |
20:09:14 | miran_ | i've copied the link - thought maybe one of you might join the discussion |
20:12:21 | Araq | in fact, even its basic syntax is inconsistent, *def*ine method, define *class* |
20:13:59 | Araq | PMunch, what are you trying to do? |
20:15:55 | hogeland | Ah, you know what Python has that Nim is missing? |
20:15:55 | PMunch | Well, I'm loading a dynamic library and I need to access some of the symbols of the main program. Currently I have proc define(i: In): ref MinScope {.importc, extern: "define_HtvBzo0skz2GBYAKuFddKA".} which works fine and creates a dynlib with that system as undefined and reads it from the global symbols table when it's loaded into the program. However I don't want to manually generate those mappings for 80+ procs, so I'm looking for a way to automate the |
20:15:57 | PMunch | process |
20:16:06 | hogeland | The killer feature that brought it to the top? |
20:16:15 | hogeland | The global interpreter lock |
20:16:49 | FromGitter | <Yardanico> :D |
20:19:49 | PMunch | Aha, with --debuginfo I got something which might be useable |
20:21:26 | PMunch | I can search through the .nim file I want to map, then for each "proc" I can get the current line, then look in the .ndi file and grab the mangled name from there |
20:21:33 | PMunch | Unless you have a better idea Araq |
20:23:49 | * | Zwei joined #nim |
20:24:14 | * | Zwei left #nim (#nim) |
20:25:41 | PMunch | https://github.com/nim-lang/Nim/blob/5dca695bcfaad7212679c80b3219e0f69afdca7d/compiler/extccomp.nim#L877 |
20:25:49 | Araq | PMunch, import the module that defines the procs? |
20:25:52 | PMunch | This seems like the broken part of --genMapping by the way |
20:26:39 | PMunch | Araq, that would mean that each dynlib would be copying half the main program. And for every fix in the main program every dynlib would have to be compiled again not to break anything.. |
20:27:41 | FromGitter | <Yardanico> we definitely need a library to ease splitting our modules into different dll's :) |
20:28:00 | Araq | PMunch, define a pragma that does either |
20:28:10 | PMunch | Either what? |
20:28:21 | * | miran_ quit (Ping timeout: 240 seconds) |
20:28:22 | Araq | .dynlib, importc |
20:28:26 | Araq | or |
20:28:36 | elrood | wouldn't the obvious solution to PMunch's problem be to just fix --genMapping instead of wasting time searching for workarounds? |
20:28:39 | Araq | .dynlib: "name.dll", exportc |
20:29:07 | PMunch | elrood, yeah that would be nice. Or at least remove it since it's quite broken as-is |
20:30:46 | PMunch | Error: 'dynlib' requires 'exportc' |
20:30:53 | PMunch | So I guess the first one is out.. |
20:30:56 | * | obadz joined #nim |
20:30:58 | FromGitter | <Yardanico> ? |
20:31:07 | FromGitter | <Yardanico> {.dynlib: "name.dll", exportc.} |
20:31:10 | PMunch | What would .dynlib: "name.dll", exportc do? |
20:31:34 | PMunch | Yardanico, the other was Araqs first suggestion |
20:31:43 | FromGitter | <Yardanico> yes |
20:31:50 | FromGitter | <Yardanico> but why you didn't try his solution? |
20:32:17 | PMunch | I tried the first one, "{.dynlib, importc.}" that didn't compile |
20:32:35 | * | Trustable quit (Remote host closed the connection) |
20:32:42 | FromGitter | <Yardanico> did you try dynlib with name.dll ? |
20:32:51 | PMunch | What would "{.dynlib: "name.dll", exportc.}" actually do? |
20:33:02 | Araq | well the other way round |
20:33:10 | Araq | .dynlib, exportc |
20:33:22 | Araq | .dynlib: "my.dll", importc |
20:35:08 | PMunch | Wait, I think you misunderstood |
20:35:21 | PMunch | It's the dynlib that needs symbols from the main program |
20:35:24 | PMunch | Not the other way around |
20:36:54 | dom96 | damn, we're definitely getting many more PRs |
20:36:58 | dom96 | Not sure if hacktoberfest |
20:37:05 | dom96 | or it really is the year of Nim |
20:37:33 | FromGitter | <Yardanico> but many of them aren't merged |
20:37:39 | FromGitter | <Yardanico> and many of them are very old |
20:37:41 | PMunch | I'll guess we'll see in November.. |
20:37:45 | FromGitter | <Yardanico> and they are not resolved/closed |
20:38:00 | GitDisc | <treeform> I used nim at work and got paid for it, so that is a first for me. |
20:38:02 | dom96 | Yardanico: Stay positive my friend :) |
20:38:23 | dom96 | treeform: nice, where do you work (if you don't mind sharing this)? |
20:39:55 | * | Vladar quit (Quit: Leaving) |
20:40:09 | GitDisc | <treeform> It was just for a hakathon-like project. We will probably not use it in production. Because I do data crunching no one cares what I use as they are one-off scripts. |
20:40:33 | GitDisc | <treeform> I work for a social site called reddit. |
20:40:41 | FromGitter | <Yardanico> woow |
20:40:42 | dom96 | whoa, for real? |
20:41:22 | dom96 | That's pretty freaking awesome |
20:41:36 | GitDisc | <treeform> I do not feel it is that exciting... |
20:42:49 | PMunch | treeform, you don't like working for them, or you don't think the job is exiting? |
20:43:06 | GitDisc | <treeform> Oh i love working here and my job is pretty good. |
20:43:21 | Viktor | If I name a file stdin.nim, add only this line “let inText = stdin.readLine()” I get an error at nim c -r : stdin.nim(1, 20) Error: undeclared identifier: 'readLine' |
20:43:27 | GitDisc | <treeform> The fact that I used nim is not that exciting. Its a cool language why not. |
20:43:31 | Viktor | if I name it anything else it works |
20:43:38 | elrood | perhaps if you could expand a little on the *we will probably not use it in production* bit, that'd be helpful for the project. always good to hear what is standing in the way of adoption |
20:43:42 | Viktor | should I log a bug report, or is this a know issue? |
20:43:51 | FromGitter | <Yardanico> this is a known issue |
20:43:54 | FromGitter | <Yardanico> you can't do that |
20:43:58 | dom96 | treeform: oh yeah, I was referring to the fact that you work at Reddit. |
20:44:24 | FromGitter | <mratsim> You can see talks about v1 soon from 2014 in the forum ;) |
20:44:28 | Viktor | so what I cannot do is name a file anything that is in the nim source repo, or only stdin is not allowed? |
20:44:45 | GitDisc | <treeform> dom if you find your self in SF, stop by I will show you around. |
20:45:07 | FromGitter | <Yardanico> you can't name your file "myvar.nim" if you have myvar in myvar.nim |
20:45:23 | dom96 | treeform: Ooh, thanks. Will keep this in mind :D |
20:45:26 | Viktor | aha ok, got it! |
20:46:12 | Viktor | I am going through your book dom96 by the way, it is awesome. |
20:46:29 | dom96 | Viktor: Glad you like it, thanks for buying it :) |
20:46:42 | Viktor | I am reading it on Safari, I have a subscription |
20:46:48 | Viktor | I hope you still get money for it. |
20:47:21 | bkerin | i don't understand .used. pragma example |
20:47:21 | dom96 | ahh cool. Good question, I have no idea heh |
20:47:40 | * | xet7 quit (Read error: Connection reset by peer) |
20:47:43 | Viktor | But I will most likely buy it as well, and have it on the shelf :) |
20:47:44 | bkerin | echoAdd and echoSub do not have * so how are they exported? |
20:48:18 | GitDisc | <treeform> elrood, I build kind of a map reduce thingy, I need to convince people that my map reducer thingy is better then their map reducer thingy. |
20:48:35 | bkerin | o |
20:48:37 | bkerin | not exported |
20:48:49 | bkerin | nm |
20:50:27 | PMunch | Well okay, I'm off now |
20:50:27 | ipjk | bkerin: it ignores the warning produced for a function not used. |
20:50:54 | ipjk | bkerin: they aren't exported, they are used within the same module. |
20:51:03 | PMunch | Guess I'll be writing a script to create my mapping tomorrow from the ndi file, should be fun -_- |
20:51:40 | * | PMunch quit (Quit: leaving) |
20:54:25 | ipjk | bkerin: but lets say you have proc add(...) in module 'a.nim', if you forgot the export and try to use it in another module, a warning will be printed telling you proc add(...) isn't used. |
20:54:41 | ipjk | bkerin: since it isn't called in module 'a.nim', just implemented. |
20:55:35 | * | Jesin joined #nim |
20:59:36 | Araq | <mratsim> You can see talks about v1 soon from 2014 in the forum -- yup, and it will be "really soon" in december 2020 |
21:02:06 | bkerin | ipjk i got it thx was misreading the doc though it talked about exported unused syms |
21:02:53 | * | bkerin quit (Quit: "Wife who put husband in doghouse soon find him in cat house.") |
21:03:50 | * | xet7 joined #nim |
21:04:20 | * | Jesin quit (Quit: Leaving) |
21:05:34 | * | ibutra quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
21:17:13 | * | martinium joined #nim |
21:18:36 | * | TjYoco quit (Quit: Leaving) |
21:28:40 | watzon | How would I go about linking libeay64.dll when compiling? Or can you? |
21:29:24 | watzon | I'm trying to compile a program that requires ssl for Windows |
21:32:51 | * | sleepyqtx quit (Quit: Leaving) |
21:37:10 | * | Nobabs27 joined #nim |
21:39:22 | dom96 | watzon: it's loaded at runtime |
21:39:25 | * | dhalinar2 joined #nim |
21:39:30 | dom96 | you can't statically link a dll |
21:39:39 | watzon | Ahh ok |
21:40:02 | watzon | So is there a way to do it that won't require loading it at runtime? |
21:40:19 | dom96 | no easy way I'm afraid |
21:41:05 | * | adeohluwa joined #nim |
21:41:52 | watzon | Well damn haha |
21:43:24 | dom96 | why do you want to statically link it? |
21:43:38 | Araq | you can get the C code and .compile it and do some --dynlibOverride |
21:44:16 | Araq | we probably should have figured out how to do that years ago, no DLL required for SSL support |
21:44:58 | watzon | dom96: make the release process a little easier |
21:45:10 | watzon | Araq: agreed |
21:45:27 | Araq | watzon, try it please and report your results |
21:46:22 | Araq | that would really be useful for the whole community |
21:46:46 | watzon | I imagine I'd want this? https://github.com/openssl/openssl |
21:48:05 | watzon | I'm not a big C guy, so a lot of this stuff is still pretty new to me |
21:50:37 | elrood | especially for security-relevant things like ssl dynamic linking makes more sense though |
21:54:54 | * | martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:01:19 | * | elrood quit (Quit: Leaving) |
22:03:22 | * | vlad1777d quit (Ping timeout: 264 seconds) |
22:06:01 | * | vlad1777d joined #nim |
22:07:31 | * | Viktor quit (Quit: Viktor) |
22:20:09 | GitDisc | <GooRoo> @dom (dom69), I believe that ConcernedApe is the developer of Stardew Valley. Chucklefish is the publisher (and probably they could help him with porting it to more platforms) |
22:20:44 | dom96 | Yep |
22:20:54 | FromGitter | <kdheepak> @GooRoo its @dom96 but he'll probably see this message anyway. |
22:21:51 | FromGitter | <kdheepak> Is there an example of Nim on Android that I can take a look at? |
22:22:13 | dom96 | there is something in the Nim repo |
22:23:23 | GitDisc | <GooRoo> @kdheepak I know, but it's difficult to make mentions relying on some bridge between Discord, Gitter and IRC |
22:23:23 | FromGitter | <kdheepak> Found it! Thanks! |
22:23:58 | * | dhalinar2 quit (Ping timeout: 240 seconds) |
22:26:18 | GitDisc | <GooRoo> https://www.youtube.com/watch?v=u0rh4RcGXo8 |
22:26:34 | GitDisc | <GooRoo> Wrong chat, sorry |
22:30:16 | GitDisc | <GooRoo> BTW, one more reason to use something modern like Slack or Discord without bridges: ability to edit / delete messages |
22:32:14 | GitDisc | <GooRoo> I've removed the link, posted by mistake, but it has already been synced |
22:32:47 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
22:33:20 | * | Jesin joined #nim |
22:34:09 | * | gokr quit (Ping timeout: 248 seconds) |
22:35:21 | * | nsf quit (Quit: WeeChat 1.9) |
22:40:11 | adeohluwa | say you have a node. js app on a server, all things bn equal you can handle a lot more users by just switching to nim lang right? |
22:44:44 | adeohluwa | between the twitch tv live stream == "awesome" |
22:45:52 | * | vlad1777d quit (Ping timeout: 260 seconds) |
22:52:11 | * | vlad1777d joined #nim |
23:04:19 | * | Lord_Nightmare joined #nim |
23:16:58 | * | Nobabs27 quit (Quit: Leaving) |
23:32:49 | * | derlafff quit (Remote host closed the connection) |
23:32:58 | * | derlafff joined #nim |
23:42:30 | * | JappleAck quit (Quit: Leaving) |
23:42:44 | * | zolk3ri quit (Quit: leaving) |