00:03:07 | FromGitter | <kayabaNerve> dom96: I have a thingy for you |
00:03:22 | FromGitter | <kayabaNerve> I just submitted my answers to your survey :P |
00:03:45 | FromGitter | <kayabaNerve> That's the only thing I can think of to feel more welcome |
00:10:31 | * | yglukhov[i] joined #nim |
00:15:38 | * | yglukhov[i] quit (Ping timeout: 276 seconds) |
00:48:45 | FromGitter | <rayman22201> @dom96 Submitted my survey. I'm long winded and wrote a novel, sorry in advance! |
00:56:13 | * | yglukhov[i] joined #nim |
01:00:57 | * | yglukhov[i] quit (Ping timeout: 264 seconds) |
01:02:16 | * | xet7 quit (Quit: Leaving) |
01:46:40 | shodan45 | dom96: your name is pronounced like pi-hetta? |
01:47:08 | shodan45 | (just started watching https://www.youtube.com/watch?v=hzxr9_ZK9uY ) |
01:48:35 | * | jhorwitz_ joined #nim |
02:07:01 | FromGitter | <kaushalmodi> Search for "nim lang" on Twitter returns a lot of foreign (non-English) language stuff |
02:07:58 | FromGitter | <kaushalmodi> Maybe everyone should tweet with #NimLang? May be the official Nim twitter account starts setting that as an example? @dom96 ? |
02:08:26 | FromGitter | <kaushalmodi> This is what I mean by foreign language stuff: https://twitter.com/search?q=nim%20lang&src=typd |
02:21:44 | FromGitter | <bevo009> Filipino |
02:24:40 | FromGitter | <bevo009> lang = just, only |
02:29:00 | * | smt` quit (Read error: Connection reset by peer) |
02:29:15 | * | smt` joined #nim |
02:34:20 | * | cspar_ joined #nim |
02:36:17 | * | cspar quit (Ping timeout: 248 seconds) |
02:43:11 | * | jhorwitz_ quit (Ping timeout: 276 seconds) |
02:54:07 | * | jhorwitz_ joined #nim |
02:58:32 | * | jhorwitz_ quit (Ping timeout: 245 seconds) |
03:04:28 | * | dddddd quit (Remote host closed the connection) |
03:20:01 | * | skrylar quit (Remote host closed the connection) |
03:44:44 | * | fourouge joined #nim |
03:45:10 | * | yglukhov[i] joined #nim |
03:49:53 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
04:03:44 | * | xkapastel quit (Quit: Connection closed for inactivity) |
04:30:51 | dyce[m] | for distinct types, you have to implement hash and == , would this be considered boilerplate? |
05:16:18 | * | lompik joined #nim |
05:21:46 | FromGitter | <bevo009> @shashlick A query mate, do the gists created by snip expire? |
05:28:28 | shashlick | I don't think so |
05:28:48 | shashlick | Will have to check http://ix.io syntax to confirm |
05:31:25 | shashlick | Nope they should not expire, they are anonymous and cannot be deleted either |
05:34:08 | * | ketralnis joined #nim |
05:46:40 | * | yglukhov[i] joined #nim |
05:51:39 | * | yglukhov[i] quit (Ping timeout: 268 seconds) |
06:06:26 | FromGitter | <bevo009> Awesome |
06:06:43 | FromGitter | <bevo009> @shashlick Does paste work in snip on your system? I'm trying to load snips via F3, have to type them in manually |
06:12:44 | FromGitter | <bevo009> I just set up a one key bash shortcut to code, build and run nim code :) ⏎ Press 's', type code in, F2, ESC...done! ⏎ alias s='touch p.nim && snip p.nim && nim c -r --verbosity:0 --hints:off p.nim' |
06:16:22 | FromGitter | <kaushalmodi> In Emacs, you do M-x gist-buffer, and the code's on gist :) |
06:18:10 | FromGitter | <bevo009> a simple F8 in snip to create a gist |
06:19:57 | FromGitter | <bevo009> you could create a vim-like tutorial for Nim inside snip, if you had the time, money and ability |
06:20:43 | FromGitter | <bevo009> I'm surprised it's not bundled with the install |
06:22:26 | FromGitter | <bevo009> @kaushalmodi do you have any great resource for learning emacs, or did you just wing it? |
06:31:44 | Bevo | Emacs is a cult, right? |
06:31:51 | Bevo | Once in, I'll spend my days tearing down and rebuilding it, until I achieve perfection |
06:31:58 | Bevo | And when I'm away from it, I'll be sad |
06:33:21 | FromGitter | <kaushalmodi> I just learned Emacs, just the basic key bindings many years ago at my first internship |
06:34:07 | FromGitter | <kaushalmodi> Then few years passed, somehow got a taste of Emacs Lisp and realized that I can make Emacs do almost anything! |
06:34:34 | Bevo | You don't check your email or listen to the radio on your emacs?? |
06:34:37 | FromGitter | <kaushalmodi> It's real, addictive, powerful |
06:35:12 | FromGitter | <kaushalmodi> It's my ultimate programming tool |
06:35:14 | Bevo | addictive sounds about right |
06:36:03 | Bevo | So you don't have any resource to point towards to learn it well? |
06:36:05 | FromGitter | <kaushalmodi> I'd say, if you are interested, started with doing basic edits, learning going things in Emacs, leaving all prior notions. |
06:36:25 | FromGitter | <kaushalmodi> Emacs tutorial is a great starting point |
06:37:14 | FromGitter | <kaushalmodi> Means press Ctrl and h keys together, the leave those and press t |
06:38:03 | FromGitter | <kaushalmodi> Mastering Emacs is a great book which I recommend buying. |
06:38:24 | FromGitter | <kaushalmodi> You read it and "do Emacs" as you read it. |
06:39:11 | FromGitter | <kaushalmodi> The Emacs subreddit, it's official help mailing lists, emacs.stackexchange.com, all are really courteous and helpful |
06:39:15 | * | jjido joined #nim |
06:39:28 | FromGitter | <kaushalmodi> s/it's/its |
06:39:50 | Bevo | I can't use vs code combined with my linux install (windows sub system), so I might have a go at emacs on that |
06:41:23 | FromGitter | <kaushalmodi> Emacd works well on WSL + ConEmu |
06:41:44 | Bevo | WSL/ |
06:41:49 | Bevo | WSL? |
06:41:59 | FromGitter | <kaushalmodi> Windows subsystem for Linux |
06:42:15 | Bevo | I use con emu for windows |
06:42:37 | Bevo | I use the built-in console from WSL |
06:42:40 | FromGitter | <kaushalmodi> I think it was widely known as WSL few years back, but the Windows started promoting a different marketing name |
06:43:20 | FromGitter | <kaushalmodi> Actually installing an X server will give a better experience |
06:43:37 | Bevo | Where do you get emacd? or was that a typo? |
06:43:43 | FromGitter | <kaushalmodi> Typo |
06:44:18 | Bevo | are X servers covered in Mastering Emacs? |
06:45:16 | FromGitter | <kaushalmodi> Emacs is widely used in GUI mode |
06:45:34 | FromGitter | <kaushalmodi> The X server reference was to use Emacs in GUI mode on Windows too |
06:45:52 | FromGitter | <kaushalmodi> See this blog for Emacs WSL setup: https://www.lonecpluspluscoder.com/2017/11/15/emacs-on-the-linux-subsystem-for-windows/ |
06:46:25 | Bevo | yeah, no guis with my sub system unless I re-install a new windows version and probably the sub system and everything else |
06:46:35 | FromGitter | <kaushalmodi> If you follow the comments thread, I had some hiccups getting it set up, but eventually got it working. |
06:46:48 | Bevo | I could do it on winows-conEmu though |
06:46:56 | FromGitter | <kaushalmodi> WSL and Windows X server are different things |
06:47:53 | Bevo | is X Server a linux dist? |
06:48:08 | FromGitter | <kaushalmodi> No |
06:48:39 | FromGitter | <kaushalmodi> Look into Xming X server for Windows |
06:49:43 | FromGitter | <kaushalmodi> Once you have it installed, check that it's working by launching any GUI application, like PDF viewer from WSL console. |
06:50:02 | FromGitter | <kaushalmodi> If that works, Emacs GUI will work too. |
06:52:32 | Bevo | yeah I might do a straight windows or linux install first |
06:52:54 | Bevo | I'd rather learn coding then spend hours/days tweaking a setup |
06:53:45 | Bevo | I've copied that info though for later, cheers KM |
06:58:00 | * | lompik quit (Quit: WeeChat 2.1) |
07:04:29 | Bevo | @kaushalmodi how do you install the nim plugin for amacs? |
07:04:45 | Bevo | is there just one to install? |
07:35:00 | * | user1101 joined #nim |
07:52:33 | * | yglukhov[i] joined #nim |
07:54:12 | FromGitter | <Varriount> @kaushalmodi Just merged in your terminal PR |
07:54:23 | * | gigglemoose joined #nim |
08:05:08 | gigglemoose | hey guys. i'm denser than concrete and can't figure out how to actually compile nim source code on windows 10. anyone able to help me out? |
08:05:32 | FromGitter | <tim-st> what doesnt work? |
08:05:52 | FromGitter | <tim-st> can you execute `nim --version` and `gcc --version`? |
08:06:26 | gigglemoose | no, i get "'nim' is not recognized as an internal or external command..." |
08:06:37 | gigglemoose | probably i'm missing something in the install process |
08:07:15 | gigglemoose | or my brain's dysfunctional. either one is likely |
08:08:04 | FromGitter | <tim-st> make sure to get the latest install archive from the main page, and the latest mingw (both should be the same target 32/64) then add both directories where nim.exe and gcc.exe is to path and then you can run `nim.exe c file.nim` |
08:08:17 | Bevo | did you run finish.exe to set the path etc |
08:08:44 | Bevo | it's in your nim installation directory |
08:08:51 | gigglemoose | i did run finish but i don't think gcc is in my path at all |
08:09:27 | FromGitter | <tim-st> yes, that's a problem because nim doesnt have an installer, yet, you can set the path variable manually though |
08:10:22 | FromGitter | <Varriount> @dom96 Could you help review this? This is the kind of pull request that really requires more than one reviewer: https://github.com/nim-lang/Nim/pull/8094 |
08:10:29 | gigglemoose | am i supposed to be playing with "User variables for [myname]" or "System variables" |
08:10:38 | gigglemoose | each of those has a unique PATH |
08:10:42 | FromGitter | <tim-st> @gigglemoose System is the correct one |
08:10:45 | Bevo | system path |
08:10:53 | Bevo | then add |
08:11:03 | Bevo | or edit |
08:11:06 | gigglemoose | that's interesting, finish put it in my user |
08:11:51 | FromGitter | <tim-st> installing nim is the hardest part, learning nim is easy ;) |
08:12:59 | gigglemoose | alright i added ...\nim-0.18.0\bin to my path in system variables but i'm still getting nim not recognized |
08:13:17 | Bevo | restart your console? |
08:15:14 | Bevo | echo $PATH |
08:15:45 | Bevo | export PATH=/file/path |
08:15:56 | Bevo | something like that |
08:17:11 | gigglemoose | alright, restarting the console got nim --version working but i'm having issues compiling still |
08:17:27 | FromGitter | <tim-st> does gcc --version works? |
08:17:40 | Bevo | what does typing gcc output? |
08:17:49 | gigglemoose | it does not. let me try to add that to path as well |
08:24:39 | gigglemoose | can't get gcc --version working after adding C:\MinGW\bin to path |
08:25:08 | FromGitter | <tim-st> console restarted? |
08:25:12 | gigglemoose | yeah |
08:25:40 | Bevo | did Nim.finish add a new minGW? |
08:25:57 | Bevo | I mean finish.exe |
08:26:08 | FromGitter | <tim-st> ensured that gcc.exe is actually in that path? mingw ships to `bin` directories, one doesnt have `gcc.exe` |
08:26:09 | gigglemoose | i'm not sure |
08:26:46 | Bevo | it did last laptop install I did, even though I had multiple minGWs already, none were compatible so it downloaded it's own |
08:27:07 | gigglemoose | yeah gcc.exe is in MinGW\bin |
08:27:48 | FromGitter | <tim-st> lol, that's a good example why nim really needs an installer, especially one that also installs gcc, not only nim |
08:29:07 | gigglemoose | any ideas as to why i can't get gcc recognized? |
08:29:59 | FromGitter | <tim-st> yes: you have the wrong path in PATH or you have not restarted all consoles; other ways arent in fact |
08:31:30 | FromGitter | <tim-st> also gcc is in System-Path? |
08:32:44 | FromGitter | <tim-st> for me these two are the important ones in system-path: `C:\Program Files\Nim\bin;C:\Program Files\mingw64\bin;` |
08:33:47 | FromGitter | <Varriount> I assume you're on Windows? |
08:33:53 | gigglemoose | i redid the gcc path and it works now. i couldn't tell you why, given that i copy pasted the exact same value, but that's working now |
08:33:59 | gigglemoose | so i can get gcc version working |
08:34:09 | gigglemoose | but now i get a bizarre error when i attempt to compile |
08:34:15 | gigglemoose | yeah i'm on windows 10 |
08:34:28 | FromGitter | <tim-st> which? do architectures match (both x64)? |
08:34:54 | gigglemoose | https://i.imgur.com/OlGRbJE.png |
08:35:08 | FromGitter | <tim-st> so they dont^^ |
08:35:42 | FromGitter | <tim-st> please install nim x64 AND mingw64 |
08:36:20 | gigglemoose | nim's definitely x64 and if mingw isn't x64 then i'm very confused as to how |
08:36:53 | FromGitter | <tim-st> https://nim-lang.org/download/mingw64-6.3.0.7z |
08:37:41 | gigglemoose | that's the exact one i downloaded, believe it or not |
08:37:54 | FromGitter | <tim-st> you can copy `nim --version` and `gcc --version` to see if both tell you x64 |
08:37:59 | gigglemoose | probably i fucked it up. let me nuke my existing install from orbit |
08:38:33 | gigglemoose | gcc --version doesn't say anything about 32 or 64 bit |
08:38:58 | FromGitter | <tim-st> mine does: `gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0` |
08:40:10 | gigglemoose | i think i'm actually using an old version of mingw. i downloaded the mingw from the above link but i think i actually forgot to install it and it's using an old one i had |
08:40:37 | Bevo | $ gcc --version gcc.exe (MinGW.org GCC-6.3.0-1) 6.3.0 |
08:41:04 | gigglemoose | yeah that's what i'm getting |
08:41:05 | Bevo | that's a few weeks old at most |
08:41:18 | gigglemoose | so i am using the proper mingw, presumably |
08:41:20 | Bevo | that's the one nim downloaded for me |
08:41:36 | Bevo | what's the compilation error |
08:41:36 | * | dddddd joined #nim |
08:41:59 | FromGitter | <tim-st> this is what you want: https://datapacket.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z |
08:42:02 | gigglemoose | in the imgur link above ^^ |
08:43:32 | gigglemoose | i'm so confused as to why this wouldn't be working |
08:44:24 | FromGitter | <tim-st> if you take the version I posted, and nim x64, and delete old paths and set new ones it will work |
08:44:46 | FromGitter | <bevo009> my system is x64, thate one above is what Nim downloaded to be compatible I assume |
08:44:58 | gigglemoose | alright i'll give that version a shot |
08:46:33 | * | cspar_ quit (Ping timeout: 264 seconds) |
08:48:34 | FromGitter | <bevo009> you can run finish.exe again IIRC and it tells you what's not right |
08:48:46 | gigglemoose | finish.exe just instantly closes itself |
08:48:57 | FromGitter | <tim-st> dont run finish.exe that will destroy what I told you to install |
08:49:21 | gigglemoose | alright i won't |
08:50:20 | FromGitter | <tim-st> make sure to delete old paths and 1) that you are on winx64 2) have nim x64 3) have the sourceforge link gcc 4) after this set new system paths to new folders |
08:50:49 | gigglemoose | will do |
08:51:38 | * | yglukhov[i] quit (Remote host closed the connection) |
08:52:07 | FromGitter | <tim-st> and delete `nimcache` folder before compiling next time (this is only needed if you change compiler or nim version) |
08:52:10 | * | yglukhov[i] joined #nim |
08:53:11 | FromGitter | <arnetheduck> speaking of windows.. I wouldn't mind at all if someone would want to look into getting `nlvm` to compile there - that would allow most nim apps to be compiled without mingw / gcc, simplifying distribution |
08:55:10 | gigglemoose | it compiles! thanks a ton! |
08:55:56 | FromGitter | <tim-st> no problem, I had these issues too on windows |
08:56:22 | gigglemoose | a small thing, though - the console automatically exits itself instantly once the program finishes running so i can't view the printed output. how can i change this behaviour? |
08:56:27 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
08:57:00 | FromGitter | <tim-st> dont know hat you mean, screenshot? |
08:58:20 | FromGitter | <bevo009> don't forget code runner to go with vs code/nim plugin...compile and run with ctrl-alt-N |
08:59:05 | FromGitter | <tim-st> and dont forget to set your console to "legacy" (see nim forum) before, otherwise compilation will break randomly |
08:59:08 | gigglemoose | i'm running the first program from this tutorial ( https://nim-lang.org/docs/tut1.html#the-first-program ). it prints the first statement, then i enter a string, then the console completely exits, presumably because it's finished running. this makes it so that i can't view the second and final echo |
08:59:37 | FromGitter | <tim-st> maybe this is exactly what I wrote above |
09:00:54 | Bevo | windows or a bash console |
09:01:09 | FromGitter | <tim-st> but dont know, please try other examples where you dont have "reading from console" |
09:01:23 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:01:32 | gigglemoose | i'm using windows' default command prompt |
09:01:37 | * | rauss quit (Read error: Connection reset by peer) |
09:01:41 | gigglemoose | changing to legacy doesn't seem to have worked |
09:01:59 | Bevo | entering this? nim compile --run greetings.nim |
09:02:03 | FromGitter | <tim-st> yes, that will make a difference once you use vs code |
09:02:46 | Bevo | nimc -r greetings.nim |
09:02:52 | Bevo | ahh |
09:03:04 | Bevo | nim c -r greetings.nim |
09:03:18 | gigglemoose | yeah i haven't used vscode in my life. right now i'm just compiling in a window then going and opening the compiled file it makes |
09:03:28 | * | rauss joined #nim |
09:03:41 | FromGitter | <tim-st> install vs code, I havent used it before too |
09:04:29 | gigglemoose | will do |
09:05:28 | FromGitter | <tim-st> and the plugins "nim", "code runnner", "TODO Highlight" and maybe "IntelliJ Keymaps" |
09:05:48 | gigglemoose | it's funny because nim just works perfectly on my linux virtual machine |
09:05:59 | gigglemoose | it was the easiest install of my life and i don't even know what i'm doing with linux |
09:06:27 | Bevo | you should just be able to write echo "Hello World" in notepad and save to greetings.nim, then run it in the command prompt to test it |
09:06:35 | * | craigger joined #nim |
09:06:59 | FromGitter | <tim-st> yes, linux is better for this, but I cannot use it because my battery will go down from six hours to six minutes |
09:08:09 | * | craigger_ quit (Ping timeout: 264 seconds) |
09:08:29 | gigglemoose | yeah cmd instantly exits if i don't ask for input. not particularly surprised there |
09:09:25 | gigglemoose | alright got vs code installed. now for those plugins |
09:10:29 | * | nsf joined #nim |
09:10:38 | FromGitter | <tim-st> only install intelliJ Keymaps if you used intelliJ before (intellij, pycharm,...) |
09:10:52 | Bevo | windows command prompt sucks. get conemu and use a bash |
09:11:08 | Bevo | vs code has a terminal, but it's a bit tiny |
09:11:46 | Bevo | but it hooks into my conemu bash if I don't have the vs code terminal open, pretty cool |
09:12:22 | gigglemoose | that's pretty cool |
09:12:26 | gigglemoose | i'll look into conemu |
09:12:36 | Bevo | having said that, the windows command prompt shouldn't be closing |
09:12:50 | Bevo | can you do a screenshot before it closes? |
09:15:23 | gigglemoose | not for the version with no input - it really is instant |
09:15:54 | FromGitter | <tim-st> when you installed all this, go to settings and set `editor.tabSize` to 2 |
09:16:11 | Bevo | screenshot the console with the command you typed in, before entering it |
09:16:59 | FromGitter | <ephja> any terminal spawned for a specific application will exit when the application exits. that workflow might be more common on windows though |
09:17:08 | Bevo | this works straight away too, and auto-compiles/runs while you type the code in... https://github.com/genotrance/snip |
09:18:15 | Bevo | not as good an editor as vs code, but quicker for small tests |
09:21:03 | FromGitter | <ephja> I don't think some of the examples using cin or whatever made sense without piping |
09:21:57 | * | jjido joined #nim |
09:22:46 | Bevo | I just pasted the example code into notepad, saved it to ~/ as test.nim, then opened a windows command prompt and ran it |
09:22:59 | Bevo | C:\Users\bevo>nim c -r test.nim Hint: used config file 'C:\Users\bevo\nim\config\nim.cfg' [Conf] Hint: system [Processing] Hint: test [Processing] CC: test CC: stdlib_system Hint: [Link] Hint: operation successful (11718 lines compiled; 1.467 sec total; 21.461MiB peakmem; Debug Build) [SuccessX] Hint: C:\Users\bevo\test.exe [Exec] What's your name? Bevo Hi, Bevo! |
09:23:54 | Bevo | are you doing: windows icon-right click-command prompt? or something else? |
09:27:59 | gigglemoose | right now i'm seeing if i can make vscode work so i don't have to worry about the closing command prompt. i'm compiling in one cmd and manually opening the compiled exe which opens in a second cmd, the one that crashes after execution |
09:28:11 | gigglemoose | vscode seems to ALMOST be working properly |
09:28:31 | gigglemoose | but it only actually lets me run the code once |
09:29:18 | FromGitter | <tim-st> dont use this console read thing, that's not a good start example |
09:29:40 | FromGitter | <tim-st> instead try play with `strutils` and echo and write some procs |
09:29:53 | Bevo | echo "Hello World" is all you need to test it |
09:31:14 | FromGitter | <ephja> ok so you were compiling from a prompt but you were not running the application from the same prompt just by typing the name of the executable |
09:31:28 | Bevo | press ctrl-`, it brings up the vs code terminal |
09:32:46 | FromGitter | <ephja> @tim-st are you enjoying the automatic indentation of the Nim extension? :D |
09:33:32 | FromGitter | <ephja> I know dom does |
09:34:08 | gigglemoose | i've got the vs code terminal up (it says it's running powershell). i'm not certain what i'm supposed to be doing with it |
09:34:16 | FromGitter | <tim-st> I think if one day all these things work, nim will be the best language |
09:34:53 | FromGitter | <tim-st> why do you care about terminal? Just try some code and click "run" |
09:35:25 | gigglemoose | i don't have a way to input anything after clicking run |
09:35:46 | Bevo | echo "Hello World" |
09:35:52 | Bevo | type that in the editor |
09:35:56 | FromGitter | <tim-st> lol, do you still have this "read from console" example? skip this sh*t |
09:35:59 | gigglemoose | printing works perfectly |
09:36:16 | FromGitter | <tim-st> I literally never read from console the last 8 months nim |
09:36:16 | Bevo | save it to hello.nim |
09:37:20 | FromGitter | <tim-st> here is some code: https://rosettacode.org/wiki/Category:Nim |
09:37:51 | FromGitter | <ephja> `echo stdin.readLine().string` that works for me in the vscode terminal |
09:38:18 | Bevo | it works on windows command prompt too |
09:38:37 | FromGitter | <ephja> yes |
09:39:01 | * | cspar_ joined #nim |
09:39:09 | gigglemoose | the terminal doesn't do anything for me in vscode and obviously i can't input in the output tab |
09:39:20 | Bevo | not on the playground, but does work on the TIO pad |
09:39:35 | Bevo | the window at the top is the editor window |
09:39:52 | Bevo | type it in there, and ctrl-s to save it to a .nim file |
09:40:06 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:40:28 | FromGitter | <ephja> it worked for him with cmd didn't it? but then he wouldn't see the output since he didn't run the application from the same terminal, so he got a new, temporary one when he clicked on the executable |
09:40:40 | Bevo | I always think it's best to start with notepad and a command prompt...simple |
09:41:18 | gigglemoose | yeah that's what was happening ephja |
09:41:36 | gigglemoose | nim itself is working i think i just don't understand vscode |
09:41:59 | Bevo | but yeah, I wouldn't compose it in a terminal when starting, let alone run it in a second terminal |
09:43:29 | FromGitter | <ephja> my code is being run from the terminal pane. that's probably why it works for me |
09:43:59 | Bevo | @gigglemoose, have you got notepad handy just for a quick test? |
09:44:03 | gigglemoose | what i'm doing in vscode is writing the code and pressing the run code button in the top right (i think that's from one of the extensions i was told to use) |
09:44:06 | FromGitter | <ephja> what does F6 do? |
09:44:06 | gigglemoose | yeah i do |
09:44:49 | FromGitter | <ephja> I dunno why I don't have a "run" button |
09:44:57 | gigglemoose | f6 makes everything work. apparently that's the magic answer. thanks! |
09:45:16 | gigglemoose | i didn't have a nim option in my terminal so it was only powershell and obviously that isn't gonna help much |
09:46:03 | Bevo | yeah you might have to export your path into vs codes terminal for that to work correctly, IIRC |
09:46:19 | FromGitter | <tim-st> @ephja there is vscode "Code Runner" that installs a triangle symbol which is then the run button |
09:46:28 | Bevo | if you have code runner installed, you can run it via ctrl-alt-N |
09:46:49 | Bevo | you probably have to restart it |
09:47:32 | gigglemoose | i don't know what's going on behind the scenes but when i use code runner i can only get the program's output but everything works like it does in cmd if i just press f6 |
09:47:59 | Bevo | add this to your user preferences (ctrl-comma) |
09:48:01 | Bevo | "code-runner.clearPreviousOutput": true |
09:48:07 | FromGitter | <ephja> I'm not sure what you mean by that, but it should be possible with either cmd or powershell. the difference being that you need to do ".\app" in order to run app.exe, rather than just "app" like with cmd, though ".\app" should work there too. but "nim c -r app" will both compile and run the app for you |
09:48:14 | Bevo | clears the output bfore each run |
09:49:19 | FromGitter | <tim-st> that's very cool, thanks, I always wanted that^^ |
09:49:43 | Bevo | lol a live video would certainly help here...it's the blind leading the blind |
09:50:12 | Bevo | @tim-st yes some googling paid off for me there |
09:51:44 | gigglemoose | code runner doesn't allow me to get input at all but everything works perfectly by pressing the magic f6 button so i guess i'll just use that |
09:52:19 | Bevo | One day we might be able to install a combined Nim-mingW-VS Code install, where everything just works automatically |
09:52:51 | Bevo | code runner just runs the code in your editor, and displays the output |
09:53:40 | gigglemoose | no wonder it doesn't allow input then |
09:53:51 | FromGitter | <ephja> well it would be in a child process of the editor regardless :p |
09:54:12 | Bevo | just used F6 for the first time...it runs the code in the terminal |
09:54:37 | Bevo | yeah, user input code doesn't work in code runner, nim playground, snip |
09:54:53 | Bevo | it does work in TIO's pad though |
09:55:45 | Bevo | F6 is great! Thanks Tim, I always opened a console to test user input code |
09:56:01 | Bevo | look how we all learn together , aww |
09:56:45 | gigglemoose | turns out that nim's garbage installation is a learning moment for all! <3 |
09:57:27 | FromGitter | <tim-st> ^^ |
09:57:35 | Bevo | hahaha |
09:57:57 | Bevo | linux on windows sub system was surprisingly easy |
09:58:10 | Bevo | windows, a little harder |
09:58:15 | gigglemoose | now i just have to learn how to actually use the nim language. should be a trivial task compared to the installation process :P |
09:58:41 | gigglemoose | yeah nim just worked for me beautifully on my linux vm but the parent system seems to have been a bit of a nightmare |
09:58:44 | gigglemoose | but it does work now! |
09:58:58 | Bevo | that's the main thing |
09:59:12 | Bevo | and you have vs code now, which makes all things better |
09:59:49 | gigglemoose | it seems like a decent enough editor |
10:00:05 | gigglemoose | as good as anything as one would expect from a new language |
10:00:59 | FromGitter | <tim-st> yes, learning nim is quite easy, also if the gcc compiler (not nim) exits with an error code in vs code, open an issue on github, that happens sometimes in special cases |
10:01:34 | gigglemoose | will do |
10:02:10 | gigglemoose | i'm a (quite mediocre) java dev so a language like nim is a bit out of my alley but it looks pretty great thus far |
10:03:23 | Bevo | alternating between F6 and Ctrl-Alt-N, alternates between no verbosity and hints, and the default verbosity/hints...nice |
10:03:51 | Bevo | how did I not know about F6? lol |
10:04:04 | FromGitter | <tim-st> I also learnt java first because at university oracle has big contracts with the universities that they need to teach only java |
10:05:36 | gigglemoose | java does have its advantages but i really can't stand to look at it right now :P i've done far too much coding in java lately for school and it's starting to make me hate the language |
10:06:20 | * | cspar_ quit (Ping timeout: 268 seconds) |
10:08:58 | FromGitter | <tim-st> one important point in nim if you pass an object to a proc that you want to change e.g. string you have to write `proc change*(s: var string)` instead of `proc change*(s: string)` that's important to know, other things you'll find out easily |
10:10:38 | Bevo | This basics tutorial might be too basic for you, but it's a bit more thorough than the main tutorial: https://narimiran.github.io/nim-basics/ |
10:10:46 | gigglemoose | that is very strangely specific but i'll make sure to keep it in mind |
10:11:00 | Bevo | good to cross-reference |
10:12:34 | gigglemoose | that looks like a really good reference, thanks |
10:14:03 | gigglemoose | as a quick aside, is there any particular (understandable) reason that the syntax is "var a: int" rather than "int a"? i've never seen syntax that looks like that and it strikes me as quite odd |
10:14:49 | FromGitter | <tim-st> yes, internally it's the very same like int a; it's a check at compile time |
10:15:41 | FromGitter | <tim-st> sometime you accidently shadow a variable, then if you try to change it but declare it using `let` it doesnt work, at this time you understand you accidently accessed the wrong var |
10:15:52 | Bevo | yeah it's a bit weird coming from c-tpe syntax |
10:16:15 | FromGitter | <tim-st> so there are both `let a = 1` and `var a = 1` |
10:16:24 | Bevo | it reads implicitly like javascript also |
10:16:49 | user1101 | Hi. Sorry for the noobish question, but would anyone be able to outline the difference between the three functions mentioned in this thread? https://www.reddit.com/r/nim/comments/8tggtn/basic_question_regarding_object_creation/ |
10:17:52 | Bevo | but apparently it pays to declare the types |
10:18:30 | gigglemoose | i am definitely slightly reluctant to let it infer the types. maybe that just means i have trust issues lol |
10:20:34 | FromGitter | <tim-st> let and var are the very same internally |
10:22:20 | gigglemoose | is the difference between '/' and 'div' just that div converts the answer to an int? |
10:23:25 | FromGitter | <ephja> it takes two integers and returns two integers. see https://nim-lang.org/docs/system.html#div,int,int |
10:24:44 | FromGitter | <ephja> and / takes two floats and returns a float. / is also listed there |
10:27:16 | FromGitter | <ephja> "2 / 3" works, but it's not actually "/" that converts the arguments to floats. that's actually a property of the language. "2.0 div 3.0" won't work, because floats can not be implicitly converted to integers because of potential loss of information |
10:27:31 | Bevo | and use mod instead of % for remainder |
10:27:49 | * | PMunch joined #nim |
10:28:22 | gigglemoose | that's really interesting. thanks |
10:29:45 | Bevo | use 'import math' for exponents ^ |
10:31:10 | FromGitter | <ephja> Bevo: which %? :p |
10:33:01 | FromGitter | <ephja> not imported by default: https://nim-lang.org/docs/math.html#mod,T,T |
10:35:47 | Bevo | I meant % in Python...modulo |
10:36:11 | Bevo | ours is mod |
10:38:52 | Bevo | oh yeah, gotcha...I know about the other mod in module math lol |
10:47:10 | * | yglukhov[i] joined #nim |
10:55:22 | * | zahary joined #nim |
11:02:50 | * | opi joined #nim |
11:25:45 | * | zahary quit (Quit: Leaving.) |
11:25:58 | * | stefantalpalaru joined #nim |
11:27:36 | * | gigglemoose quit (Quit: Page closed) |
11:28:04 | Yardanico | yay, new survey |
11:28:13 | Yardanico | (for everyone who didn't see it yet - https://nim-lang.org/blog/2018/06/23/community-survey-2018.html ) |
11:28:28 | stefantalpalaru | Hi. The current HEAD fails to build with: "compiler/lookups.nim(233, 35) Error: type mismatch: got <string> [...] expression: getIdent(toLowerAscii(x.s[0]) & substr(x.s, 1))". |
11:28:49 | Yardanico | what version are you using to build HEAD? |
11:29:11 | stefantalpalaru | the latest C source |
11:30:29 | stefantalpalaru | from https://github.com/nim-lang/csources |
11:52:55 | * | elrood joined #nim |
11:53:42 | shashlick | Frustrating to see these Nim install issues |
11:56:08 | * | nsf quit (Quit: WeeChat 2.1) |
12:16:18 | FromGitter | <tim-st> how can I use nimscript or some eval tool to evaluate something like `1+1` at runtime? |
12:21:37 | * | leorize joined #nim |
12:21:52 | FromGitter | <GULPF> if you only care about math stuff you can use @Yardanico's lib: https://github.com/Yardanico/nim-mathexpr |
12:22:21 | Yardanico | Yeah, but docs in the readme are a bit old :) |
12:22:41 | Yardanico | (but it's generally a one-file lib and can be easily extended with new functions) |
12:22:42 | FromGitter | <tim-st> @GULPF and @Yardanico perfect thank you! |
12:23:44 | FromGitter | <tim-st> especially the operators are a bit difficult to parse, that's a good help |
12:24:59 | dom96 | stefantalpalaru: Which instructions are you following? |
12:25:07 | dom96 | Travis tests are succeeding so there shouldn't be a problem. |
12:25:21 | Yardanico | @tim-st if you're wondering, I've based mathexpr on this SO answer: https://stackoverflow.com/a/26227947 |
12:25:51 | dom96 | oooh, 101 responses already |
12:25:55 | Yardanico | dom96, wow :) |
12:26:23 | Yardanico | I think we may have more than 1k answers in this survey |
12:27:02 | dom96 | Would be nice :) |
12:27:24 | FromGitter | <tim-st> @Yardanico ok, thanks for the info |
12:29:31 | dom96 | Someone developing on Haiku :) |
12:31:26 | Yardanico | dom96, lol |
12:31:53 | Yardanico | @tim-st you can also use tinyexpr (C library) with Nim |
12:32:04 | Yardanico | actually mathexpr was just a wrapper for tinyexpr in the past |
12:32:24 | Yardanico | https://github.com/Yardanico/nim-mathexpr/commit/039f5f07714b675ca51a1ce5d0bf9928c8b9b77d |
12:33:15 | Yardanico | But I didn't do any high-level wrappers to tiynexpr |
12:33:32 | stefantalpalaru | dom96: this is where it fails, while compiling nimfix - https://github.com/stefantalpalaru/gentoo-overlay/blob/514e2d96de06d553d44b15f70eef31fb3b38e239/dev-lang/nim/nim-9999-r2.ebuild#L62 |
12:33:52 | Yardanico | why are you building nimfix? |
12:34:11 | stefantalpalaru | why wouldn't I? |
12:34:23 | dom96 | maybe try `./koch tools -d:release` instead |
12:34:30 | Yardanico | dom96, ./koch tools don't build nimfix |
12:34:38 | dom96 | but yeah, I'm pretty sure nimfix is dead |
12:34:43 | dom96 | deprecated |
12:34:48 | stefantalpalaru | oh, ok |
12:35:06 | dom96 | so just use ./koch tools to build all the tools that are available |
12:35:27 | Yardanico | Yeah, "./koch boot -d:release" for the compiler and "./koch tools" for all tools, very easy |
12:35:52 | dom96 | you can give tools `-d:release` too IIRC |
12:36:04 | FromGitter | <tim-st> @Yardanico is there a wrapper already for tinyexpr? |
12:36:23 | Yardanico | @tim-st well, I've linked my commit with tinyexpr wrapper |
12:36:54 | Yardanico | you can easily create yours by using nimgen and then maybe writing some high-level procs for the wrapper |
12:37:08 | FromGitter | <tim-st> ok, thanks! |
12:37:21 | dom96 | Responses are coming in fast. Already at 104 |
12:37:53 | FromGitter | <ephja> ```code paste, see link``` |
12:38:00 | Yardanico | dom96, yeah, I've submitted mine a few mins ago |
12:44:02 | FromGitter | <kindlychung> How do you pass members of a tuple to a proc? |
12:44:19 | FromGitter | <kindlychung> In python you can do this: `func(*list)` |
12:44:28 | Yardanico | you should specify them all |
12:44:33 | Yardanico | func(a[0], a[1], a[2]) |
12:44:41 | Yardanico | but there's a way to unpack a tuple AFAIK |
12:44:50 | FromGitter | <kindlychung> Ok, that's a bit ugly. |
12:45:07 | Yardanico | well, why won't you pass a tuple instead of unpacking it? |
12:45:43 | Yardanico | hmm, probably it's time to update my video (https://www.youtube.com/watch?v=rUJ7Bzgv3n0 - visualisation of Nim git repo with gource) |
12:46:49 | dom96 | kindlychung: You can also just pass the tuple itself, but yeah I agree it's not ideal. I wanted to add this functionality but ran into a problem. |
12:47:33 | Yardanico | dom96, what problem? |
12:48:39 | FromGitter | <kindlychung> @dom96 Really? I was trying to do something like this: `title:{}, views:{}, size:{}".fmt(mytuple)` |
12:49:00 | FromGitter | <kindlychung> the vscode extension shows that this is wrong. |
12:49:20 | FromGitter | <kindlychung> `.nimble/pkgs/strfmt-0.9.0/strfmt.nim(1206, 18) Error: Too few arguments for format string` |
12:49:51 | Yardanico | firstly - use "strformat" |
12:50:16 | Yardanico | or % from strutils if you don't need fancy formatting |
12:50:36 | Yardanico | and also, why won't you just echo the tuple? |
12:50:52 | Yardanico | !eval let mytuple = (title: "hello", views: 5, size: 500); echo mytuple |
12:50:55 | NimBot | (title: "hello", views: 5, size: 500) |
12:51:17 | FromGitter | <kindlychung> @Yardanico the tuple is not named. |
12:54:59 | FromGitter | <kindlychung> And even if the tuple is named, echoing the tuple wouldn't ideal when you want to do a bit more formatting. |
12:57:56 | Yardanico | !eval import strformat; let mytuple = (1, 2, 3); echo &"{mytuple[0]}+{mytuple[1]}={mytuple[0] + mytuple[1]}" just an example |
12:57:58 | NimBot | Compile failed: in.nim(1, 104) Error: undeclared identifier: 'just' |
12:58:03 | Yardanico | you can easily make a "unpack" macro |
12:58:21 | Yardanico | https://github.com/vk-brain/Nickel/blob/master/src/utils.nim#L55 (ignore the comments, they're in Russian) |
12:58:32 | dom96 | Yardanico: You cannot spread inside a macro :/ |
12:58:38 | Yardanico | dom96, spread? |
12:58:48 | dom96 | so we would have to do it like this: unpack(funcName, tuple1) |
12:58:59 | Yardanico | hm |
12:59:00 | dom96 | which isn't as nice as funcName(*tuple1) |
13:02:22 | FromGitter | <ephja> if only argument lists were first class citizens |
13:04:00 | dom96 | the problem is that a single node cannot be expanded into multiple in a way that's compatible with an argument list |
13:04:18 | dom96 | I wanted Araq to add a new node kind for this but he refused :) |
13:04:51 | FromGitter | <ephja> "foo(if x: a, b, c else: d, e, f)" ;) |
13:05:52 | Yardanico | oh wait |
13:11:06 | Yardanico | @ephja oh, I realised, this won't work |
13:25:18 | * | leorize quit (Quit: WeeChat 2.1) |
13:26:49 | * | Perkol joined #nim |
13:27:36 | FromGitter | <kaushalmodi> @bevo009 Melpa is the most famous package repository for Emacs. For brevity in this channel, go through https://melpa.org/#/getting-started, and then install `nim-mode` package using the Emacs inbuilt package manager once Melpa is set up. Feel free to ask questions on the Emacs subreddit. For later, once you are comfortable with editing Nim code in Emacs, look into Org mode, Org Babel and `ob-nim` package. That will |
13:27:36 | FromGitter | ... allow you to have all Nim snippets in a single Org file, with their results auto-calculated and inserted below the respective code blocks. |
13:29:34 | Perkol | I'm using ospaths.getEnv to get certain environment variable. Is there a way to convert it's tainted string to string? |
13:29:36 | FromGitter | <kaushalmodi> @Varriount Thanks for merging the PR! I'm just curious about how that commit would fare on Windows (not sure if you look at notifications on closed PR's, but I have replied to you in that PR too). |
13:31:20 | * | stefantalpalaru quit (Quit: Leaving) |
13:38:18 | FromGitter | <arnetheduck> Araq, so coming back to the globals thing ("man, I really wish I had used a global here").. while I'm very happy that there are fewer globals in the compiler now, it's such a bloody PITA to to update `nlvm`, which I guess must be nothing compared to the compiler itself.. makes you wish public exported globals were not part of the language at all.. imagine how much UB that would save - initialization orders, |
13:38:18 | FromGitter | ... unresolvable cyclic refs, broken attempts at multi-threading etc etc, all gone... |
13:49:40 | FromGitter | <Varriount> @kaushalmodi Regarding the globals, that can be done in another PR, along with any fixes for Windows. |
13:51:34 | FromGitter | <kaushalmodi> OK, so will you be following up with that in a separate commit/PR? Or should that need an issue to be opened? |
13:59:28 | * | dddddd quit (Remote host closed the connection) |
14:04:41 | FromGitter | <Varriount> I don't know if I'll have the time until the end of the summer. |
14:06:00 | FromGitter | <kaushalmodi> The demo you showed seemed to work. The issues it exposed had nothing to do with the PR. |
14:06:24 | FromGitter | <kaushalmodi> I'll open an issue to track this later today if you don't get to it before. |
14:09:10 | FromGitter | <Varriount> Sure, thanks! |
14:23:16 | * | xet7 joined #nim |
14:44:14 | Perkol | How do I concatenate strings in Nim? |
14:45:02 | shashlick | & |
14:45:08 | Perkol | strutils.join |
14:46:21 | Yardanico | Perkol, no |
14:46:37 | Yardanico | strutils.join is for concatenating elements from things like seqs |
14:46:51 | Yardanico | with custom separator |
14:48:58 | * | PMunch quit (Quit: leaving) |
14:49:21 | FromGitter | <kayabaNerve> Don't forget to $ your non-string arguments! |
14:50:12 | Yardanico | ? |
14:50:19 | Yardanico | you can't use $ with strutils.join |
14:51:01 | Yardanico | well, you *can* if you will do it like @[$1, $2, $3], but why? |
14:52:46 | FromGitter | <kayabaNerve> I'm talking about & |
14:53:38 | FromGitter | <kayabaNerve> Don't do str & num. Do str & $num... |
14:55:07 | * | cspar_ joined #nim |
14:59:42 | * | ephja joined #nim |
15:04:37 | Bevo | ahh! what does the $ operator do there? learn something every day here |
15:04:59 | Yardanico | Bevo, ehm? |
15:05:11 | Yardanico | ok, sorry, $ is used for stringification in Nim |
15:05:28 | Bevo | how does that work, the $ operator before num there? |
15:06:02 | Yardanico | Bevo, it converts a number to string? |
15:06:04 | Bevo | whatever it is suffixed to, converts to a string |
15:06:12 | Yardanico | if you want for you type to be able to be echoed/converted to string via $ - you need to define `$` for your type |
15:06:23 | Yardanico | it's already defined for almost all standard types |
15:06:33 | Bevo | so I can just tag any number variables with that? |
15:06:39 | Yardanico | tag? |
15:07:35 | Bevo | that just works on variables? |
15:08:09 | Yardanico | Bevo, it's an operator, it works everywhere |
15:08:20 | Yardanico | !eval echo $1; let a = 5; echo $a |
15:08:22 | NimBot | 1↵5 |
15:08:32 | Bevo | like echo str & $num |
15:09:09 | Yardanico | well, you should probably read manual or tutorial, but yes, $ works both on literals and variables |
15:09:16 | FromGitter | <kayabaNerve> Whatever it's prefixed to |
15:09:19 | Yardanico | and $ is also used by things like strutils.join or strformat module |
15:09:59 | FromGitter | <kayabaNerve> But tbh, the bigger concern is Yardanico assuming I don't know how $ works and judging me :( |
15:10:08 | Yardanico | I didn't say that you don't know $ |
15:10:19 | Yardanico | And I didn't assume it :) |
15:10:34 | ephja | "proc p(args; result: var T): void" the proposed shortcuts seem similar to the common pattern in D where the input buffer is also returned, or if nil a new buffer created inside the function is returned |
15:10:52 | Bevo | I am reading them, I've used the $ operator with strutils |
15:11:05 | ephja | After it is filled with some data for example |
15:13:06 | Bevo | @yardanico i don't get your first example |
15:13:16 | Bevo | why echo $1 |
15:13:18 | * | xkapastel joined #nim |
15:13:22 | Bevo | same output as echo 1 |
15:13:34 | Yardanico | Bevo, echo uses $ implicitly to convert all arguments to string |
15:14:00 | Bevo | yeah but you are printing to std.out there |
15:14:28 | Bevo | so, why echo $1, when echo 1 is the same? |
15:14:41 | Yardanico | I just wanted to show you that you can convert literals to string the same way as variables |
15:14:42 | FromGitter | <kayabaNerve> echo $1 ⏎ var myStr: string = $1 |
15:14:45 | Yardanico | Because you've asked it |
15:14:57 | Yardanico | "that just works on variables?" |
15:15:05 | FromGitter | <kayabaNerve> It's proper format and practice |
15:16:13 | Bevo | I think that $ is a formatb specifier in C |
15:16:26 | Yardanico | Bevo, well, Nim is not C and $ is an operator in Nim :) |
15:17:08 | Bevo | it looks very similar when you use import strutils |
15:17:11 | ephja | Examples in the system module |
15:17:21 | Bevo | I'll remember that, thanks |
15:18:24 | ephja | Of how `$` is defined, that is |
15:19:32 | Bevo | ahhh...when I use $ in a formatted string using import strutils...is the $ an operator still? |
15:22:00 | Bevo | like echo "$# is a $# year old $#" % ["Ann", "30", "woman"] |
15:23:09 | Yardanico | no |
15:23:24 | Yardanico | it's a string which is processed by % proc |
15:23:43 | Yardanico | and % proc expects $# in string for formatting |
15:23:50 | Yardanico | but you would probably use strformat nowadays |
15:24:08 | Bevo | or use both |
15:26:17 | Bevo | anyway cheers...now I know how to concatenate a string and an int type |
15:28:34 | Yardanico | Bevo, well, techically you will concatenate string with string, but you'll convert int to string before that ;0 |
15:28:51 | FromGitter | <bevo009> yes, got it |
15:32:19 | * | ephja quit (Ping timeout: 260 seconds) |
15:33:26 | Bevo | is there a command to find out a variable's type, as in javascript's console.log(x, typeof x) |
15:34:33 | FromGitter | <kaushalmodi> @bevo009 https://scripter.co/notes/nim/#typetraits |
15:35:01 | FromGitter | <kaushalmodi> Assuming you are Bevo :) |
15:37:48 | Bevo | ahh that's it |
15:38:01 | Bevo | good man, I've been missing that |
15:38:25 | Bevo | that's the simplest way? nothing in system? |
15:40:02 | * | edcragg quit (Quit: ZNC - http://znc.in) |
15:40:19 | * | edcragg joined #nim |
15:40:32 | FromGitter | <kaushalmodi> I believe, there's an upcoming commit to devel to fix that.. @dom96 ? |
15:40:57 | Yardanico | Bevo, well, personally I don't really think that you need to echo types a lot |
15:41:11 | Yardanico | nim has a static type system after all |
15:41:39 | Bevo | well when you're learning, you want to know what's happening internally |
15:41:48 | FromGitter | <kaushalmodi> Yardanico: It's a great learning/code introspection tool |
15:41:49 | Bevo | you already know what's going on |
15:42:14 | FromGitter | <kaushalmodi> If you want to do "<foo> is <type>" base case statements, it's useful to know the exact type |
15:42:47 | FromGitter | <kaushalmodi> But in general being able to introspect the types gives me more confidence in the code |
15:43:01 | Yardanico | well, I use VSCode and I can easily see all the types :) |
15:43:18 | Yardanico | because you can get types via nimsuggest and Nim extension uses nimsuggest |
15:43:28 | FromGitter | <kaushalmodi> Example: Using typetraits, I could make this commit with confidence: https://github.com/kaushalmodi/nim-emacs-module/commit/2c36e0c754e2b318c6560c49507d6117221c4347 |
15:44:10 | * | find0x90 joined #nim |
15:44:17 | FromGitter | <kaushalmodi> Yardanico: For interactive use, I agree that nimsuggest, etc. are useful. But at times I disable it as it gets too sluggish. |
15:44:28 | Yardanico | well, that can be fixed :P |
15:48:56 | * | yglukhov[i] quit () |
15:51:48 | Bevo | echo $x.type |
15:51:57 | Bevo | that's what I was after...cheers |
15:52:19 | FromGitter | <mratsim> killall nimsuggest and killall nim are your friend |
15:54:19 | Bevo | @kaushalmodi is something like that getting included in system? |
15:55:20 | FromGitter | <xmonader> Hello guys I'm flattered that my book is mentioned in the nim survey. Hope we get great feedback, I submitted my feedback already :) |
16:00:36 | FromGitter | <kaushalmodi> @bevo009 See https://github.com/nim-lang/Nim/pull/7100. Hoping for that to get merged soon. |
16:02:49 | Bevo | "I don't want it in system.nim. Nor do I want people to echo types." |
16:03:09 | Bevo | I don't know if that's going through... |
16:03:49 | Bevo | I'd like it in system anyway, I'm used to that in javascript |
16:06:21 | * | cspar_ quit (Ping timeout: 260 seconds) |
16:06:53 | FromGitter | <kaushalmodi> Araq later mentioned somewhere in the IRC that he eventually approved this. Maybe I misunderstood.. he and @dom96 can confirm :) |
16:07:37 | * | Perkol quit (Quit: Leaving) |
16:08:44 | Bevo | Cool...does most of the new stuff in the devel version, make it into the next stable release? |
16:10:23 | Yardanico | Bevo, of course |
16:10:56 | Yardanico | Bevo, devel doesn't meant "a lot of bad features" |
16:11:07 | Bevo | a didn't say that |
16:11:24 | Bevo | features being tested |
16:11:25 | Yardanico | well, I mean that it's almost impossible that something added to devel will not make it to stable |
16:11:33 | Yardanico | all PRs are reviewed before merging to devel |
16:12:01 | Bevo | when is 1.9 scheduled for release? |
16:12:16 | Bevo | or whatever the next version number is |
16:12:27 | FromGitter | <kaushalmodi> At least for a non-advanced user like me, devel is *more stable* than stable 'D |
16:12:31 | federico3 | 0.19.0 ? |
16:12:38 | * | cmk_zzz quit (Ping timeout: 268 seconds) |
16:12:49 | Bevo | haha yeah that's what I meant |
16:13:01 | Bevo | we're not at 1.0 yest |
16:13:15 | Yardanico | @kaushalmodi I think that it's better to always use devel for now |
16:13:17 | Yardanico | before 1.0 :) |
16:13:18 | federico3 | Bevo: releases are never really scheduled. |
16:13:56 | Bevo | is there a usual period, like a few months between? |
16:13:59 | Yardanico | not really |
16:14:14 | Yardanico | bugfix releases can happen after a few weeks after a release |
16:15:30 | Bevo | so basically almost all new features in devel will get into the next stable release |
16:15:43 | Yardanico | Bevo, yes |
16:16:03 | Yardanico | I don't remember a situation when some feature was added to devel and didn't make it to stable |
16:16:18 | Bevo | excellent |
16:17:02 | Bevo | you need to install choosenim to get the devel release? |
16:17:11 | Yardanico | Bevo, not really |
16:17:20 | Yardanico | you can just compile devel with nim 0.18.0 |
16:17:28 | Yardanico | just clone nim repo and follow instructions from readme |
16:18:06 | Yardanico | there's a few breaking changes in current devel, biggest one is that you can't access null terminator in strings anymore |
16:18:16 | Yardanico | (you can see all big changes in changelog.md) |
16:20:20 | * | TheLemonMan joined #nim |
16:20:42 | TheLemonMan | dear #nim people, do you expect static: blocks to introduce their own scope? |
16:21:12 | FromGitter | <kaushalmodi> Bevo: Here's my Nim devel build script (M-x gist-buffer ;-)): https://gist.github.com/93c342b86ce38c6c3d79933b8af0d11d |
16:21:31 | Yardanico | @kaushalmodi hmm, seems to be a lot of lines :P |
16:21:47 | Yardanico | ah, you're making your own choosenim :D |
16:22:47 | FromGitter | <kaushalmodi> Yardanico: Its nim + nimpretty + web docs + whole kitchen sink :P |
16:23:29 | FromGitter | <kaushalmodi> I use GNU Stow for my package management, so the script respects that installation structure |
16:24:09 | FromGitter | <kaushalmodi> Using this I can install multiple versions of Nim on the same system (choosenim doesn't work on RHEL 6.6... there's an open issue for that) |
16:32:56 | shashlick | What's the issue on rhel |
16:34:52 | Yardanico | well, it's VERY old |
16:35:01 | Yardanico | @kaushalmodi are you using RHEL as your desktop system? |
16:35:52 | dom96 | TheLemonMan: Sure I guess |
16:36:11 | Yardanico | shashlick, RHEL 6.6 is based on Fedora 12 and Linux 2.6.32-504 |
16:36:31 | Yardanico | one solution would be to use musl with choosenim (to statically compile it) |
16:41:07 | FromGitter | <kaushalmodi> Yardanico: Not by choice as proprietary work software depends on that OS |
16:41:14 | Yardanico | ok then :( |
16:42:03 | FromGitter | <kaushalmodi> If anyone is knowledgeable musl stuff, the issue I referred to is this: https://github.com/dom96/choosenim/issues/15 |
16:46:41 | shashlick | So you are compiling from source right? |
16:48:29 | Yardanico | @kaushalmodi ah, yes, why wouldn't you just compile choosenim yourself? :D |
16:53:11 | FromGitter | <kaushalmodi> shashlick: Yes |
16:53:59 | FromGitter | <kaushalmodi> Yardanico: This script believe it or not is simple for me, than trying to read and understand choosenim, because it's the same bash script template I use for dozens of other software. |
16:55:57 | shashlick | Well I think it's more sensible to get choosenim into all the distros |
16:56:07 | shashlick | So you can apt or yum install |
16:56:17 | shashlick | Nim as well |
16:59:28 | FromGitter | <Varriount> Also, is choosenim on the website? |
16:59:52 | FromDiscord | <treeform> @dom96, good job on the BelFOSS 2018 presentation, just watched it, its the kind of thing we need to get nim out there. |
17:00:02 | dom96 | treeform: thanks! :) |
17:00:13 | FromGitter | <Varriount> @kaushalmodi Wow, you've been here for over a year? |
17:01:16 | * | cspar_ joined #nim |
17:06:21 | FromGitter | <kaushalmodi> @Varriount How did you tell? |
17:07:02 | FromGitter | <kaushalmodi> nvm, that issue I referred.. got it :) I was here about a year back.. but not active on IRC, and I had very sour experiences with Nim then. |
17:07:34 | FromGitter | <kaushalmodi> Then I left my attempts to learn Nim for a long time.. and since a month back, I am back :) |
17:07:51 | shashlick | Did you give your feedback on the survey? |
17:07:55 | FromGitter | <kaushalmodi> Yep |
17:09:51 | shashlick | Ok hope you feel more welcome now |
17:10:02 | shashlick | What's your main goal with learning Nim? |
17:10:39 | FromGitter | <kaushalmodi> goal 1 is not too big.. simply to stop using bash scripts |
17:10:41 | shashlick | Varriount: choosenim is still not on the http://Nim-Lang.Org website |
17:11:06 | FromGitter | <kaushalmodi> goal 2 is to interface Nim compiled .so with SystemVerilog (an ASIC design/verification language) |
17:11:08 | dom96 | it is, but only for Unix |
17:11:14 | shashlick | There's still several fixes I want to do in the whole installer space |
17:12:26 | shashlick | dom96: I didn't notice that |
17:14:52 | dom96 | I guess you're running Windows? |
17:16:03 | dom96 | so you never look under the Unix section |
17:16:08 | shashlick | Primarily, but also have a Linux box to dev and test |
17:16:27 | shashlick | Never looked at the Unix page |
17:17:28 | shashlick | Just built from scratch, also referred to the choosenim repo |
17:18:26 | shashlick | I mainly have seen complaints around installing on Windows so that's been my main focus |
17:26:33 | federico3 | TIL: shared compilation cache tool https://github.com/mozilla/sccache |
17:31:30 | * | Vladar joined #nim |
17:35:22 | * | nsf joined #nim |
17:46:22 | * | Death916 joined #nim |
17:47:11 | FromGitter | <kindlychung> is there something similar to python's `__file__`? |
17:48:25 | Yardanico | @kindlychung you want to get current filename? |
17:48:36 | Yardanico | name of the source file? |
17:48:49 | FromGitter | <kindlychung> yes. |
17:49:17 | Yardanico | you can use instantiationInfo().filename |
17:49:20 | Yardanico | what do you need this for? |
17:49:26 | dom96 | !eval echo(instantiationInfo().filename) |
17:49:29 | NimBot | ??? |
17:49:32 | Yardanico | ??? |
17:49:35 | dom96 | lol |
17:49:47 | dom96 | It should work in most cases, here are the docs https://nim-lang.org/docs/system.html#instantiationInfo, |
17:49:59 | Yardanico | dom96, wait what |
17:50:02 | FromGitter | <kindlychung> I want to get the directory of the source file, especially when `isMainModule` is true. |
17:50:05 | Yardanico | it doesn't work locally too |
17:50:25 | dom96 | Maybe it doesn't work in a glocal scope |
17:50:29 | FromGitter | <kaushalmodi> Yardanico: Works, I used it last week in that Emacs module Nim interface |
17:50:39 | Yardanico | dom96, ah, probably |
17:51:17 | FromGitter | <kaushalmodi> There, the use was in a var in a template |
17:53:52 | FromGitter | <kaushalmodi> .. it was in static: block |
17:55:12 | FromGitter | <kindlychung> @dom96 I got a ??? |
17:55:42 | dom96 | Try inside a procedure |
17:55:57 | Yardanico | yeah |
17:55:57 | dom96 | Pretty sure this is a bug though, someone report :) |
17:56:53 | FromGitter | <kindlychung> I just tried putting it in a main() proc, still the same. |
18:02:57 | * | cmk_zzz joined #nim |
18:08:12 | * | Trustable joined #nim |
18:09:26 | dom96 | strange |
18:09:42 | dom96 | hrm, maybe it's only available when an exception is raise |
18:09:44 | dom96 | d |
18:14:15 | elrood | apparently only available in templates. you could try currentSourcePath |
18:16:06 | * | wmclt joined #nim |
18:16:30 | * | captainbland joined #nim |
18:17:11 | FromGitter | <kindlychung> currentSourcePath also gives ??? |
18:18:42 | * | wmclt quit (Quit: Leaving) |
18:19:12 | FromGitter | <kindlychung> Ah, my bad, compiled the wrong file. currentSourcePath works. |
18:36:36 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
18:37:49 | * | dddddd joined #nim |
18:51:41 | * | jjido joined #nim |
19:05:27 | FromDiscord | <awr> how do you do elif in nim.cfg? is it `@elif x:` or `@else if x:` |
19:10:44 | Araq | „provides access to the compiler's instantiation stack line information of a template.“ |
19:11:28 | Araq | works as expected |
19:11:31 | * | Araq shrugs |
19:12:07 | Yardanico | ¯\_(ツ)_/¯ |
19:13:57 | FromGitter | <kaushalmodi> Reminds me of that Reddit bot :) |
19:14:20 | FromGitter | <kaushalmodi> Left arm: `\\\`: ¯\\\_(ツ)_/¯ |
19:14:58 | FromDiscord | <awr> i have some passC stuff i'm adding in my nim.cfg under `@if gcc or clang:` and `@elif vcc:` but the gcc/clang stuff keeps getting added when i set the compiler to vcc |
19:28:45 | captainbland | hey, anyone in here familiar with dts2nim? |
19:30:38 | * | zahary joined #nim |
19:32:59 | captainbland | or to be more specific, does anyone have any idea how to get it to produce something useful for functions which have an 'any' type result? If not, maybe I can just fork it and try and get something to work... |
19:35:38 | Yardanico | well, there's "any" type in Nim too |
19:38:21 | * | jjido quit (Ping timeout: 240 seconds) |
19:43:00 | captainbland | Yeah, I've seen that. I was kind of wondering if anybody was familiar and knew how to force it to map that to nim's any. |
19:43:44 | captainbland | but I think that might require modification. That being said, it seems that there is more type information here, so it might be worth seeing if I can get it to work properly. |
19:43:53 | Yardanico | well, chances are, if TypeScript code uses "any", this code won't work with nim |
19:44:11 | Yardanico | is dts2nim is for TS->Nim right? |
19:44:16 | captainbland | yeah that's right# |
19:45:01 | captainbland | Looking at some of the places it's seeing 'any', it looks like it might be ignoring the actual type information in this case |
19:47:56 | captainbland | Like it seems to be reducing a function that returns a type based off of this: export interface Simulation<NodeDatum extends SimulationNodeDatum, LinkDatum extends SimulationLinkDatum<NodeDatum> | undefined> |
19:47:58 | captainbland | to 'any' |
19:49:10 | captainbland | I guess maybe there's a simplification of that that the tool would look better. I'll play around with that for a bit |
19:49:18 | captainbland | *like better |
19:55:36 | captainbland | Ah, right I see. This was never going to work because the tool doesn't support generics. Heh |
20:00:20 | * | PMunch joined #nim |
20:22:27 | Yardanico | hmm https://github.com/nim-lang/Nim/issues/8111 |
20:22:37 | Yardanico | "Neil Hodgson, the head of Scintilla, states that submitting and updating lexers is the sole responsibility of the contributor. So, we can't expect him to update it himself." strange philosophy |
20:31:19 | captainbland | I guess they don't think they have the people to maintain all the languages it supports |
20:32:31 | * | yglukhov[i] joined #nim |
20:33:45 | * | yglukhov[i] quit (Client Quit) |
20:37:59 | FromGitter | <alehander42> well it's not strange indeed, it's like expecting sublime authors to maintain all the lang plugins |
20:39:10 | FromGitter | <alehander42> @captainbland you can use `js` type for `any` in some cases |
20:39:24 | Yardanico | but by this statement he means that we can't update lexers |
20:39:28 | Yardanico | only the creator of a lexer can |
20:40:20 | FromGitter | <mratsim> yeah his statement is like only the original contributor or himself can update a lexer |
20:40:45 | FromGitter | <alehander42> the `js` type, you can also fork it of course and add support |
20:43:46 | * | Trustable quit (Remote host closed the connection) |
20:44:06 | captainbland | @alehander42 - Thanks, I'll take a look at that |
20:49:42 | * | nsf quit (Quit: WeeChat 2.1) |
21:01:20 | * | elrood quit (Quit: Leaving) |
21:01:48 | * | hutfolk joined #nim |
21:07:16 | FromGitter | <kindlychung> what is the state of desktop gui for nim? |
21:08:44 | Yardanico | there's IUP, qml, NiGui, high-level gtk3 bindings, libui bindings, wxwidget bindings |
21:11:02 | * | zahary quit (Quit: Leaving.) |
21:12:17 | * | hutfolk quit (Quit: Mutter: www.mutterirc.com) |
21:14:48 | * | brainproxy quit (Ping timeout: 268 seconds) |
21:15:05 | FromGitter | <kindlychung> recommend-ability in that order? :) |
21:15:32 | * | brainproxy joined #nim |
21:21:38 | Yardanico | not really |
21:22:00 | Yardanico | they're in "which one is faster to remember" order :P |
21:36:20 | * | rockcavera joined #nim |
21:46:33 | * | cspar_ quit (Ping timeout: 264 seconds) |
21:52:46 | * | Vladar quit (Quit: Leaving) |
21:55:06 | * | cspar_ joined #nim |
21:55:31 | * | hutfolk joined #nim |
21:58:17 | * | hutfolk quit (Client Quit) |
21:58:56 | shashlick | Pick an app you like, find out which GUI toolkit it uses, use it |
21:59:30 | shashlick | Every single GUI toolkit starts as a simple abstraction and grow from there into a full fledged ecosystem |
22:04:39 | shashlick | I don't think GUI making is a fun endeavor |
22:04:55 | * | hutfolk joined #nim |
22:14:44 | * | hutfolk quit (Quit: Mutter: www.mutterirc.com) |
22:19:24 | * | hutfolk joined #nim |
22:22:11 | * | hutfolk quit (Client Quit) |
22:22:35 | * | hutfolk joined #nim |
22:23:44 | * | captainbland_ joined #nim |
22:26:05 | * | hutfolk quit (Client Quit) |
22:26:35 | * | captainbland quit (Ping timeout: 240 seconds) |
22:28:14 | * | PMunch quit (Quit: leaving) |
22:58:10 | * | find0x90 quit (Ping timeout: 245 seconds) |
22:58:37 | * | find0x90 joined #nim |
23:20:03 | * | cspar_ quit (Ping timeout: 256 seconds) |
23:23:21 | FromDiscord | <treeform> I am working on a GUI system right now. |
23:25:06 | FromDiscord | <treeform> I feel like GUI systems need a drag and drop editor. Everything ART like does, 3d - there are editor, 2d - there are photoshop and stuff, sound, there are sound editors... |
23:25:30 | FromDiscord | <treeform> but for UI people opt out to do text stuff? with crappy formats like XML why... |
23:26:21 | FromDiscord | <treeform> Also I really like immediate mode programming style for UI. I been using a pseudo immediate mode UI system for about 4 years? |
23:26:25 | FromDiscord | <treeform> Also I really like immediate mode programming style for UI. I been using a pseudo immediate mode UI system for about 4 years. |
23:26:28 | FromDiscord | <treeform> And I really like it. |
23:26:56 | FromDiscord | <treeform> I am trying to figure out how to merge an Editor and immediate mode UI. |
23:31:21 | shashlick | Nice |
23:31:32 | shashlick | Do you have anything posted online? |
23:34:32 | * | themagician_k joined #nim |
23:35:12 | FromDiscord | <treeform> Not it still kind of sux |
23:36:01 | * | themagician quit (Ping timeout: 248 seconds) |
23:36:14 | shashlick | I'm going to attempt wrapping xamarin forms when I get a chance |
23:37:44 | FromDiscord | <treeform> c#? |
23:40:01 | shashlick | Yep |
23:40:16 | shashlick | You can generate c headers apparently |
23:40:30 | shashlick | https://github.com/mono/Embeddinator-4000 |
23:42:22 | FromGitter | <Varriount> Yay! My Nim shell executed its first command! |
23:43:09 | FromGitter | <ephja> was it sl? |
23:43:51 | FromGitter | <Varriount> Nope, the first command was `nim --help` |
23:52:36 | FromGitter | <kayabaNerve> sl or ls ? |
23:53:40 | FromGitter | <Varriount> @kayabaNerve Now I need to implement variable interpolation. That will be interesting. |
23:54:48 | FromGitter | <ephja> steam locomotive |
23:56:49 | shashlick | Will it work on Windows? |
23:57:06 | FromGitter | <Varriount> It should. It only uses standard library components. |
23:58:00 | FromGitter | <Varriount> So it's more of a "learn how a shell is put together", rather than "built a bash clone" |
23:59:25 | * | NimBot joined #nim |