00:16:20 | * | bjz joined #nim |
00:17:24 | * | bjz_ quit (Ping timeout: 260 seconds) |
00:38:57 | * | chemist69 joined #nim |
00:40:59 | SusWombat | why is editorconfig "unix crap"? |
00:40:59 | SusWombat | https://github.com/nim-lang/Nim/pull/5840 |
00:41:33 | couven92 | SusWombat, yeah, I wondered the same thing... But Araq remained relentless... :P |
00:42:16 | couven92 | SusWombat, https://irclogs.nim-lang.org/18-05-2017.html#14:14:18 |
00:44:07 | SusWombat | couven92, thats a stupid explanation but well i can see why someone might not want to add additional files |
00:45:29 | couven92 | yeah, I don't agree either, but well... Not my call, I just leave the .editorconfig in my local copy anyways, I did the PR to share my idea of proper editorconfig'ing in case somebody else would care |
00:48:42 | * | Trioxin joined #nim |
00:54:38 | demi- | tbh i've never heard of editorconfig before, do any major editors use it? |
00:54:52 | SusWombat | demi-, it is a plugin you install you self |
00:55:01 | SusWombat | and yeah its aviable for the major browsers |
00:55:24 | SusWombat | editors* |
00:55:26 | couven92 | demi-, http://editorconfig.org/ sroll to the bottom |
00:55:44 | SusWombat | oh im actually wrong ... |
00:55:52 | SusWombat | there are some that have it natively |
00:55:59 | couven92 | quite a lot of the major editors support it, quite a lot of them actually in box! |
00:56:05 | couven92 | SusWombat, yeah... |
00:56:21 | SusWombat | i wouldnt say "quite a lot" tho |
00:56:39 | couven92 | I find it EXTREMELY useful for languages like Python, where correct indentation actually matters |
00:56:44 | demi- | oh, hmmm; why would you use this for formatting and not a linter? |
00:56:55 | * | libman joined #nim |
00:57:41 | couven92 | demi-, technically, four spaces (my personal default for non-nim devel) is legal in Nim, right? it just mean two indent levels |
00:57:42 | SusWombat | demi-, cause it isnt checking for mistakes you made and it doesnt "reformat" your code. It sets basic settings like indent size and so on |
00:58:44 | demi- | ok i guess i don't understand why the editor wouldn't have basic support for this if it supports a specific language (not saying it is bad/wrong, just that i don't understand it) |
00:59:04 | * | krux02 quit (Remote host closed the connection) |
00:59:23 | SusWombat | demi-, it does and thats the point. The plugin parses the configfile and tells your editor what settings to set. |
00:59:53 | SusWombat | That way i can have different "style" settings on a per project base |
01:00:24 | * | BennyElg joined #nim |
01:00:25 | * | BennyElg_ quit (Ping timeout: 246 seconds) |
01:00:29 | couven92 | SusWombat, and you can define the *correct* style for your team |
01:01:01 | demi- | yeah, which goes back to my point of why isn't that enforced by a linter? like, you should be coding in a way that works best for you then using a linter to apply the formatting that your team desires. |
01:01:13 | couven92 | For C#, we actually have quite a lot of extended properties, that define stuff for the C# linter as well |
01:02:29 | SusWombat | demi-, a linter doeswnt format or atleast not usually |
01:05:04 | SusWombat | Actually im not sure if most editors allow you per language settings. I just kinda assumed that |
01:05:41 | * | Guest81488 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:07:14 | couven92 | and editorconfig doesn't actually change the contents of the file, it configures the editor for the changes you are making... i.e. it's not a formatting rule, it's just common settings in a unified format that is undertood by many different editors |
01:07:40 | * | yglukhov joined #nim |
01:07:52 | SusWombat | yeah kinda what i tried to said but yours might be worded better |
01:07:56 | SusWombat | say* |
01:08:13 | demi- | if it does some stuff for you well then that is neat and i'm glad; tho i cannot say i have ever had that as a problem i needed solving |
01:08:46 | libman | When you say "most editors", you mean weighed by use, right? Because there are thousands of text editors out there, most very simple obscure ones. |
01:09:05 | couven92 | demi-, it's more that I often opened Nim in a editor that didn't support Nim just for small quick edits |
01:09:10 | * | Ven joined #nim |
01:09:23 | libman | But if you do weigh by usage, the vast majority of programmers do use an editor that supports per-language settings - https://insights.stackoverflow.com/survey/2017#technology-most-popular-developer-environments-by-occupation |
01:09:35 | * | Ven is now known as Guest89037 |
01:11:58 | * | yglukhov quit (Ping timeout: 246 seconds) |
01:12:03 | couven92 | libman, Visual Studio actually has Textmate support for syntax highlighting for Nim. But otherwise Visual Studio does not understand anything about Nim. I do a lot of C# and therefore always have VS open. For very small quickfixes I am often too lazy to change over to Code |
01:12:53 | couven92 | which means, all my tabs get mixed up when I do some small fixing in Visual Studio |
01:13:47 | libman | I use vscode but it's a guilty pleasure for me (no BSD support). There are some new vim-like editors I'd consider switching to (ex. kakoune.org), but no Nim support yet. |
01:14:59 | couven92 | libman, point is: editorconfig would help to code in editors that have no Nim support, but you use anyways (because it's what you open at that point) |
01:16:25 | couven92 | Yes, I have VSCode installed, and yes, when I do serious Nim stuff, I use that one (best support for Nim/nimsuggest on Windows), but I wouldn't dream of leaving Visual Studio for C# development, so I'll always also use VS on occasion |
01:17:02 | SusWombat | couven92, id say it has the best support for nim on linux aswell |
01:17:32 | couven92 | SusWombat, I wouldn't know... I don't do Linux! :P :P |
01:17:36 | libman | I was just pedantically nitpicking SusWombat's use of the term "most editors". |
01:17:48 | SusWombat | couven92, yeah i know that "Unix crap" :D |
01:17:58 | * | Guest89037 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:18:38 | couven92 | I guess I should be crucified for actually loving the good ols Windows Command Prompt, and preferring that over bash! ;) |
01:19:21 | libman | No one should be crucified. Windows has some strengths and makes perfect sense for some situations. |
01:19:32 | SusWombat | yeah for gaming :) |
01:19:51 | * | libman hasn't played a game since the 90s. |
01:19:56 | SusWombat | btu besides that? (genuinely intrested) |
01:19:59 | SusWombat | but* |
01:20:01 | SusWombat | oh waitz |
01:20:04 | couven92 | printing! |
01:20:11 | SusWombat | nvm forgot professional art and music stuff |
01:20:43 | libman | Windows is good because that's what got people who are not specialist geeks to use computers. |
01:20:50 | couven92 | I have never managed to get sth printed exeactly as I wanted on a Linux machine, whereas I usually have no problems whatsoever on Windows... :P |
01:21:09 | SusWombat | that "you have to be a geek to use linux" thing is just a meme imo |
01:21:48 | couven92 | But okay... I have to admit, I (almost) never have any problems in Windows, whereas I can never get anything done on Linux... so might be unflexible me :O |
01:21:50 | libman | It is now, but getting Linux working on a desktop / laptop wasn't trivial for the first 20 years of its existence. |
01:22:23 | SusWombat | wasnt a seasy installing windows 20 years ago as it is today aswell |
01:22:27 | SusWombat | as easy* |
01:22:28 | * | BennyElg quit (Ping timeout: 240 seconds) |
01:23:37 | libman | The point is that Microsoft gave businesses and sub-genius PC users what they wanted and they were willing to pay for. So I'm not a Microsoft hater. Plenty of other things to hate. |
01:23:38 | SusWombat | but yeah windows was and maybe is still a little bit asier |
01:23:47 | couven92 | Okay... I actually wanted to set up a server running Windows XP, since dom96 and Araq wanted an XP testing machine for Nim... But installing RAID drivers in BIOS-like Windows XP setup turned out be a real pain in the a**! :( |
01:24:45 | * | BennyElg joined #nim |
01:25:07 | * | libman has a growning collection of qemu images (because Bhyve doesn't support as many platforms and can't do suspend / resume as well). I'll eventually automate Nim binary compilation on them. |
01:27:08 | couven92 | libman, yeah... I am actually a bit shocked to realize that I can recite the commands to build Nim from scratch an both Windows, Linux and Android! :P |
01:28:26 | SusWombat | "yaourt -S nim-git" :) |
01:28:45 | couven92 | and Windows of course using the more complicated variant with the VCC compiler backend. And well Android... that one is really quite tricky, but I have done it so often now... |
01:28:53 | couven92 | SusWombat, no, that's cheating! :P |
01:29:07 | libman | My idea of a perfect Nim install / update process: select some drop-down boxes on the Web-site and run: `curl X | tar xpvf -C /opt/nim` for platform independent stuff and then `curl Y | tar xpvf -C /opt/nim/bin` for platform specific bins. |
01:30:11 | libman | I think you can avoid csources if you can install an older nim pkg / bin for bootstrap. |
01:30:47 | couven92 | libman, yeah... I was actually considering doing that... that's how you can install pip standalone for example... or how you can install dotnet core and so on... I really like the idea of self-bootstrapping installer scripts that are invoked with curl |
01:30:59 | couven92 | (or Invoke-WebRequest on Windows) |
01:32:15 | * | BennyElg_ joined #nim |
01:32:17 | * | BennyElg quit (Ping timeout: 268 seconds) |
01:32:17 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:32:33 | SusWombat | couven92, look what i found lol https://github.com/nim-lang/Nim/pull/4407 |
01:32:53 | couven92 | ooohh... ups... :P |
01:33:37 | couven92 | libman, and BTW: curl is not guaranteed to be installed... I remember that wget is actually more common to be on a fresh vanilla Linux distro? (please prove me wrong) |
01:34:07 | SusWombat | arch for a long time didnt have wget but curl iirc |
01:34:23 | SusWombat | i know for sure it did not ha<ve wget for a while but not sure about curl |
01:35:39 | couven92 | ah, okay... might be I got those reversed then... |
01:35:50 | SusWombat | nah i think you are still right |
01:35:55 | libman | The Web-site would have you select the OS / version / etc (auto-detectable with JS to some degree) and tell you what commands to paste, including using the right bundled download tool for the OS (curl, fetch, ftp, etc). |
01:36:16 | jackv | SusWombat: arch still doesn't have wget in a default install |
01:36:17 | couven92 | SusWombat, regarding the other editorconfig PR: Araq really hates .dotfiles, right? :D |
01:36:26 | SusWombat | jackv, im pretty sure it does |
01:36:39 | SusWombat | couven92, seems so :/ |
01:36:59 | jackv | I just did a fresh install last week and I had to install it manually |
01:37:16 | jackv | I remember because it surprised me |
01:37:16 | * | vlad1777d__ quit (Remote host closed the connection) |
01:37:23 | couven92 | probably because he's on Windows, and therefore has to stare at them in the explorer (them not being auto-hidden as in Linux) |
01:37:44 | SusWombat | I mean my editor doesnt hide them aswell |
01:38:08 | SusWombat | I just like the way it tells me hey im a config file |
01:38:13 | * | chemist69 quit (Ping timeout: 246 seconds) |
01:38:46 | couven92 | yeah me too... First I do at every computer (both Linux and Windows) is to get the file explorer to show all files |
01:38:47 | SusWombat | jackv, werid i did mistake that then. |
01:38:50 | SusWombat | weird* |
01:40:03 | couven92 | and my default command to list files in the shell: `ls -lah` really annoying on Android, as the busybox there does not support all the flags usual `ls` does |
01:40:11 | * | libman hides in shame for mistakenly including -f to tar when piping to it. |
01:40:31 | couven92 | libman, -f-? |
01:40:52 | SusWombat | jackv, may it be that the iso has wget aviable? |
01:41:31 | SusWombat | cause thats the only time i use wget maybe i did mistake it because of that |
01:41:43 | jackv | SusWombat: probably, yeah. The iso has tons of stuff |
01:42:01 | couven92 | libman, how are we on opening files for reading in C? using "r" or "rb"? "w" or "wb"? |
01:42:15 | libman | `curl X | tar x...` shouldn't contain an 'f' tar argument. |
01:43:13 | couven92 | libman, no it shouldn't... but curl X | tar -xf - actually works, as - suggests stdin as the value for -f |
01:43:25 | SusWombat | tar -xvf :D |
01:43:28 | * | BennyElg_ quit (Ping timeout: 240 seconds) |
01:43:33 | * | BennyElg joined #nim |
01:43:51 | SusWombat | Im not even sure anymore what the flags mean (did look it up back then) but it works :) |
01:44:16 | couven92 | x extract, v verbose, f use file as input |
01:44:18 | jackv | https://xkcd.com/1168/ |
01:44:36 | couven92 | also z use gzip compression, J use bzip2 compression |
01:44:51 | couven92 | that's all I know by heart... |
01:45:03 | couven92 | ah, c create, and a for add? |
01:45:48 | libman | I know, I know, my point was about providing Nim binary builds for more platforms. I'm tinkering with some shell scripts and qemu for automating that. |
01:46:04 | jackv | J is actually xz, j is bz2 |
01:46:06 | SusWombat | isnt that what choosenim is for? |
01:46:16 | SusWombat | i actually want to try choosenim sometimes |
01:46:28 | couven92 | jackv, Oh!!! My bad... explains a lot of my recent taring troubles! :O |
01:46:29 | libman | choosenim compiles the sources and only on a few platforms. |
01:47:02 | SusWombat | ah right |
01:48:05 | SusWombat | aweomse site for that kind of stuff btw (linux command flags) https://explainshell.com/ |
01:48:11 | libman | PPM is the best compression for text / code, BTW - http://www.freshports.org/archivers/ppmd/ |
01:48:34 | couven92 | SusWombat, I like the name... it can be slightly ambigouous! :P |
01:50:00 | * | BennyElg_ joined #nim |
01:50:15 | couven92 | btw, my favorite curl flags: `curl -sSL URL` and no, ironically `sSL` has nothing to do with security! :P |
01:50:35 | * | BennyElg quit (Ping timeout: 240 seconds) |
01:50:42 | couven92 | but because of that easy ro remember! :D |
01:52:07 | * | chemist69 joined #nim |
01:56:26 | SusWombat | Does anyone know of a nim library to create texture-atlases or perform bin packing? |
02:02:00 | FromGitter | <zacharycarter> SusWombat yes |
02:02:12 | FromGitter | <zacharycarter> I have written a tool to do such a thing |
02:02:17 | SusWombat | Dam you gitter! |
02:02:18 | FromGitter | <zacharycarter> for frag |
02:02:32 | SusWombat | i actually wanted to ask you first lol :D but thought you arent here |
02:02:39 | FromGitter | <zacharycarter> :P |
02:02:43 | FromGitter | <zacharycarter> one second |
02:03:17 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/master/tools/texture_packer/tinydeflate/tinydeflate.nim |
02:04:06 | FromGitter | <zacharycarter> basically put textures in a folder and change that code |
02:04:11 | FromGitter | <zacharycarter> and it will produce a texture atlas |
02:04:36 | FromGitter | <zacharycarter> I haven't gotten around to writing a GUI for it yet |
02:04:59 | FromGitter | <zacharycarter> @yglukhov are you around by any chance? I have another question about the sound library |
02:05:15 | SusWombat | you have to hardcode the images to load? |
02:05:29 | FromGitter | <zacharycarter> @SusWombat I haven't spent much time on it yet |
02:05:34 | FromGitter | <zacharycarter> it's more just a POC |
02:05:57 | SusWombat | i see |
02:06:14 | FromGitter | <zacharycarter> it will produce an atlas file |
02:06:15 | SusWombat | maybe i spend some time learning about bin packing finally and try to do my own small lib |
02:06:44 | FromGitter | <zacharycarter> well... up to you but this does it for you |
02:06:51 | FromGitter | <zacharycarter> it'd just need a proper interface |
02:07:02 | FromGitter | <zacharycarter> a cli or a gui |
02:08:27 | FromGitter | <zacharycarter> no matter what you have to provide a texture packing application some input - like how to refer to the images inside the atlas file and of course the URIs for the images themselves |
02:08:51 | SusWombat | yeah sure |
02:10:25 | * | bjz joined #nim |
02:10:33 | FromGitter | <zacharycarter> okay so i have three frag examples working on the html5 backend now |
02:10:40 | SusWombat | nice |
02:10:45 | FromGitter | <zacharycarter> thanks |
02:10:59 | FromGitter | <zacharycarter> this is going to make prototyping things much easier |
02:11:05 | * | couven92 quit (Quit: Client Disconnecting) |
02:11:16 | FromGitter | <zacharycarter> also sharing ideas with people |
02:12:07 | SusWombat | does your html backend use webgl or canvas? |
02:12:38 | FromGitter | <zacharycarter> webgl |
02:12:43 | SusWombat | ah cool |
02:35:07 | * | BennyElg joined #nim |
02:35:33 | * | BennyElg_ quit (Ping timeout: 260 seconds) |
02:49:32 | * | BennyElg quit (Read error: Connection reset by peer) |
02:50:01 | * | BennyElg joined #nim |
02:51:45 | * | dddddd quit (Read error: Connection reset by peer) |
03:00:16 | * | BennyElg_ joined #nim |
03:00:43 | * | BennyElg quit (Ping timeout: 260 seconds) |
03:17:07 | * | pilne quit (Quit: Quitting!) |
03:28:40 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:33:24 | * | BennyElg joined #nim |
03:33:28 | * | BennyElg_ quit (Ping timeout: 240 seconds) |
03:40:17 | FromGitter | <Varriount> @zacharycarter is quite the expert in OpenGL |
03:41:31 | FromGitter | <zacharycarter> I don't know if I'd call myself that, but I sure do wish I could get a job doing it :P |
03:42:46 | FromGitter | <Varriount> Meanwhile, I'm trying to wrap AWS C++ SDK with C2Nim |
03:42:51 | FromGitter | <zacharycarter> ooooo |
03:43:00 | FromGitter | <Varriount> And having to wrestle things. |
03:43:10 | FromGitter | <zacharycarter> like what? |
03:43:14 | FromGitter | <Varriount> The SDK is somewhat overengineered |
03:43:19 | FromGitter | <zacharycarter> ah okay |
03:44:35 | FromGitter | <Varriount> They use a custom memory manager though, which means I might be able to get away with using Nim's allocator |
03:44:37 | FromGitter | <Varriount> Maybe |
03:44:42 | FromGitter | <Varriount> :/ |
03:56:47 | * | bjz joined #nim |
04:03:22 | * | BennyElg_ joined #nim |
04:04:13 | * | BennyElg quit (Ping timeout: 260 seconds) |
04:06:05 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
04:07:01 | * | bjz joined #nim |
04:07:23 | * | bjz quit (Client Quit) |
04:08:34 | * | bjz joined #nim |
04:08:40 | * | bjz quit (Client Quit) |
04:21:36 | * | BennyElg joined #nim |
04:21:43 | * | BennyElg_ quit (Ping timeout: 260 seconds) |
04:24:36 | * | BennyElg quit (Remote host closed the connection) |
04:27:25 | * | Trioxin quit (Ping timeout: 268 seconds) |
04:58:20 | SusWombat | how much knowledge does it require to do a wrapper for a c library? |
04:58:24 | SusWombat | i mean on nim and c side? |
05:31:50 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:33:39 | FromGitter | <maiermic> I registered yesterday as user *nimbus* at forum.nim-lang.org ⏎ However, I can not activate my account with the link in the mail. ⏎ I always get: Account activation failed |
05:35:18 | FromGitter | <maiermic> I can login and already wrote a post, but it is not visible to the public. |
05:37:33 | FromGitter | <JHonaker> (https://files.gitter.im/nim-lang/Nim/Yc7x/wireworld-nim.gif) |
05:37:48 | SusWombat | nice :D |
05:37:50 | FromGitter | <JHonaker> Just finished all the basics for a Wireworld cellular automata |
05:38:07 | FromGitter | <JHonaker> That was a lot of fun to build |
05:45:51 | * | libman quit (Quit: Connection closed for inactivity) |
06:15:20 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
06:17:07 | jackv | SusWombat: honestly it doesn't take a whole lot of knowledge of either to do a wrapper |
06:17:30 | jackv | just follow the blog post |
06:19:15 | SusWombat | jackv, which one? |
06:34:46 | * | BennyElg joined #nim |
06:37:43 | FromGitter | <maiermic> can anyone see my post in https://forum.nim-lang.org/t/1951 ⏎ if you go to https://forum.nim-lang.org/ the activity says (even if I'm not logged in): nimbus replied 9 hours ago ⏎ However, I can only see my post, if I'm logged in |
06:38:30 | jackv | SusWombat: http://goran.krampe.se/2014/10/16/nim-wrapping-c/ |
06:38:49 | SusWombat | maiermic same for me |
06:38:53 | SusWombat | jackv, thanks |
06:38:56 | jackv | Disclaimer: I haven't done a wrapper in a couple years now, so YMMV, but I think the process should be the same |
06:40:41 | FromGitter | <maiermic> SusWombat: thanks for checking. By "same for me" do you mean, you can see my post if you are logged in, but not if you are logged out? |
06:43:18 | SusWombat | no i cant see the post at all |
06:43:25 | SusWombat | i just see the activity thing |
06:43:46 | SusWombat | maiermic |
06:47:23 | FromGitter | <maiermic> thanks |
06:47:32 | FromGitter | <maiermic> who is admin of the forum? how can I contact him directly? |
06:47:48 | SusWombat | dom96, or Araq i guess |
06:53:52 | * | BennyElg quit (Remote host closed the connection) |
06:54:11 | * | BennyElg joined #nim |
07:08:29 | FromGitter | <mratsim> Are inline and closure iterator still non-recursive? https://github.com/nim-lang/Nim/issues/555. Zah suggested an iterator to traverse arbitrarily nested openarray of open array, but I’m at a loss on how to do that without recursion: https://github.com/nim-lang/Nim/issues/5708 ⏎ ⏎ For reference this is my current code, but I can’t flatten openarray due to: ⏎ https://github.com/nim-lang/Nim/issues/2652 ⏎ |
07:08:29 | FromGitter | ... ... [https://gitter.im/nim-lang/Nim?at=59213ced05e3326c67f2b895] |
07:23:39 | * | Trioxin joined #nim |
07:32:51 | * | chrisheller quit (Remote host closed the connection) |
07:38:28 | FromGitter | <Varriount> @maiermic Did you just register? If so, your post might need approval first |
07:42:42 | * | Tiberium joined #nim |
07:46:22 | * | BennyElg quit (Remote host closed the connection) |
07:48:52 | * | chrisheller joined #nim |
07:49:06 | * | chrisheller quit (Read error: Connection reset by peer) |
07:49:32 | * | chrisheller joined #nim |
07:54:16 | * | chrisheller quit (Ping timeout: 260 seconds) |
07:57:11 | * | Kingsquee joined #nim |
08:02:46 | m712 | can i "link" with another nim package? how? |
08:03:09 | m712 | i want to have 2 separate folders for 2 separate packages, and i want package 1 to import package 2 |
08:03:38 | m712 | in C, i'd include headers from package 2 and link during compile time, what's the nim equalivent? |
08:04:23 | m712 | and what if I wanted a generic function prototype to link against? |
08:04:32 | m712 | (this is a second question) |
08:04:51 | noethics | https://nim-lang.org/docs/manual.html#modules |
08:07:13 | m712 | thank you |
08:07:14 | FromGitter | <mratsim> You can use import or include (include is basically inserting the source at the call site) |
08:07:17 | m712 | what about the second question? |
08:07:47 | m712 | i want to have an arch_init function which is linked at compile time by the linker based on the architecture the user chose |
08:10:49 | SusWombat | Anyone a idea for a cool project for a nim noob? |
08:17:08 | * | BennyElg joined #nim |
08:20:02 | m712 | how can i create a function prototype without actually writing the function and then linking it at compile time? |
08:20:09 | m712 | link it at* |
08:21:32 | m712 | also how can i import a module from a parent directory? import ../module_something? |
08:21:41 | SusWombat | yes |
08:22:53 | m712 | okay |
08:33:33 | * | Arrrr joined #nim |
08:36:03 | FromGitter | <ephja> m712: is this relevant to you? https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement |
08:39:33 | FromGitter | <ephja> https://nim-lang.org/docs/system.html#hostOS |
08:41:58 | FromGitter | <Varriount> Suswombat: Documentation examples? That would get you familiarized with the standard library |
08:42:28 | FromGitter | <mratsim> @m712 Here is an example of when(windows): elif(macos) https://github.com/unicredit/nimblas/blob/master/nimblas/private/common.nim |
08:42:35 | FromGitter | <Varriount> Or you could try writing a calculator |
08:45:27 | SusWombat | hm |
08:45:29 | FromGitter | <mratsim> if all you want is learning the syntax, Nim is very suitable for project euler (mathematics oriented small contained problem) https://projecteuler.net/. That’s how I started. Otherwise I like the calculator idea from @Varriount, or try porting something useful, it’s easier sometimes to have a reference implementation and you will know “how to do something in Nim”. (If you port something object oriented, Nim is |
08:45:29 | FromGitter | ... really different though) |
08:45:46 | FromGitter | <mratsim> useful for you* |
08:45:46 | SusWombat | Nah i meant more like a complete project |
08:45:58 | SusWombat | but euler is actually a cool idea aswell |
08:46:14 | FromGitter | <mratsim> The thing is, do something you like because it’s a marathon, and you need motivation =) |
08:46:25 | noethics | m712, some of these may interest you https://nim-lang.org/docs/manual.html#implementation-specific-pragmas |
08:46:33 | FromGitter | <ephja> I forgot about the OS defines. I assume they are equivalent, just less verbose |
08:47:45 | FromGitter | <mratsim> For example, I saw someone port a FLAC decoder library in Nim to learn about Nim, another one ported a NES emulator to Nim (https://hookrace.net/nimes/), some ported OpenGL tools |
08:49:26 | FromGitter | <mratsim> Personally I am writing a multidimensional array library and a deep learning framework from scratch in Nim to learn about it. I will probably also do a Go playing bot because that’s what I’m interested in |
08:50:01 | m712 | noethics: i can't see anything that helps me unfortunately |
08:50:38 | m712 | also, how can i do unions in nim? |
08:50:41 | noethics | m712, so you want to have headers for an object file? |
08:52:12 | FromGitter | <mratsim> m712, Union like unions types? |
08:52:27 | m712 | FromGitter: an union of two structs |
08:52:27 | FromGitter | m712, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
08:52:44 | m712 | i'm trying to convert https://gitlab.com/sortix/sortix/blob/master/kernel/multiboot.h#L160-164 to nim |
08:53:57 | FromGitter | <mratsim> you can use c2nim to convert c source code in Nim, did you try it? |
08:54:01 | m712 | no |
08:55:06 | FromGitter | <mratsim> Otherwise you can use an object (which is the approach of c2nim according to doc) |
08:55:59 | FromGitter | <mratsim> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
09:04:05 | Tiberium | ok, will try now to compile Nim on Fuchsia OS itself :) (building gcc for fuchsia, at least there's docs on how to do this) |
09:04:55 | m712 | what's the equalivent of __attribute__((packed)) in Nim |
09:04:57 | m712 | ? |
09:11:28 | FromGitter | <ephja> m712: this I think https://nim-lang.org/docs/manual.html#foreign-function-interface-packed-pragma |
09:12:57 | m712 | thanks |
09:13:02 | m712 | can i apply that to tuples? |
09:18:26 | * | couven92 joined #nim |
09:20:06 | FromGitter | <ephja> m712: it appears to compile but it doesn't do anything. I would not use a tuple for such purposes in any case |
09:21:24 | m712 | but isn't tuple the equalivent of structs in C? did I get that wrong? |
09:21:33 | m712 | should i use objects instead? |
09:21:41 | m712 | i need to be able to use them with 0 GC |
09:23:46 | * | bjz joined #nim |
09:23:51 | * | yglukhov joined #nim |
09:23:53 | FromGitter | <ephja> what you could do is create a converter that implicitly turns a tuple of a certain signature into an instance of the object type in question, but converters should be used sparingly |
09:24:05 | FromGitter | <ephja> tuples are, and so are plain objects |
09:25:58 | FromGitter | <ephja> tuple construction is more concise, but tuples can't be packed, have unexported (private) fields etc |
09:28:13 | * | yglukhov quit (Ping timeout: 258 seconds) |
09:35:15 | FromGitter | <ephja> if T is an object type (type T = object) then var t: T implies stack allocation, "var t: ptr T" implies an untraced reference (* in C) and "var t: ref T" implies a traced reference (points to an object of a garbage collected heap). the same applies to tuples as well |
09:36:02 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:38:29 | FromGitter | <ephja> btw, is the 'pure' pragma not necessary when interfacing with C anymore? it's only applied to a few object types in sdl2.nim for example |
09:38:55 | * | bjz joined #nim |
09:39:42 | * | planhths joined #nim |
09:42:05 | FromGitter | <Varriount> @ephja I don't think so |
09:43:42 | FromGitter | <Varriount> m712: Object types are always located on the stack (except when they are a member of a reference type) |
09:46:29 | * | vlad1777d joined #nim |
09:50:09 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:51:02 | * | chrisheller joined #nim |
09:53:36 | * | nsf joined #nim |
09:56:32 | * | chrisheller quit (Ping timeout: 260 seconds) |
10:02:29 | * | yglukhov joined #nim |
10:05:51 | m712 | thanks for all the replies |
10:08:17 | * | yglukhov quit (Read error: Connection reset by peer) |
10:08:49 | * | yglukhov joined #nim |
10:16:26 | * | bjz joined #nim |
10:20:37 | * | bjz quit (Client Quit) |
10:21:25 | * | yglukhov quit (Remote host closed the connection) |
10:26:07 | * | Ven joined #nim |
10:26:31 | * | Ven is now known as Guest38231 |
10:28:40 | * | bjz joined #nim |
10:43:52 | * | yglukhov joined #nim |
10:46:14 | * | yglukhov quit (Remote host closed the connection) |
10:46:55 | * | Guest38231 quit (Ping timeout: 260 seconds) |
10:48:19 | * | Ven_ joined #nim |
10:48:52 | * | Ven_ quit (Client Quit) |
10:53:01 | * | chrisheller joined #nim |
10:57:40 | * | chrisheller quit (Ping timeout: 260 seconds) |
10:58:08 | FromGitter | <Varriount> @mratsim I'm currently looking over your arraymancer code. I love the amount of comments you've written |
10:58:16 | couven92 | most efficient way to clean your repo from intermediate files: `git clean -fdx` that one is especially nice when you haven't added your new files to the index yet... Boom! A whole days worth work gone with the wind! Yaih! :/ |
10:58:26 | FromGitter | <mratsim> @Varriount =) |
10:58:57 | FromGitter | <mratsim> Be sure to check the Slice and Dice branch with the slicing and slicing mutations |
11:01:17 | * | yglukhov joined #nim |
11:03:20 | * | Snircle joined #nim |
11:03:47 | FromGitter | <mratsim> The Design doc is outdated too, I do not use pointers anymore |
11:11:54 | Tiberium | couven92, you can restore that |
11:12:03 | Tiberium | google "linux ext4 restore files" |
11:12:21 | Tiberium | I did that successfully, but you need to reboot ASAP and boot from livecd |
11:14:17 | * | Vladar joined #nim |
11:15:24 | FromGitter | <Varriount> I will always wonder why Linux never adopted trash/recycle bin concept |
11:15:35 | FromGitter | <Varriount> Windows and Mac both have |
11:15:38 | Tiberium | it is there |
11:16:08 | Tiberium | but not by default :) |
11:16:19 | Tiberium | and shift+delete and trash will not help you even on windows |
11:16:30 | FromGitter | <Varriount> Can rm use it? |
11:17:22 | Tiberium | you can use "rmtrash" command as an alias to "rm" |
11:17:29 | Tiberium | but setting this system-wide is bad I think |
11:17:45 | Tiberium | but anyway, this git behaviour is weird |
11:18:37 | * | yglukhov quit (Remote host closed the connection) |
11:18:44 | couven92 | Tiberium, on Windows... and well... my own fault... I have to get used to adding files to the index if I need them :P |
11:19:29 | * | yglukhov joined #nim |
11:19:54 | Tiberium | couven92, why not restore files then? |
11:20:06 | Tiberium | if it's a second HDD or SSD, you can unmount it without rebooting |
11:20:29 | couven92 | Tiberium, not that important in this case... was just a fun project.... :P |
11:21:18 | FromGitter | <Varriount> Recuva |
11:21:56 | Tiberium | couven92, btw, many IDE's help with that git stuff :) |
11:22:18 | couven92 | Tiberium, yeah... that's why I usually do that in the IDE! :D |
11:22:19 | Tiberium | (adding files to index automatically, easier to solve merges etc) |
11:22:26 | Tiberium | couven92, what IDE do you use for Nim? |
11:23:52 | * | yglukhov quit (Remote host closed the connection) |
11:24:04 | * | yglukhov joined #nim |
11:24:43 | couven92 | Tiberium, usually VS Code... But I use the three-way merger in Visual Studio to resolve conflicts (mainly out of lazyness, since I always have VS open anyways) |
11:25:06 | Tiberium | couven92, what is it's name? and do you use any additional plugins in vscode for nim or git? |
11:26:02 | couven92 | I use the Nim plugin in VS Code and nothing else |
11:29:00 | couven92 | and the merging in Visual Studio is built-in in Vanilla VS... and with VS 2017 FINALLY being able to open a folder (with having to create solution and project files) really helps |
11:30:39 | * | yglukhov quit (Remote host closed the connection) |
11:35:56 | * | gmpreussner_ quit (Read error: Connection reset by peer) |
11:39:03 | * | gmpreussner joined #nim |
11:42:03 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
11:43:52 | * | abruanese quit (Read error: Connection reset by peer) |
11:44:37 | * | dddddd joined #nim |
11:53:49 | * | chrisheller joined #nim |
11:58:20 | * | chrisheller quit (Ping timeout: 260 seconds) |
12:01:01 | * | yglukhov joined #nim |
12:07:08 | Trioxin | the 4th example here won't compile: https://nim-lang.org/docs/httpclient.html |
12:07:35 | Trioxin | (8, 12) Error: type mismatch: got (Response) |
12:13:32 | * | yglukhov quit (Read error: Connection reset by peer) |
12:14:06 | * | yglukhov joined #nim |
12:15:39 | Tiberium | ah, because there's no $ for Response |
12:15:43 | Tiberium | strange |
12:16:01 | Tiberium | Trioxin, you can report that on github issues |
12:17:16 | FromGitter | <AjBreidenbach> hey, can anyone tell me if there's a way to get the value of an enumerated type, or if their values are purely for ordering? |
12:17:16 | Trioxin | k |
12:17:42 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:18:41 | * | bjz joined #nim |
12:19:28 | Tiberium | AjBreidenbach: you can cast it to int |
12:19:50 | Tiberium | AjBreidenbach: cast[int](valueofenumtype) |
12:20:03 | FromGitter | <AjBreidenbach> @Tiberium ok great thanks :) |
12:28:31 | FromGitter | <zacharycarter> @SusWombat I can help guide you with wrapping C libraries if you'd like |
12:28:43 | FromGitter | <zacharycarter> I also have an article I started which walks you through wrapping one on a linux machine |
12:28:46 | FromGitter | <zacharycarter> sorry a mac |
12:29:00 | SusWombat | ok |
12:29:20 | SusWombat | but im not sure yet |
12:29:23 | SusWombat | thanks tho! |
12:29:43 | * | adeohluwa joined #nim |
12:29:50 | FromGitter | <zacharycarter> np! just lmk |
12:29:52 | FromGitter | <zacharycarter> it's not difficult |
12:30:01 | Trioxin | Tiberium, how can I get the post to work in that case? |
12:31:27 | * | bjz_ joined #nim |
12:33:25 | * | bjz quit (Ping timeout: 246 seconds) |
12:34:23 | Tiberium | Trioxin, do you need to pass headers? |
12:34:43 | Tiberium | Trioxin, if not, use postContent - https://nim-lang.org/docs/httpclient.html#postContent,HttpClient,string,string,MultipartData |
12:34:54 | Tiberium | and even with 4'th example |
12:35:07 | Tiberium | you just need to assing response to a variable instead of outputting it |
12:35:08 | Tiberium | like |
12:35:30 | Tiberium | let resp = client.request(...) |
12:35:34 | Tiberium | echo resp.body |
12:35:45 | Tiberium | this is response type - https://nim-lang.org/docs/httpclient.html#Responsehttps://nim-lang.org/docs/httpclient.html#Response |
12:35:48 | Tiberium | https://nim-lang.org/docs/httpclient.html#Response |
12:36:02 | Trioxin | k |
12:36:34 | Tiberium | everything is in the docs :) |
12:38:41 | * | dddddd_ joined #nim |
12:38:45 | * | dddddd quit (Read error: Connection reset by peer) |
12:39:47 | * | dddddd_ is now known as dddddd |
12:43:25 | * | planhths quit (Quit: Konversation terminated!) |
13:02:36 | * | yglukhov quit (Remote host closed the connection) |
13:11:26 | * | yglukhov joined #nim |
13:17:05 | * | bjz_ quit (Ping timeout: 240 seconds) |
13:17:18 | * | bjz joined #nim |
13:20:22 | * | sz0 joined #nim |
13:26:52 | * | Trioxin quit (Ping timeout: 272 seconds) |
13:47:16 | * | skrylar joined #nim |
13:53:59 | skrylar | you know what nim needs |
13:54:02 | skrylar | an implementation of 9p |
13:55:01 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:55:23 | * | chrisheller joined #nim |
13:56:42 | Tiberium | skrylar, 9p? |
13:58:34 | * | libman joined #nim |
13:59:59 | skrylar | Tiberium, eeh. just me being weird. |
14:00:05 | skrylar | plan9 had some cool stuff in it |
14:00:08 | * | chrisheller quit (Ping timeout: 260 seconds) |
14:00:29 | skrylar | one of them was that they decided to just do things through a filesystem (like unix) but they realized this was better when you just made a generic filesystem interface |
14:01:05 | skrylar | so they did. |
14:01:09 | * | bjz joined #nim |
14:01:14 | Tiberium | skrylar, do you mean use nim in 9p or implement 9p in nim? |
14:01:28 | skrylar | i was looking at how hard it would be to made a 9p module in nim for fun |
14:01:35 | skrylar | well i mean. it's a good debugging tool too. |
14:01:48 | * | couven92 quit (Ping timeout: 240 seconds) |
14:02:08 | Tiberium | skrylar, at least you certainly can do that, but I don't know how :) but look, you can even write Nim for arduino board (but with no GC for small ones) |
14:02:11 | skrylar | also 9p and plumber is way nicer than D-Bus. but alas |
14:02:13 | Tiberium | *boards |
14:04:05 | skrylar | Tiberium, it's not hard really. just like, a REALLY basic tcp protocol |
14:04:56 | skrylar | kinda like gopher really. heh |
14:05:23 | * | pilne joined #nim |
14:08:37 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:14:58 | FromGitter | <maiermic> @Varriount yes, I did just register. I'm not sure if activation was successful though. I always got "Account activation failed" when I opened the link of the email. Maybe it was successful anyway and you are tight that my post only needs approval. |
14:26:50 | * | dddddd quit (Ping timeout: 255 seconds) |
14:28:18 | * | skrylar 's jimmies are rustled by the lack of a checked union |
14:31:16 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:33:52 | * | xikuukawaii joined #nim |
14:34:31 | * | BennyElg quit (Remote host closed the connection) |
14:36:27 | * | yglukhov quit (Remote host closed the connection) |
14:37:00 | * | yglukhov joined #nim |
14:39:53 | * | dddddd joined #nim |
14:41:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
14:43:40 | * | yglukhov joined #nim |
14:51:09 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
14:55:16 | xikuukawaii | How do I generate random ints? |
14:56:07 | Tiberium | xikuukawaii, use "random" module? |
14:56:09 | Tiberium | :) |
14:56:19 | Tiberium | xikuukawaii, import random; echo random(1337) |
14:56:29 | xikuukawaii | Tiberium: Thanks mate! |
14:58:11 | xikuukawaii | Tiberium: That number will never change though correct? So from the time I compile the code to everytime after when I run it, it will be the same number? |
14:59:31 | skrylar | you have to seed random number generators if you want different outputs |
14:59:57 | xikuukawaii | skrylar: What is seeding? |
15:00:00 | Tiberium | xikuukawaii, easiest one - use "randomize()" |
15:00:06 | Tiberium | before using random functions |
15:00:14 | * | nsf quit (Quit: WeeChat 1.7.1) |
15:00:20 | Tiberium | just "randomize()" at the start of your program (or after last import) |
15:01:28 | xikuukawaii | Tiberium: THANK YOU! ^_^ |
15:02:30 | skrylar | seeding is the technical term for starting a random number generator with some inital 'thing' that it uses to make the numbers from |
15:02:40 | skrylar | if you give them the same seed you always get the same order of numbers |
15:02:49 | skrylar | this is useful for scientific sims and not as helpful for games |
15:03:10 | xikuukawaii | Ohhhh |
15:03:34 | skrylar | games typically just take the current system time as their seed |
15:04:04 | skrylar | security stuff will ask the OS for some entropy and use that (/dev/u?random) |
15:04:21 | xikuukawaii | skrylar: I see... |
15:07:32 | * | yglukhov quit (Remote host closed the connection) |
15:08:33 | * | xikuukawaii quit (Quit: WeeChat 1.7.1) |
15:10:50 | * | yglukhov joined #nim |
15:18:14 | * | yglukhov quit (Remote host closed the connection) |
15:31:21 | FromGitter | <Varriount> skrylar: Checked union? |
15:32:57 | skrylar | @varriount its an old pascal thing. you declare a union type from an enum and it has a field that says what set of fields are in the union. then you can do a switch on that, and the compiler knows which fields you meant. |
15:33:31 | FromGitter | <Varriount> skrylar: You mean Nim's object variants? |
15:33:37 | skrylar | it has those now? |
15:33:46 | FromGitter | <Varriount> It's had them since I can remember |
15:33:59 | FromGitter | <Varriount> https://nim-lang.org/docs/manual.html#types-object-variants |
15:34:03 | skrylar | that would probably work then |
15:36:01 | * | nsf joined #nim |
15:50:48 | * | dddddd quit (Ping timeout: 240 seconds) |
15:57:01 | * | chrisheller joined #nim |
15:59:32 | * | Ven joined #nim |
15:59:55 | * | Ven is now known as Guest30747 |
16:01:28 | * | chrisheller quit (Ping timeout: 260 seconds) |
16:01:48 | * | nsf quit (Quit: WeeChat 1.7.1) |
16:01:59 | libman | Random thought: could there be a "Simple Nim" - a dumbed-down simplified subset kinda like https://en.wikipedia.org/wiki/Basic_English ? |
16:02:55 | FromGitter | <zacharycarter> http://imgur.com/a/3io4i |
16:02:59 | FromGitter | <zacharycarter> playing around with spine and frag |
16:03:05 | FromGitter | <zacharycarter> and chipmunk |
16:03:15 | FromGitter | <zacharycarter> not sure what the weird bouncing around is due to, something with physics obviously |
16:03:39 | * | dddddd joined #nim |
16:03:56 | Tiberium | libman, just don't use complicated features - and you have simple nim |
16:04:10 | Tiberium | libman, basic english does the same thing - it uses only simple common words |
16:04:22 | Tiberium | ah no |
16:04:25 | libman | Yup, that's the idea, but it would be beneficial to have some collaborative effort on where the line is, and perhaps even different modes. |
16:04:40 | Tiberium | libman, but really I don't see why is that useful |
16:04:47 | Tiberium | there's no simple C++ |
16:04:49 | Tiberium | or cimple C |
16:04:51 | Tiberium | *simple |
16:04:54 | Tiberium | or simple java |
16:05:29 | libman | Seems like, coming from Python and with a basic understanding of types, you can do a lot with just 20% of Nim. The other 80% of the complexity may be familiar for people coming from C++ / Java / Ada / ML / etc, but scare away the n00bs (like me, sorta - I'm a regressed burnout). |
16:05:31 | FromGitter | <zacharycarter> just cut out metaprogramming / manual memory allocation and I think you have simple nim |
16:05:51 | FromGitter | <zacharycarter> also any kind of concurrency / multithreading / async |
16:06:09 | FromGitter | <zacharycarter> but really these are advanced programming concepts anyway not language specific |
16:06:10 | Tiberium | libman, I came from Python, but I was amazed by meta-programming and learned a bit of it :) |
16:06:15 | Tiberium | macros are very cool |
16:06:18 | Tiberium | and templates too |
16:06:20 | FromGitter | <zacharycarter> I agree with Tiberium I don't see much of a benefit to formalizing this stuff |
16:06:47 | libman | Some async isn't that difficult. I'd even cut less than Go did: it gets very ugly without exception handling and operator overloading (which Python has). |
16:06:57 | Tiberium | yeah, async too |
16:07:09 | Tiberium | async in nim almost is the same as in python too :) |
16:07:10 | FromGitter | <zacharycarter> In general people just know if something is too advanced for them after reading it, I guess it couldn't hurt to slap a label on features and say ADVANCED or BEGINNER or something but it's just extra work and how much benefit |
16:07:25 | Tiberium | await is the same, but instead of "async def" I just use {.async.} pragma |
16:07:31 | libman | The benefit is: here's two days worth of learning after which you can go create useful programs with Nim. |
16:08:01 | FromGitter | <zacharycarter> I think that's what something like Nim in Action is supposed to be |
16:08:41 | * | libman is just pondering how to make Nim more popular. I'm also trying to figure out my own programming impotence as of late - maybe I'm a Python-level programmer scared off by the C++ stuff that I can live without for now. |
16:08:50 | FromGitter | <mratsim> This works: ⏎ ⏎ ```static.nim(1, 53) Error: type expected``` [https://gitter.im/nim-lang/Nim?at=5921bb92fa63ba2f766563bf] |
16:08:58 | FromGitter | <Varriount> libman: Get Nim sponsored by a major company. |
16:09:05 | * | dddddd quit (Remote host closed the connection) |
16:09:12 | FromGitter | <zacharycarter> @Varriount that AWS sdk will go a long way :P |
16:09:57 | FromGitter | <Varriount> Actually, I'm working on translating http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html |
16:10:13 | FromGitter | <zacharycarter> :D |
16:10:21 | FromGitter | <Varriount> And it's going very well! There's hmac and sha256 libs on Nimble, so no implementing of those. |
16:11:01 | FromGitter | <Varriount> Nim has httpclient, and while it's not as automatic as Python's requests library, it looks like it will get the job done. |
16:11:50 | FromGitter | <Varriount> @zacharycarter I figure I'll start small, and hopefully something will form (like an oyster forming a pearl) |
16:11:55 | libman | The sponsorship idea is worthwhile but not mutually exclusive with the "Simple Nim" idea. (Wanna avoid the term "Basic Nim" because someone might think it's BASIC.) |
16:12:17 | FromGitter | <Varriount> libman: Documentation improvements would also help. |
16:12:44 | FromGitter | <Varriount> Technically the standard library is documented, but sites like MDN and Python.org blow us out of the water |
16:13:13 | FromGitter | <Varriount> I'd be willing to be many people are turned off by the rather terse documentation |
16:13:43 | libman | Just brainstorming ideas for boosting popularity. Some are obvious: moar docs, moar libs, moar speeed, etc. But some ideas are less obvious, and some would bring greater return (more users and contributors) on investment (dev time now). |
16:14:15 | * | Sembei quit (Read error: No route to host) |
16:14:18 | libman | Regarding documentation: one thing that PHP did right was have like a forum thread for each function, where people provided examples and answers. |
16:15:44 | * | Sembei joined #nim |
16:17:26 | enthus1ast | nim needs ipython |
16:20:15 | skrylar | like a similar notebook interface or literally ipython |
16:22:19 | enthus1ast | you think of a jupyter kernel right? |
16:23:03 | FromGitter | <JHonaker> Nim needs an interpreter is what it needs |
16:23:10 | FromGitter | <JHonaker> REPLs are so hard to leave now |
16:23:36 | skrylar | i remember when they were doing something about nimscript asking about it |
16:23:42 | skrylar | but at the time it was just for compile time expressions |
16:24:07 | Tiberium | it's another thing |
16:24:13 | Tiberium | and REPL is hard to do since nim is compiled |
16:24:24 | FromGitter | <JHonaker> I mean, we already have the parser and suuuper easy access to the AST |
16:24:41 | enthus1ast | hey im'm just storming |
16:24:46 | Tiberium | this doesn't mean that repl is easy :( |
16:25:00 | skrylar | idunno. |
16:25:12 | FromGitter | <JHonaker> Yes I know :/ Maybe when Crafting Interpreters gets finished, I'll give it a shot |
16:25:17 | FromGitter | <JHonaker> Or even just the first hald |
16:25:28 | skrylar | the C++ nerds are just going to say "Oh yeah we have that, you just need C++0xBEEF!" |
16:26:07 | FromGitter | <JHonaker> I've already completed it up to where it is now. But that's only to parsing/lexing, and evaluation of arithmetic expressions (no symbol lookups or class defs yet) |
16:26:34 | skrylar | if you want to be really very silly, you can use the javascript backend on top of duktape |
16:26:35 | Tiberium | class defs? |
16:26:44 | Tiberium | there are no classes in nim :) |
16:26:59 | Tiberium | ah I mean there's |
16:27:01 | FromGitter | <JHonaker> yea I know I meant in the language that you implement in CI book |
16:27:08 | Tiberium | ah |
16:27:20 | Tiberium | anyway, I think this approach is very hard |
16:27:28 | Tiberium | there's already a half-working repl btw |
16:27:28 | libman | What advantages does a REPL have over IDE integration with "execute current line" / "execute highlighted code" / "execute file" functionality? |
16:27:34 | Tiberium | "nim repl" |
16:27:44 | Tiberium | libman, quickly open it in console and test something |
16:27:52 | libman | `nim secret` |
16:27:56 | Tiberium | ah yes |
16:28:05 | Tiberium | libman, and there's no "execute current line" or "execute highlighted code" for nim :( |
16:28:07 | Tiberium | in vscode |
16:28:14 | skrylar | livecoding, they help in debugging too |
16:28:28 | Tiberium | skrylar, then you can't do it with repl |
16:28:30 | FromGitter | <JHonaker> libman: you just described a REPL |
16:28:32 | libman | Should be simple to create just by dumping selection to temp file. |
16:28:37 | niv | is it possible to chain "do" statements to give multiple procs as arguments? |
16:28:49 | FromGitter | <JHonaker> if you save state between the executions |
16:30:01 | FromGitter | <JHonaker> niv: why not just write funcname(proc (args): rettype, proc (args2): rettype2, etc)? |
16:30:27 | niv | i know i can do that. im asking just out of stylistic curiosity. |
16:30:28 | Tiberium | because you can :) |
16:31:14 | FromGitter | <JHonaker> you could also use the {.procvar.} pragma on procs defined in the code |
16:32:03 | FromGitter | <JHonaker> and just do func(definedproc, definedproc2) or variable.func(defproc1, defproc2) |
16:32:44 | niv | yep, that's possible too i suppose. it was just a question about the parser to see if it's supported |
16:32:48 | FromGitter | <JHonaker> which if you have functions taking multiple functions as parameters, I would have to say would be way easier to read than trying to inline multiple definitions |
16:32:57 | * | Guest30747 quit (Ping timeout: 240 seconds) |
16:33:20 | FromGitter | <JHonaker> To answer that question, I don't know. :D Try it |
16:33:23 | FromGitter | <JHonaker> I doubt it |
16:39:44 | * | arnetheduck_ quit (Ping timeout: 260 seconds) |
16:43:19 | * | Sentreen quit (Ping timeout: 246 seconds) |
16:47:05 | * | Ven joined #nim |
16:47:29 | * | Ven is now known as Guest69624 |
16:50:26 | * | chrisheller joined #nim |
16:56:10 | * | Sembei quit (Quit: WeeChat 1.6-dev) |
16:56:23 | * | Sentreen joined #nim |
16:59:41 | * | EastByte quit (Ping timeout: 272 seconds) |
17:02:32 | * | yglukhov joined #nim |
17:03:04 | * | Guest69624 quit (Ping timeout: 255 seconds) |
17:07:04 | * | Ven_ joined #nim |
17:09:50 | * | yglukhov quit (Remote host closed the connection) |
17:10:30 | * | EastByte joined #nim |
17:10:32 | * | yglukhov joined #nim |
17:19:35 | * | Ven_ quit (Ping timeout: 240 seconds) |
17:24:22 | * | Ven_ joined #nim |
17:25:11 | * | vlad1777d quit (Quit: Leaving) |
17:34:08 | * | Ven_ quit (Ping timeout: 240 seconds) |
17:37:26 | * | Ven_ joined #nim |
17:41:05 | * | couven92 joined #nim |
17:42:44 | * | Ven_ quit (Ping timeout: 272 seconds) |
17:50:32 | * | yglukhov quit (Remote host closed the connection) |
17:57:45 | * | vlad1777d joined #nim |
17:58:53 | * | noethics quit (Remote host closed the connection) |
17:59:35 | * | Sentreen quit (Ping timeout: 240 seconds) |
18:06:12 | * | yglukhov joined #nim |
18:10:14 | * | Matthias247 joined #nim |
18:12:31 | * | Sentreen joined #nim |
18:21:00 | * | noethics joined #nim |
18:23:11 | dom96 | hey guys |
18:25:03 | * | yglukhov quit (Remote host closed the connection) |
18:26:11 | * | yglukhov joined #nim |
18:29:39 | Tiberium | dom96, hi! |
18:30:03 | Tiberium | dom96, there are new nim users with after new nim release :) |
18:30:12 | Tiberium | maybe you should do releases every month? :D |
18:30:45 | skrylar | you know you are in trouble when you're using m4 to generate c code x.x |
18:31:27 | dom96 | Would love to, but we don't really have enough time to do that. |
18:31:55 | Tiberium | wow, nice thing from reddit - https://mixnose.com/nimhub/ |
18:35:58 | * | yglukhov quit (Remote host closed the connection) |
18:37:09 | * | Tiberium quit (Remote host closed the connection) |
18:40:16 | * | Sentreen quit (Ping timeout: 268 seconds) |
18:43:59 | * | yglukhov joined #nim |
18:51:22 | * | yglukhov quit (Remote host closed the connection) |
18:53:25 | * | Sentreen joined #nim |
19:19:35 | * | Sentreen quit (Ping timeout: 240 seconds) |
19:25:25 | * | enthus1ast quit (Remote host closed the connection) |
19:25:56 | * | Arrrr quit (Read error: Connection reset by peer) |
19:26:08 | FromGitter | <GULPF> what's the intended difference between methods named `newXXX` and `initXXX`in the standard library? it looks inconsistent |
19:27:49 | * | adeohluwa joined #nim |
19:30:45 | subsetpark | one is values, the other is references to values |
19:31:38 | subsetpark | eg newTable makes a ref table, inittable makes a normal table |
19:32:17 | subsetpark | unfortunately i think newSeq is a violation of this principle |
19:32:25 | * | Sentreen joined #nim |
19:32:38 | * | nsf joined #nim |
19:34:04 | FromGitter | <GULPF> there's more violations, which makes it confusing. e.g the lists module uses both newXXX and initXXX, both returning refs |
19:35:00 | FromGitter | <GULPF> in system there's also newString, returning non-ref |
19:37:02 | FromGitter | <GULPF> and it gets worse because there doesn't seem to be a consensus on how to name ref types. e.g in the tables module the format `Type` and `TypeRef` is used, but in the lists module `Type` and `TypeObj`is used |
19:37:52 | FromGitter | <ephja> it's part of a convention that states that the primary type should not have a suffix |
19:40:56 | FromGitter | <GULPF> hmm, I guess that makes sense. It mostly becomes a problem for modules like tables, where both ref and non-ref is useful |
19:45:07 | FromGitter | <stisa> there's this https://nim-lang.org/docs/nep1.html that has some guidelines, also I think strings and seqs are ref types, so `newT` is correct |
19:48:09 | FromGitter | <GULPF> they are? but they copy-on-assign? maybe I don't understand the difference between ref/non-ref |
19:48:17 | * | coopernurse joined #nim |
19:50:49 | FromGitter | <GULPF> thanks for the link :) the difference between init/new should be added to that as well |
19:50:58 | * | Sentreen quit (Ping timeout: 260 seconds) |
19:50:59 | FromGitter | <stisa> they are ref types with value semantics, if I remember correctly. Ref types are the ones managed by the gc |
19:56:50 | FromGitter | <GULPF> I feel like even if strings/seqs are refs, but it isn't visible to the user (because they have value semantics), then the method names becomes confusing anyway :/ I'll probably get used to it though |
20:00:59 | gokr | dom96: Something weird happened with this thread: https://forum.nim-lang.org/t/2959/2 |
20:01:24 | gokr | I can't seem to click to the third page in the thread, I don't think there is a 3rd page either. |
20:02:28 | * | Sentreen joined #nim |
20:02:40 | * | enthus1ast joined #nim |
20:08:28 | * | PMunch joined #nim |
20:10:35 | * | abruanese joined #nim |
20:10:55 | PMunch | https://www.reddit.com/r/nim/comments/6bsmdo/version_0170_released/ |
20:11:11 | PMunch | Any comments to bruce? |
20:12:08 | PMunch | I'm guessing "Not sure but we're getting there?" |
20:13:02 | * | Trioxin joined #nim |
20:23:49 | * | Sentreen quit (Ping timeout: 246 seconds) |
20:24:01 | * | noethics quit (Remote host closed the connection) |
20:25:11 | FromGitter | <Varriount> @gokr If I had to guess, I'd say that someone made a post that made it onto the third page, but deleted it. |
20:26:05 | gokr | Mmm, I made my post but... right when I hit publish, I got the 403 page or whatever it was. So I thought I had failed posting, but I hadn't. |
20:29:27 | * | noethics joined #nim |
20:35:21 | * | BennyElg joined #nim |
20:36:47 | * | Sentreen joined #nim |
20:46:12 | * | nightmared quit (Ping timeout: 245 seconds) |
20:47:51 | PMunch | Hmm, on the nim-lang install page it says "sh build.sh" on a normal Linux install it would be "sh ./build.sh" |
20:49:49 | * | nightmared joined #nim |
20:50:31 | dom96 | PMunch: pretty sure both will work |
20:50:41 | PMunch | Nope |
20:50:43 | dom96 | gokr: one of the users was moderated, should be fixed now. |
20:50:47 | PMunch | Not on a regular setup |
20:50:58 | dom96 | what's a regular setup? |
20:51:15 | PMunch | You could customise it to add . to your path but without it (like most, if not all Linux distros) it won't work |
20:54:32 | dom96 | I'm pretty sure that `sh` will expand filenames automatically. |
20:55:02 | PMunch | Huh, apparently it does |
20:55:05 | PMunch | That's weird |
20:58:49 | couven92 | PMunch, not really that weird is it? `sh filename` tells the OS to run sh (wherever in the PATH that might be) and pass filename as an argument to it... it's the up to `sh` to figure out what to do with filename |
20:59:32 | couven92 | that's the same reason why running `sh filename` even works when filename is not marked as executable (I think) |
20:59:48 | PMunch | Yeah I get that. |
20:59:55 | couven92 | sh and the OS ELF are not the same thing |
21:00:08 | couven92 | s/ELF/ELF loader |
21:02:38 | * | bjz joined #nim |
21:07:59 | PMunch | Hmm, when using the mysql module. What's the best way to keep the connection open? |
21:11:03 | * | Trustable joined #nim |
21:12:02 | demi- | PMunch: it should work, i guess it depends on what your `sh` is and how it resolves file paths |
21:12:14 | PMunch | Yeah, I realised I was wrong :P |
21:13:48 | * | Vladar quit (Quit: Leaving) |
21:15:40 | * | Sentreen quit (Ping timeout: 268 seconds) |
21:16:11 | demi- | what you said wasn't wrong |
21:16:40 | demi- | it just depends on what `sh` is, sometimes it is bash, sometimes it is dash |
21:19:14 | PMunch | Fair point |
21:19:20 | PMunch | But I did say for most Linux distros |
21:19:25 | PMunch | Which is probably false |
21:28:43 | * | Sentreen joined #nim |
21:33:28 | FromGitter | <zacharycarter> fixed all the flying around randomly issues : http://imgur.com/a/cPh6E |
21:50:53 | * | Neomex joined #nim |
21:51:11 | Neomex | did anyone use nim for game engine dev? |
21:51:12 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:51:58 | * | Neomex quit (Quit: Leaving) |
21:52:38 | * | Neomex joined #nim |
21:53:07 | PMunch | Yes |
21:53:14 | PMunch | Neomex, have you seen frag? |
21:53:22 | Neomex | nop, link pls? |
21:53:31 | PMunch | It's on the nim-lang front page :P |
21:53:44 | Neomex | right... riiiight, one sec then :) |
21:54:02 | PMunch | http://fragworks.io/ |
21:54:39 | PMunch | There's also Unreal Engine 4 integration for Nim |
21:54:43 | PMunch | https://github.com/pragmagic/nimue4 |
21:55:27 | PMunch | I've also created a game library: https://github.com/PMunch/SDLGamelib |
21:56:01 | PMunch | It's not meant to be a framework but rather a set of loose modules you could drop into your game or even create a game from scratch with |
21:56:50 | Neomex | how come nim is fast with gc? |
21:57:01 | PMunch | What do you mean? |
21:57:06 | * | Trustable quit (Remote host closed the connection) |
21:57:24 | Neomex | garbage collection |
21:57:51 | couven92 | Neomex, GC does not necessarily mean slowness! :P |
21:57:52 | PMunch | I know what GC is short for.. |
21:58:09 | libman | https://www.reddit.com/r/programming/comments/6cja23/real_world_nim_adventures_medium_blog_platform/ |
21:58:21 | Neomex | it did mean that with every lang so far |
21:58:22 | Neomex | :s |
21:59:07 | PMunch | Neomex, another benefit with the Nim GC is that it's controllable |
21:59:55 | libman | I don't see why GC can't eventually become 100% concurrent and delay-free. |
22:00:01 | couven92 | Neomex, evrything is relaitive... You can do high-performance stuff in languages like C# nad Java, too... and they're not far behind optimized C/C++ implementations |
22:00:16 | PMunch | And you can turn it off if you want to |
22:00:49 | couven92 | For that matter, you can do high-perf stuff in Python or Node.js too if you know what you're doing... |
22:01:06 | PMunch | You can also set it to 60FPS and then spend the rest of the time of the "frame" doing GC |
22:01:17 | PMunch | So you don't get "hiccups" like in eg. Java |
22:01:30 | Neomex | well, im looking for a language for 3d game engine dev other than c++ |
22:01:33 | PMunch | couven92, high-perfish |
22:01:40 | Neomex | currently im stuck between rust and nim |
22:01:48 | * | couven92 does NOT know what he is doing and couldn't do high-perf stuff if it was staring me right in the face :P |
22:01:57 | libman | You should be stuck between Nim and Dlang. ;) |
22:02:13 | Neomex | i have PTSD from D's compilers |
22:02:31 | Neomex | it might have changed by now though |
22:02:38 | couven92 | Neomex, you should be stuck on Nim, period! :P It's a really beautiful language! :D |
22:03:08 | * | dddddd joined #nim |
22:03:15 | couven92 | (just kidding) ;) |
22:04:05 | couven92 | BTW. PMunch we have to conjure up a Nim presentation for UiT! Looking really forward to it! :) |
22:04:15 | libman | Nim is the Metric System of programming languages. |
22:04:23 | PMunch | Yeah, but didn't they push it until after summer? |
22:04:45 | couven92 | libman, does that mean we exclude the british and Americans? |
22:04:45 | PMunch | When using "nim doc" is there a way to generate for all files in a folder? |
22:05:01 | couven92 | PMunch, `nim doc2 --project` |
22:05:12 | PMunch | They aren't imported into one file |
22:05:21 | couven92 | and create a bundling project file that includes everything |
22:05:49 | libman | couven92: I meant that in 250 years everyone will be using it. :P |
22:05:51 | couven92 | PMunch, like this f.ex.: https://github.com/couven92/nim-windowssdk/blob/master/src/windowssdk.nim |
22:06:09 | Neomex | btw, are there vulkan bindings? |
22:06:19 | libman | https://en.wikipedia.org/wiki/History_of_the_metric_system |
22:06:20 | couven92 | libman, horray for SI standards! :D |
22:06:32 | PMunch | couven92, it means that they exclude themselves.. |
22:06:46 | PMunch | https://github.com/nimious/vulkan |
22:07:10 | couven92 | PMunch, then you probably need to run it multiple times... create a nakefile |
22:07:23 | couven92 | isn't that a thing? nake? |
22:07:30 | PMunch | Yeah, that's a thing :P |
22:07:41 | Neomex | im not sure if im not getting into something stupid again |
22:07:57 | Neomex | i should just stick with c++ and shoot heroin whenever i see header file |
22:08:32 | couven92 | PMunch, if you look in the .vscode folder, you see my nimble task for documenting everything... It quite nice actually... even deals with recursive sub-directories |
22:09:00 | couven92 | PMunch, like here: https://github.com/couven92/nim-windowssdk/blob/master/.vscode/tasks.json#L58 |
22:09:29 | couven92 | PMunch, ah sry, here I mean: https://github.com/couven92/nim-windowssdk/blob/master/windowssdk.nimble#L26 |
22:09:33 | PMunch | Neomex, I think you'll like it here :) |
22:10:15 | PMunch | couven92, I'll just do "for X in *; do nim doc $X ; done" for now |
22:10:26 | Neomex | how using C/C++ libs looks like in nim? |
22:10:44 | couven92 | Neomex, importc pragma... |
22:11:07 | couven92 | quite simple really... you can use c2nim tool to convert C code and headers to nim |
22:11:34 | couven92 | start with a simple C file you have lying around and try it... :) |
22:12:18 | libman | I had an old `nimdoc` shell script - https://github.com/lbmn/crap/blob/master/sh/nimdoc.sh |
22:13:02 | couven92 | libman, what do you think about my task? https://github.com/couven92/nim-windowssdk/blob/master/windowssdk.nimble#L26 |
22:13:19 | libman | Now I'm debating if I should use Nim-style camel casing for shell commands, like `nimDoc`. |
22:30:19 | Trioxin | which module is await in? |
22:31:53 | Trioxin | or maybe I'm just doing it wrong? var ret1 = await client.postContent( |
22:37:14 | dom96 | Trioxin: 'await' is only available in async procs |
22:37:19 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
22:40:28 | Trioxin | dom96, this doesn't work either: discard await client.getContent("http://speedtest-ams2.digitalocean.com/100mb.test") |
22:40:35 | Trioxin | undeclared identifier: 'await |
22:40:42 | Trioxin | another mistake in httpclient docs? |
22:42:07 | dom96 | Like I said, it needs to be in an async procedure. |
22:42:55 | Neomex | how do you see nim longevity and why it isnt mentioned anywhere? |
22:43:07 | dom96 | not all examples can just be copy pasted into a file and compiled. |
22:43:26 | dom96 | of course a note about this wouldn't hurt (and a better error message when 'await' is used outside an async proc) |
22:44:04 | dom96 | Neomex: Nim has been around for a while and this should prove its longevity. |
22:45:28 | Trioxin | so you can't use getContent or postContent with async? |
22:46:35 | dom96 | Trioxin: proc main() {.async.} = <insert_code_here> |
22:46:57 | dom96 | You can, it just needs to be wrapped in an async procedure. |
22:47:01 | * | brson joined #nim |
22:47:07 | Trioxin | o |
22:53:38 | libman | Nim namedrop of the day: nerdfight between BSD nerds who hate Rust vs those who hate ZFS licensing more - https://www.reddit.com/r/BSD/comments/6cioka/any_interest_in_porting_tfs_the_new_zfs_clone_in/ |
22:53:40 | * | Nobabs27 joined #nim |
22:53:43 | libman | (mentioned here mostly for Schadenfreude and comic relief) |
22:54:59 | Trioxin | what to put a callback on to return content? |
22:58:37 | Trioxin | these docs drive me crazy |
23:03:38 | * | brson quit (Quit: leaving) |
23:11:05 | * | gokr quit (Ping timeout: 255 seconds) |
23:14:15 | * | vlad1777d quit (Remote host closed the connection) |
23:20:51 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:26:16 | * | ftsf_ joined #nim |
23:41:47 | * | nsf quit (Quit: WeeChat 1.7.1) |
23:43:03 | * | arnetheduck_ joined #nim |