<< 07-09-2017 >>

00:01:05*yglukhov joined #nim
00:04:07*couven92 quit (Quit: Client Disconnecting)
00:05:27*yglukhov quit (Ping timeout: 260 seconds)
00:08:41*Matthias247 quit (Read error: Connection reset by peer)
00:14:12*gokr quit (Ping timeout: 260 seconds)
00:21:23*thomasross joined #nim
00:22:21*arnetheduck joined #nim
00:23:09*thomasross_ quit (Ping timeout: 252 seconds)
01:22:54*Jesin quit (Quit: Leaving)
01:39:05*chemist69 quit (Ping timeout: 246 seconds)
01:50:19*Jesin joined #nim
01:52:59*chemist69 joined #nim
01:58:11*relax joined #nim
02:02:08*yglukhov joined #nim
02:07:27*yglukhov quit (Ping timeout: 248 seconds)
02:11:55*Tanger quit (Quit: BAI BAI)
02:16:18*Tanger joined #nim
02:35:30*dddddd quit (Remote host closed the connection)
02:45:26relaxwhat's the best way to do endian-aware file IO?
02:45:51relaxthe streams module doesn't seem to be configurable; looks like it always writes in the native endian order
03:15:01*skrylar quit (Ping timeout: 240 seconds)
03:45:33*BitPuffin|osx quit (Ping timeout: 252 seconds)
04:02:59*def-pri-pub joined #nim
04:02:59*def-pri-pub quit (Client Quit)
04:12:59*haha_ joined #nim
04:19:15*Sembei joined #nim
04:19:27*thomasross_ joined #nim
04:19:54*pigmej quit (Ping timeout: 248 seconds)
04:20:25*pigmej joined #nim
04:21:51*thomasross quit (Ping timeout: 248 seconds)
04:21:52*Pisuke quit (Ping timeout: 248 seconds)
04:22:42*gmpreussner quit (Ping timeout: 260 seconds)
04:25:44*gmpreussner joined #nim
04:27:40*rauss joined #nim
04:28:34*Tanger quit (Ping timeout: 240 seconds)
04:30:41*BigEpsilon joined #nim
04:32:32*BigEpsilon quit (Remote host closed the connection)
04:33:00*BigEpsilon joined #nim
04:35:59*haha_ quit (Quit: haha_)
04:36:05*Sembei quit (Ping timeout: 240 seconds)
04:38:06*Sembei joined #nim
04:47:47*cspar_ quit (Ping timeout: 260 seconds)
04:48:04*relax quit (Ping timeout: 240 seconds)
04:58:14FromGitter<Varriount> relax: you'll need to convert the input you the steam.
05:00:59*mahmudov quit (Remote host closed the connection)
05:05:37*yglukhov joined #nim
05:09:06*cspar_ joined #nim
05:09:51*yglukhov quit (Ping timeout: 248 seconds)
05:21:43*miran joined #nim
05:28:51*endragor joined #nim
05:31:43*miran quit (Ping timeout: 248 seconds)
05:36:12*BigEpsilon quit (Ping timeout: 260 seconds)
05:45:34*miran joined #nim
06:05:52*MagpieMcGraw joined #nim
06:06:13MagpieMcGrawHelloĄ
06:06:37*BigEpsilon joined #nim
06:06:40MagpieMcGrawI need a little help getting nim to work on 32 bit windows.
06:07:01*miran quit (Ping timeout: 240 seconds)
06:07:41*endragor quit (Remote host closed the connection)
06:13:43MagpieMcGrawI downloaded the 32 bit zip and the nim compiler seems to work. But none of the executables that were in the zip work
06:13:55MagpieMcGrawthat means I can't use nimble or koch or any of those things
06:15:34*der quit (Remote host closed the connection)
06:16:33*derlafff joined #nim
06:17:00*couven92 joined #nim
06:21:02AraqMagpieMcGraw: known problem, will be gone with today's release. workaround: nim c koch
06:21:06Araqkoch nimble
06:21:28Araqyou have a working 'nim.exe' that's all you need really
06:22:45couven92Araq: good morning! :) Saw my fix for yesterday? (https://github.com/nim-lang/Nim/issues/6342)
06:23:01Araqindeed
06:23:06Araqfoo=
06:23:12Araqlooks so strange :P
06:23:24couven92Yeah! :D But I assign to it conditionally later
06:23:46couven92so, I thought it best to have it there, just to say, this might get a value later during the script
06:24:56couven92But, if I havent f***ed up anything else lately, we should be good to go to another releease today?
06:25:29MagpieMcGrawokay, now I have succesfully ivoked nimble.exe. Thanks so muchĄ
06:25:54*endragor joined #nim
06:26:29couven92Is it just me, or do the lines from MagpieMcGraw end with a weird UTF-8 rune? Ą
06:27:31MagpieMcGrawsorry that's my bad I was trying to do an exclamation point but I'm on a non-english keyboard
06:32:39*nsf joined #nim
06:35:16couven92Araq, what about our pet-project unicode.editDistance... it's ready now... I had some further optimizations in mind, but haven't gotten round to actually implementing those... if you'd like to review?
06:35:47couven92The PR details my train of thought
06:39:43Araqbugfix releases do not need new features
06:39:51Araqyour PR will be merged after 0.17.2
06:40:44couven92Yes of course, right... okay, then we'll talk about that later :)
06:41:23*Vladar joined #nim
06:50:34FromGitter<Grabli66> When will be a debuging nim code in VSCode? :)
06:50:43*rokups joined #nim
07:02:10*MagpieMcGraw quit (Quit: Leaving)
07:02:24FromGitter<BigEpsilon> @Araq, I add the support for includes expansion for the reorder pragma. Now your wxWidget wrapper compiles with reorder insteed of nofroward.
07:02:27FromGitter<mratsim> There is already gdb integration, so it might be possible to leverage that. (I managed to debug and use breakpoints in a React-native (Typescript) codebase compiled to React-native JS, and then run on Iphone VM)
07:03:08FromGitter<BigEpsilon> I was alos able to compile the nim compiler with reorder enabled (I enabled it in "passes")
07:03:14FromGitter<BigEpsilon> It compile successfuly
07:04:01FromGitter<BigEpsilon> but when I trie to compile another program, I get the following error: lib/system.nim(1455, 50) Error: invalid pragma: compilerRtl
07:06:07FromGitter<BigEpsilon> I'll have to investigate why
07:06:29*PMunch joined #nim
07:06:50FromGitter<BigEpsilon> But you have any idea I'm all listening
07:12:08*Arrrr joined #nim
07:12:59*cspar_ quit (Ping timeout: 246 seconds)
07:17:10*Arrrr quit (Ping timeout: 255 seconds)
07:23:01*claudiuinberlin joined #nim
07:25:31Araqwell compilerRtl is a user defined pragma
07:25:50Araqwhich we do not yet consider in the reorder pass at all, good catch
07:26:01*Arrrr joined #nim
07:26:58Araqawesome that it works for the whole compiler! :D
07:33:50*BitPuffin|osx joined #nim
07:34:29FromGitter<BigEpsilon> yes indeed :)
07:34:49FromGitter<BigEpsilon> I'll see what I can do for the user defined pragmas
07:36:55Araqwatch out for the "pragma" pragma
07:37:03Araqthat's the only one that can define a new pragma
07:37:32couven92whaaaat???? `vswherepkg\setup_configuration.nim(189, 28) Error: can raise an unlisted exception: Exception`
07:37:53couven92adding `{.raises: [Exception].}` does not work
07:38:11*gokr joined #nim
07:38:42couven92why do I get this error, and how do I fix it?
07:40:56*endragor quit (Remote host closed the connection)
07:44:39FromGitter<BigEpsilon> @Araq , ok
07:46:51couven92ah!
07:46:56couven92found it :)
07:49:43*yglukhov joined #nim
07:53:53Araqwhat was it?
07:53:55*endragor joined #nim
07:54:01Araqthese error messages need to be improved
07:54:09*yglukhov quit (Ping timeout: 248 seconds)
07:54:15couven92Araq, it was calling another proc without raises annotation
07:54:30Araqso?
07:54:52*Andris_zbx joined #nim
07:54:52couven92so the proc where the error occurred had a raises annotation
07:55:30couven92I just didn't realize this immediately, since the proc I am calling is actually a function pointer in a struct
07:58:04*endragor quit (Ping timeout: 240 seconds)
07:59:14Araqdid it point to the appropriate line or not?
08:00:39couven92Araq, it pointed to where I invoked the non-annotated proc, but "can raise an unlisted exception: Exception" was a bit misleading...
08:01:23couven92or rather the "Exception" at the end was misleading... it led me to believe I had to add `{.raises: [Exception].}` to my proc
08:02:41Araqok
08:05:11*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:06:21*claudiuinberlin joined #nim
08:06:37*claudiuinberlin quit (Client Quit)
08:12:50FromGitter<mratsim> So now static has received so many fixes that you can use it to fight bugs: https://github.com/nim-lang/Nim/issues/6343
08:14:28*endragor joined #nim
08:16:15*Matthias247 joined #nim
08:18:39*endragor quit (Ping timeout: 248 seconds)
08:21:09ArrrrWe are living in the best timeline.
08:24:13*Cranberry joined #nim
08:24:19CranberryGuys, i'm sorry, i ended up choosing Nim, i am too lazy to learn Rust. Hope Nim becomes 1.0 soon. I am Cider :D idc if you ban me, you can't stop me from to learn Nim :P
08:26:17couven92If I need to pass a C-array-pointer to an importc-proc, I should pass the address of the 0th element in an initialized seq, right?
08:27:44Cranberryi don't know
08:28:42Cranberrycya
08:28:44*yglukhov joined #nim
08:28:52*Cranberry quit (Quit: Bye)
08:29:19ArrrrYeah, addr(seq[0]). Maybe you have to cast ptr, depending on the signature
08:29:24*yglukhov quit (Remote host closed the connection)
08:29:37*yglukhov joined #nim
08:29:55couven92Arrrr, right... thx! :)
08:31:27*Matthias247 quit (Read error: Connection reset by peer)
08:34:13Araqsometimes it's unsafeAddr(s[0])
08:36:38couven92Araq, in case of a let?
08:38:18*krux02 joined #nim
08:38:47FromGitter<mratsim> yes
08:39:16FromGitter<mratsim> addr only works for var or ref
08:41:15krux02whichlist: I wish that porting this to nim https://golang.org/pkg/math/bits/ is as easy as it is in go 
08:42:32cremI hope nim won't become 1.0 soon! I
08:43:02FromGitter<Grabli66> I hope nim become 1.0 soon! I
08:43:37cremIt would be like prison architect. While it was alpha it was a good game.
08:47:05FromGitter<k0pernicus> I hope nim become 1.0 soon too! :-)
08:47:27krux02well I have my doubt it will become 1.0 soon
08:48:51FromGitter<k0pernicus> (The trick here is it depends what you mean by “soon” ;-) )
08:49:30FromGitter<Grabli66> In this year :)
08:50:25FromGitter<Grabli66> That's the problem? Change version to 1.0 and push to github :)
08:50:25FromGitter<k0pernicus> 4 months to release a stable and “fully” tested version… Not impossible, but hard work
08:50:35krux02Well there is one thing I really wish for nim, before it goes to version 1.0
08:50:55krux02make nim suitable for C library development.
08:51:07federico3+1 krux02 !
08:51:13FromGitter<k0pernicus> I agree
08:51:27krux02like c++ is already
08:51:45federico3it would be an advantage over other languages
08:51:46krux02when a library has a C API people don't care if it uses c++ internally
08:51:49krux02I want the same for Nim
08:53:23FromGitter<BigEpsilon> @krux02 , +1000
08:54:52Araqkrux02: you will be pleased by my plans then...
08:55:31Araqbut there are more for a Nim version 2
08:55:37Araq*they
08:56:12FromGitter<BigEpsilon> pls can you tell us more about it ?
08:57:04AraqNim v2 will get assignment operators and destructors much like C++, atomic RC will be done for 'ref' plus an optional cycle collector but this will most likely require explicit traceRoot(x) calls to break up cycles
08:57:20federico3and perhaps merging async and non-async procs
08:58:12Araqstrings and seqs stay as they are (they never required GC) conceptually but will get a different implementation
08:59:09FromGitter<BigEpsilon> So you have plans to better support nogc libraries like they are doing with D
08:59:37FromGitter<k0pernicus> (@krux02 If you are working to port the Golang bits lib to Nim, please to inform us :-) I am very interested in porting/testing this lib)
08:59:41Araqthat's not comparable
09:00:41*claudiuinberlin joined #nim
09:01:28Araqmy plan is mostly about changing the implementation, the concepts of refs vs ptrs etc stay the same and the library continues to work like it does, except for the better "close" support since it's based on a deterministic MM scheme
09:03:22Araqmy only fear is that will be too slow... atomic ops everywhere can't be good. though for performance we'll have memory pools
09:05:25Araqanyway, the way C++ does it is the only way that composes well, data structures work with safe/unsafe pointers, files are closed on scope exit, etc
09:08:46FromGitter<BigEpsilon> Coming from C++, I often miss RAII when using GCed language implementations
09:10:09Araqno cheers for my plans, krux02? :-)
09:12:52couven92Araq, if I pass a seq as an array pointer to an importc-proc that is going to fill it... should I initialize with newSeqOfCap and then use setLen after the importc call?
09:13:13couven92or does setLen zero the seq contents?
09:13:43krux02couven92: the new elements, yes
09:14:06krux02Araq: I was afk for a few minutes, getting tea :P
09:14:38couven92krux02, my importc function takes to additional parameters: the capacity, and a out variable that returns the number of elements written
09:15:10Araqcouven92: depends on the API, newSeq(length) can also be fine
09:15:32couven92yeah, but I don't know how many items will be returned
09:16:44couven92doing newSeqOfCap has the advantage that I don't have to clean up anything in case of an error, since the len(seq) is 0
09:16:49krux02Araq: I have to say I am not 100% sure how to understand your plan
09:19:45krux02well yes, I agree on your plan
09:19:58krux02basically it is what I imagined too.
09:21:59krux02well strings and seq will not stay exactly as they are, you already mentioned that they will be empty instead of nil on initialization.
09:22:38*PMunch quit (Read error: Connection reset by peer)
09:22:50*PMunch joined #nim
09:23:43krux02And last but not least, I really think it should be possible to pass a subsequence as an openarray
09:24:01krux02it's trivial in C but not so much in Nim
09:26:36Araqsystem.slice lets you do that but is underdeveloped
09:26:46Araqin fact, I only tested it within 'parallel'
09:29:18krux02that is good to hear that there is at least something already
09:29:27krux02I thought it was completely forgotting
09:35:40*haha_ joined #nim
09:55:46*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:57:31*claudiuinberlin joined #nim
09:57:52*Matthias247 joined #nim
09:58:24*nattefrost joined #nim
10:01:53*Matthias247 quit (Read error: Connection reset by peer)
10:08:04*PMunch quit (Ping timeout: 240 seconds)
10:09:47*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:10:09*PMunch joined #nim
10:10:52*claudiuinberlin joined #nim
10:11:41*claudiuinberlin quit (Client Quit)
10:15:33*dddddd joined #nim
10:15:41*claudiuinberlin joined #nim
10:16:04FromGitter<Bennyelg> @Yardanico Sup
10:16:22FromGitter<Bennyelg> Just saw you library nimpylib, you are crazy, what an excellent job!
10:26:27*ShalokShalom_ joined #nim
10:29:01*ShalokShalom quit (Ping timeout: 240 seconds)
10:32:59*vlad1777d joined #nim
10:40:36*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:43:29*claudiuinberlin joined #nim
10:53:37*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:54:29*claudiuinberlin joined #nim
10:57:53FromGitter<Bennyelg> Guys, ⏎ Help please, Im trying to do someting simple. ⏎ I have Table[string, string] And I want to fetch only the keys() which will result a seq[string] with all the keys() but Its not working and throw me "Attempting to call undecleard routine
10:58:52FromGitter<Bennyelg> BUT, if Iam running using for loop I can append each key to the array
10:59:29FromGitter<Bennyelg> ``` s.add(k)```
10:59:50FromGitter<Bennyelg> this will work, but var s = prettyTable.keys() doesnt
11:01:36*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:02:40def-keys is an inline iterator
11:02:53FromGitter<Bennyelg> I saw that, how do I convert it to seq
11:03:00FromGitter<Bennyelg> or any other way to do so
11:03:01def-strutils.toSeq
11:03:08FromGitter<Bennyelg> tried that
11:03:08def-sequtils*
11:03:28FromGitter<Bennyelg> myPrettyTable.keys().toSeq
11:03:34FromGitter<Bennyelg> not work
11:04:59def-toSeq(myPrettyTable.keys())
11:05:46FromGitter<Bennyelg> Not work
11:06:36def-works for me: https://gist.github.com/def-/4ab840ae6db77d27b2c6ad92508ba4ad
11:06:52FromGitter<Bennyelg> your solution work on the nim-play but it doesnt on mine :|
11:07:04FromGitter<Bennyelg> Maybe version problem?
11:07:13def-current nim devel branch
11:07:46*mjanssen joined #nim
11:08:01FromGitter<Bennyelg> Sec I'll check
11:09:04FromGitter<Bennyelg> Nim Compiler Version 0.17.0 (2017-05-18) [MacOSX: amd64] ⏎ Copyright (c) 2006-2017 by Andreas Rumpf ⏎ ⏎ active boot switches: -d:release -d:useLinenoise [https://gitter.im/nim-lang/Nim?at=59b128d0bc4647297406c03e]
11:09:29def-should be 0.17.2
11:09:46FromGitter<Bennyelg> I use brew to install it on mac
11:10:26def-you can compile your own from github
11:10:32FromGitter<Bennyelg> :( Error: nim 0.17.0 already installed the feature is entered only from 0.17.2?
11:10:36FromGitter<Bennyelg> U will now
11:10:40FromGitter<Bennyelg> I*
11:14:20FromGitter<Bennyelg> ➜ csources git:(master) sh build.sh ⏎ uname: illegal option -- o ⏎ usage: uname [-amnprsv]
11:15:12FromGitter<Bennyelg> or sorry
11:15:15FromGitter<Bennyelg> my bad :D
11:18:19*Yardanico joined #nim
11:18:28FromGitter<Bennyelg> nop I thougt I was wrong but this is problem
11:19:23FromGitter<Yardanico> it's fixed in devel
11:19:32FromGitter<Yardanico> hi btw
11:19:56*Matthias247 joined #nim
11:20:17FromGitter<Yardanico> https://github.com/nim-lang/Nim/commit/811fbdafd958443ddac98ad58c77245860b38620
11:21:29FromGitter<Bennyelg> but I just cloned the delvel
11:21:50FromGitter<Bennyelg> commit 811fbdafd958443ddac98ad58c77245860b38620 ⏎ Author: Fredrik Høisæther Rasch <[email protected]> ⏎ Date: Thu Sep 7 08:29:38 2017 +0200 ⏎ ⏎ ```Revert usage of non-standard `uname -o` command in build.sh (#6342)``` [https://gitter.im/nim-lang/Nim?at=59b12bce8f4427b462e0485b]
11:22:04FromGitter<Bennyelg> this is from my git log
11:22:43FromGitter<couven92> you'll have to run `koch csources`
11:23:02FromGitter<Bennyelg> where
11:23:12couven92from the nim main repo root
11:23:36FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b12c38c101bc4e3a9c5e68]
11:23:41couven92that will place the sources into the build folder...
11:24:05FromGitter<couven92> ah! run `nim c koch`
11:24:13FromGitter<Bennyelg> thanks
11:25:28FromGitter<Bennyelg> after the `koch csources` I still need to run the build.sh ?
11:25:59FromGitter<couven92> and then `./koch csources` ⏎ and then ⏎ ⏎ ```cd build ⏎ sh ./build.sh ⏎ cd .. ⏎ bin/nim c koch ⏎ ./koch boot``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=59b12cc766c1c7c47724d5be]
11:26:50FromGitter<Bennyelg> koch csources failed ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b12cfabc4647297406d2ee]
11:27:33FromGitter<couven92> huh... that's not good...
11:27:36FromGitter<Bennyelg> lol
11:27:38def-try just ./koch boot -d:release
11:27:38FromGitter<Bennyelg> :D
11:27:58couven92ah, right! of course, yes, def- is right!
11:27:59FromGitter<Bennyelg> I see thats not Good :)
11:28:31FromGitter<Bennyelg> I'm starting to learn nim in my university
11:28:55FromGitter<Bennyelg> as an instructor to industrial Engineers students
11:29:11couven92Arrrr, Araq: I have an importc-proc that returns an array pointer (and a length) to me... What type does it get in Nim? just a pointer? how do I iterate over it?
11:29:25FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b12d95ee5c9a4c5f41a65d]
11:29:26Araqptr UncheckedArray[T]
11:29:33FromGitter<Bennyelg> what a mess
11:29:36couven92Ah! :)
11:34:07couven92Araq, in which module is UncheckedArray?
11:34:58ArrrrI don't know how choosenim works, i always use https://github.com/nim-lang/Nim/#compiling
11:36:13couven92ah, okay got it: https://nim-lang.org/docs/manual.html#foreign-function-interface-unchecked-pragma
11:39:35ArrrrI think UncheckedArray was added recently
11:39:52Yardanicocouven92, in system
11:39:59Yardanicoah no
11:40:01FromGitter<Bennyelg> donnu cant build it
11:40:08YardanicoBennyelg: clone fresh nim repo
11:40:12Yardanicofrom scratch
11:40:17FromGitter<Bennyelg> This is what I did
11:40:26Yardanicodid you also remove your nim installation?
11:40:36FromGitter<Bennyelg> I did just brew uninstall nim
11:40:57YardanicoArrrr, UncheckedArray is not exported
11:41:07Yardanicoit's in system.nim, but you can't use it
11:41:15ArrrrWhy not? is public
11:41:21YardanicoArrrr, ah yes
11:41:27ArrrrMaybe i'm looking at an old commit
11:41:34Yardanicononono you're right
11:41:43ArrrrIs defined liked this `UncheckedArray* {.unchecked.}[T] = array[0, T]`
11:41:53Yardanicoyes
11:46:40FromGitter<Bennyelg> this is so frustrating lol
11:46:58Yardanicowell I've never encountered any issues lol
11:47:41*dddddd quit (Ping timeout: 240 seconds)
11:48:14FromGitter<Bennyelg> you got a mac ?
11:48:47YardanicoI have a hackintosh on my pc, it's sierra 10.12.6, so basically yes :)
11:48:50Yardanicoand nim works here too
11:48:59*cspar_ joined #nim
11:49:38FromGitter<Bennyelg> strage, if I build it myself, How come it need choose nim
11:49:40FromGitter<Bennyelg> donnu
11:49:49Yardanicoit doesn't need it
11:49:51*endragor joined #nim
11:50:29Yardanicochoosenim is a relatively new thing
11:51:10FromGitter<Bennyelg> I choose my desired directory.
11:51:14FromGitter<Bennyelg> I run git clone
11:51:26FromGitter<Bennyelg> I git clone --depth 1 the csources
11:51:49FromGitter<Bennyelg> run nim c koch
11:51:52*endragor quit (Remote host closed the connection)
11:51:56Yardanicowhy are you copy-pasting commands?
11:52:00Yardanicono
11:52:03Yardanicoyou're wrong
11:52:08Yardanicoyou firstly need to build nim from csources
11:52:13*ajusa joined #nim
11:52:13FromGitter<Bennyelg> Can't
11:52:14Yardanicoyou don't need to run "nim c koch"
11:52:22FromGitter<Bennyelg> it's doesnt work
11:52:22Yardanicoif you have nim or choosenim installed - remove them
11:52:30Yardanicofully remove them
11:52:45ajusaOkay, here is a stupid question: How do I create a nested sequence of type "seq[seq[float]]"?
11:52:47FromGitter<Bennyelg> I did
11:53:12Yardanicoajusa, why do you mean by "Create"?
11:53:18Yardanicojust create it as any other sequence
11:53:23FromGitter<Bennyelg> Yaaa ITS WORKING
11:53:25FromGitter<Bennyelg> thanks.
11:53:33ajusaBasically I want a two dimensional sequence
11:53:34cremajusa: = @[] ?
11:53:49ajusaI tried this: newSeq[seq[float]]
11:54:00FromGitter<Bennyelg> var x: seq[seq[string]] = @[]
11:54:21Yardanicoajusa, not like this
11:54:26Yardanicolike this: var a = newSeq[seq[float]]()
11:54:32Yardanicoyou've forgotten about () :)
11:54:51ajusaoh right xD
11:55:13Arrrrcan't you create one with size w * h ?
11:55:22YardanicoArrrr, yeah, basically a grid
11:55:29Yardanico+1 from me :)
11:55:43FromGitter<Bennyelg> @Yardanico what after csource finished
11:55:49Yardanicocd ..
11:55:53Yardanicobin/nim c koch
11:55:56ajusaYES THANK YOU ALL OF MY CODE WORKS NOW :D
11:56:21FromGitter<Bennyelg> Enjoy, and hang around
11:56:41*endragor joined #nim
11:58:15FromGitter<Bennyelg> After bin/nim c koch what now
11:59:11Yardanico./koch boot -d:release
11:59:26FromGitter<Bennyelg> So freaking funny. ⏎ I did ./koch boot -d:release
11:59:57FromGitter<Bennyelg> Done succesffuly
12:00:00Yardanicothen you have newest nim
12:00:05Yardanicoin bin folder
12:00:05Yardanicotry
12:00:08Yardanicobin/nim -v
12:00:22FromGitter<Bennyelg> But why i still get ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b134d69acddb240711018b]
12:00:47Yardanicobecause you didn't fully remove choosenim!
12:00:49Yardanicoas I said!
12:00:56FromGitter<Bennyelg> I did lol I dont know where else
12:01:07Yardanicorm -rf ~/.choosenim
12:01:10FromGitter<Bennyelg> if i run from bin/nim all work
12:01:12FromGitter<Bennyelg> I did lol
12:01:13*dddddd joined #nim
12:01:16Yardanicorm -rf ~/.nimble/bin
12:01:27*claudiuinberlin joined #nim
12:01:35FromGitter<Bennyelg> Done
12:01:37FromGitter<Bennyelg> fantastic
12:01:42FromGitter<Bennyelg> the nimble is what I missed.
12:01:44Yardanicoand after you delete it, add your "bin" folder to your PATH
12:01:46FromGitter<Bennyelg> thanks
12:01:50FromGitter<Bennyelg> I did :)
12:05:09Yardanicoajusa, also: about multidimensional seqs: https://play.nim-lang.org/?gist=a7cccf467fb0f2e8f71f7d5b5c2d52f2
12:05:23Yardanicoalso it's requires no reallocations since the size of grid is known
12:05:30Yardanicoonly 1 allocation
12:05:49Yardanicoand you need only 1 seq
12:06:20ajusahuh, thats pretty cool
12:07:08*haha_ quit (Quit: haha_)
12:07:11Yardanicobut yeah, it requires one mul and one add operation!
12:07:17Yardanicofor accessing right index :P
12:07:36FromGitter<Bennyelg> vs code crying :d ⏎ No 'nim' binary could be found in PATH environment variable ⏎ Any quick tip?
12:07:51Yardanicoyes
12:09:17YardanicoBennyelg: https://serverfault.com/a/277034
12:09:18*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:09:29Yardanicoand then relogin
12:09:40Yardanicoor maybe reboot, IDK
12:10:10Yardanicoajusa, you can even create a grid of array instead of seq if you know exact grid size at compile time
12:10:22Yardanicoit would be more performant i think
12:11:19ajusaPerformance doesn't really matter for this bit. I am just reading a static table into nim, and doing lookups not very often
12:11:25ajusaBut I will keep it in mind :D
12:11:38ajusaHow do I get the name of a tag when parsing xml?
12:12:19ajusahttps://play.nim-lang.org/?gist=070bea801e346236f3df9f48c79ad577
12:12:42Yardanicoajusa, https://nim-lang.org/docs/xmltree.html#tag,XmlNode ?
12:12:59Yardanicomaybe you can try renaming your "tag" here?
12:13:15Yardanicomaybe nim doesn't like things like "tag.tag"
12:14:20ajusamaking it thing.tag didn't help lol. Error: unhandled exception: n.k == xnElement [AssertionError]
12:14:51Yardanicowell you're trying to get a tag of something which isn't an element
12:14:59Yardanicoerror is pretty clear here
12:15:58ajusaYeah... But I think everything is an element. Unless I am misunderstanding the way Nim gets elements. Let me share the xml file
12:16:33Yardanicono
12:16:38Yardaniconot everything is an lement
12:16:40Yardanicoelement
12:16:43ajusahttps://pastebin.com/kgc58iH9
12:16:59Yardanicook
12:17:01ajusaAs in, everything in my xml file should be an element
12:17:03Yardanicowhat do you want to get?
12:17:24ajusaI want a for loop that loops over each element and returns the tag name
12:17:33Yardanicofor each time or space?
12:17:35ajusa*each parent element
12:18:04ajusaIn this case, I should get just one tag: space
12:18:40*claudiuinberlin joined #nim
12:18:49ajusathen, I can do .items to get children of that and parse it recursively
12:19:17*cspar_ quit (Ping timeout: 260 seconds)
12:19:58ajusaoh im dumb
12:20:04ajusaif $thing.kind == "xnElement":
12:20:12ajusaI should have checked if it was an element
12:20:17Yardanicoehm
12:20:17ajusaNever mind, I got it
12:20:18Yardanicoalso
12:20:23Yardanicoif thing.kind == xnElement
12:20:26Yardanicoyou don't need to use $ here
12:20:35ajusaIt gave me errors without
12:20:43Yardanicomaybe you've used "from" imports?
12:20:52Yardanicoah yes
12:20:56Yardaniconode kinds aren't exported
12:21:00ajusaError: type mismatch: got (XmlNodeKind, string)
12:21:07Yardanicoyes yes
12:22:57*PMunch quit (Read error: Connection reset by peer)
12:23:00*PMunch_ joined #nim
12:23:03*PMunch_ quit (Remote host closed the connection)
12:23:33*PMunch joined #nim
12:23:48*Matthias247 quit (Read error: Connection reset by peer)
12:25:42*dddddd quit (Ping timeout: 260 seconds)
12:29:24*grape joined #nim
12:29:29grapehttps://pastebin.com/aKPbf5R9
12:29:37grapemy first nim program
12:29:41grape:D
12:30:13*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:31:13Yardanicogrape, a couple of general styling suggestions: usually nim uses camelCase identifier for procedures, values
12:31:19*rauss quit (Quit: WeeChat 1.9)
12:31:27Yardanicobut you're not disallowed to use other styles
12:31:28Yardanicoah
12:31:30Yardanicoalso
12:31:34Yardanicoyou don't need "break" in case statement
12:32:07grapethanks guys, the break is for the while loop
12:32:10Yardanicoalso you don't need to define variables before they're used :)
12:32:10Yardanicoah
12:32:23*ajusa quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
12:32:52grapeOh, :o i will test that now
12:33:17Yardanicogrape, https://gist.github.com/Yardanico/e6c77ab67f5c2fe50462ad2dc3c9ab54
12:35:08Yardanicoalso you may notice that you don't need to write any types of variables by yourself in this code :)
12:35:18Yardanicoah sorry
12:35:22Yardanico I removed break statement
12:37:04grapeits fine, yes i see, i get it now
12:37:31grapei understand :D
12:38:05*dddddd joined #nim
12:39:34grapewell i knew it honestly, it says it on the tutorial (the type inference), but i thought it would be better to write the type
12:39:48*cspar_ joined #nim
12:40:15grapeit is good style to Not write the types?
12:40:59FromGitter<Grabli66> Can i implement ++ operator? I tried https://play.nim-lang.org/?gist=a636a6e9a371bedb370fa8120fa9c53b
12:41:04FromGitter<Grabli66> But fail
12:42:06grapeAnyway thank you very much for to be friendly, i am glad to learn
12:44:06grapei didn't know the camelCase thing tho, so thanks :)
12:46:17grapecya <3
12:46:20*grape quit (Quit: Bye)
12:49:11YardanicoGrabli: why do you need it?
12:49:25Yardanicothere's "inc" thing, which is the same as "+="
12:50:08YardanicoGrabli: you can use this operator, but it would work like this: "++v"
12:50:29FromGitter<Grabli66> I want to write like this: this.buffer[len++] = char(value and 0xFF)
12:51:24Yardanicojust write it in two lines?
12:51:31FromGitter<Grabli66> Yes :)
12:51:47FromGitter<Grabli66> Just write it in one line.
12:52:45Yardanicoit would look ugly if you write two statements with ";"
12:54:27FromGitter<Grabli66> Why it's ugly?
12:54:43Yardanicowell because you need to use ";"?
12:56:09FromGitter<Grabli66> It's strange, many languages have ++ operator.
12:58:01Yardanicowell nim doesn't meant to be similar to other languages
12:58:04Yardanico*wasn't
12:59:00*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:59:14FromGitter<Grabli66> Ohhh. I found the problem. Python does not have ++ operator :)
12:59:33Yardanicowell Nim has mostly took only syntax from python
12:59:47Yardanicoe.g. indentation and some keywords
13:00:21FromGitter<Grabli66> Ok. I can live without ++
13:02:16Yardaniconim just doesn't want to allow this: "++i + ++"
13:02:20Yardanico++i + ++i
13:02:42FromGitter<couven92> ooohh... @Yardanico that's ugly! :O
13:03:08FromGitter<couven92> I just realized that you can actually *really* do that in C!
13:03:12Araqthe primary reason we don't have ++ is that we don't have postfix operators.
13:03:27FromGitter<couven92> except for `*`! :P
13:03:40YardanicoI don't think it's an operator
13:03:46cremPostfix ++ is a weird one anyway.
13:03:57cremBut there's no also prefix ++, is there?
13:04:01FromGitter<couven92> yes it is, that was my first major gotcha when I started with macros
13:04:12Yardanicocrem, you can do that
13:04:23Araqtemplate `++`(x: untyped) = inc x
13:04:39Araqbut then people will complain there is no postfix ++ and it's not "consistent"
13:05:16*sz0 joined #nim
13:05:20Araqwhich seems to mean nothing beyond "I don't like this" anymore
13:06:28cremIn go there is ++ (only postfix, but it acts more like C's prefix, or even worse as it's statement not expression)
13:07:20crem(but I'm not advocating introducing ++!) It may seem as I do. Again.
13:08:09Yardanicocrem, nah, it doesn't seem that you're advocating about ++ :)
13:09:10cremDoes nim emit "++x" when compiling "x += 1" to C?
13:09:22Yardanicocrem, one sec, I'll try:)
13:09:34Yardanicobut I think no
13:09:45Yardanicoyeah
13:09:49Yardanicoit has
13:09:50Yardanico"x_41MPy1A9aRwuiSralpD6vTQ += ((NI) 1);"
13:09:51*rauss joined #nim
13:10:18cremThat's creative variable name!
13:10:27Yardanicocrem, name mangling, nothing new here :)
13:10:59FromGitter<Grabli66> I found a solution for me https://play.nim-lang.org/?gist=ad6cbce321f58729afe84cbe994ff928
13:11:10FromGitter<Grabli66> Now i can write all in one line
13:11:28FromGitter<Grabli66> this.buffer[len.inc] = char(value and 0xFF)
13:11:34*dddddd quit (Ping timeout: 240 seconds)
13:11:52Yardanicobut why do you need this proc for only one occurence?
13:12:07Yardanico*occurrence
13:12:16FromGitter<Grabli66> It's not once in my code
13:12:27FromGitter<Grabli66> There is just an example
13:13:15FromGitter<Grabli66> data[len.inc] = char((v and 0xFF000000'u32) shr 24) ⏎ data[len.inc] = char((v and 0xFF0000'u32) shr 16) ⏎ data[len.inc] = char((v and 0xFF00'u16) shr 8) ⏎ data[len.inc] = char(v and 0xFF'u8) [https://gitter.im/nim-lang/Nim?at=59b145eb210ac2692004cd9b]
13:13:34Yardanicohmm
13:13:36*Snircle joined #nim
13:13:37Yardanicois this base64 ?
13:14:18FromGitter<Grabli66> It's for add uint32 to buffer
13:14:42Araqyou can't write it in one line when you care about buffer overflows
13:14:51FromGitter<Grabli66> How?
13:15:37*claudiuinberlin joined #nim
13:16:49FromGitter<Grabli66> Ohhh. I check buffer before add
13:24:11*dddddd joined #nim
13:26:56YardanicoAraq, wait, did you just made a release :P ?
13:27:23YardanicoI mean v0.17.2 tag
13:34:19Araqthe release is complete when the website tells 0.17.2 is out
13:34:26Araqthe tagging is just a step
13:34:27Yardanicoyeah I know
13:34:39Yardanicobut at least we know exact commit for new release :)
13:37:18*relax joined #nim
13:38:25*haha_ joined #nim
13:39:28Arrrrwill reorder by default be included in this release?
13:39:40YardanicoArrrr, no
13:39:47Yardanicowell I don't know really
13:40:03Yardanicobut probably in v0.18.0 (if there would be no v0.17.4)
13:40:48cremWhat will be after v0.99? v0.100? There was v0.9 not v0.09, right?
13:40:58Yardanicocrem, no jokes pls :P
13:41:07Yardanicothere would be no v99
13:41:10Yardanico0.99
13:41:15crem:( Tjat
13:41:18cremThat's sad
13:41:20YardanicoArrrr, https://github.com/nim-lang/Nim/pull/6326
13:41:38*zielmicha_ quit (Read error: Connection reset by peer)
13:41:55Yardanicowhen this PR will have all features implement, and after it'll be tested at compiler modules and wxWidgets wrapper, it can be merged :)
13:42:01Yardanico*implemented
13:42:03cremalso where's choosechoosenim to switch choosenim versions?
13:42:07*zielmicha_ joined #nim
13:47:35*cspar_ quit (Ping timeout: 240 seconds)
13:54:29*SusWombat_ joined #nim
13:56:56FromGitter<BigEpsilon> It already compiles wxwidget
13:57:03FromGitter<BigEpsilon> and nim compiler
13:57:21FromGitter<BigEpsilon> @Yardanico
13:57:21*SusWombat quit (Ping timeout: 248 seconds)
13:57:30YardanicoBigEpsilon: woah
13:57:49FromGitter<BigEpsilon> I think it will be ready soon
13:57:56YardanicoBigEpsilon: so you can mark it as "ready" ? :)
13:58:02YardanicoI mean "test on all compiler modules" and "test on wxWidget wrapper"
13:58:14Yardanicobut cool work anyway
13:58:22FromGitter<BigEpsilon> yes but it fails on system.nim
13:58:37FromGitter<BigEpsilon> because it still dont support user defined pragma
13:59:13FromGitter<BigEpsilon> I'll add that maybe tonight or tomorrow and the update the PR
13:59:59Arrrrupvoted
14:00:15FromGitter<Grabli66> method addUint8 ⏎ method addUint16 ⏎ Has equal ident name? ⏎ Nim says that i must use {.base.} [https://gitter.im/nim-lang/Nim?at=59b150ef4e50cfde2713e23d]
14:03:13YardanicoGrabli66: btw, you can also take a look on "streams" module
14:03:23*rauss quit (Quit: WeeChat 1.9)
14:04:32*PMunch quit (Quit: Leaving)
14:04:39FromGitter<Grabli66> Streams module uses proc, not method
14:04:59*rauss joined #nim
14:05:44AraqBigEpsilon: afterwards you can work on tyForward :D
14:06:23Araqwe want to allow it C++'styled, pointers to a forwarded type are allowed to be able to have type cycles across module boundaries
14:07:21Araqthen you can make 'not nil' sane and we'll call it v1
14:09:34*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:10:11*relax quit (Ping timeout: 255 seconds)
14:10:21*cspar_ joined #nim
14:12:37*relax joined #nim
14:13:34YardanicoGrabli66: yeah, for performance
14:14:52*claudiuinberlin joined #nim
14:17:28FromGitter<BigEpsilon> hahaha
14:17:39FromGitter<BigEpsilon> I have a family and a job !
14:18:48Araqsounds familiar
14:19:28Araqhow does reorder: on influence compile times?
14:22:06FromGitter<BigEpsilon> I didn't check
14:22:20FromGitter<BigEpsilon> as I m working only with the debug build
14:22:26FromGitter<BigEpsilon> "nimd"
14:23:52*gangstacat quit (Quit: Ĝis!)
14:29:22*PMunch joined #nim
14:31:50ArrrrWe are your new family
14:32:05Yardanicomwahahaha
14:33:43Yardanico*put devil laugh here*
14:38:11*relax quit (Ping timeout: 246 seconds)
14:38:13*gangstacat joined #nim
14:40:29*relax joined #nim
14:44:08FromGitter<BigEpsilon> :P
14:47:08FromGitter<mratsim> Wow I just discovered that play.nim-lang.org is working. There isn’t even a (stickied?) post on Reddit !
14:48:09Yardanicoit was working for one month already IIRC
14:48:54FromGitter<mratsim> I was playing RPGs instead of coding the past month :P
14:49:50FromGitter<mratsim> I would love to have, C, ASM, JS and PHP (!!!) output :D
14:52:17Yardanicowell php isn't supported at all
14:52:27YardanicoI actually think that it was an Araq's experiment
14:52:46subsetparkPHP? gross
14:53:12Yardanicoand there was FASM
14:53:21Yardanicobut it was removed (IDK why, I wasn't using nim this time)
14:53:30Araqgot paid for php
14:53:38Yardanicoah
14:55:06FromGitter<mratsim> is it still working?
14:55:13Yardanicowell
14:55:17Yardanicoyou *can* use it
14:55:21Yardanicobut many things don't work here
14:55:26YardanicoI mean MANY
14:56:02subsetparkAraq, you whore!
14:58:05cremAny live examples of something using Karax?
14:59:58*thomasross_ quit (Remote host closed the connection)
15:00:23*thomasross_ joined #nim
15:09:08*miran joined #nim
15:11:57*gokr quit (Ping timeout: 252 seconds)
15:12:36Araqcrem: karax is very simple to use, what do you want to know?
15:13:10cremIf anyone actually used it. :)
15:14:12FromGitter<Grabli66> Is there are possibility to create singleton in nim? :)
15:15:54ArrrrWhat is the problem?
15:16:51FromGitter<Grabli66> I see no way how to disable of creating object by "new SingletonObject()"
15:17:06FromGitter<Grabli66> Can't create private constructor.
15:17:48ArrrrSo, if the question is "Can't i disable object construction" no you can't. You can only discourage it
15:17:52Arrrr*can
15:18:09Yardanicoproc new(t: MyType) = discard lol
15:18:12cremSense of singleton usually not that it's impossible to create a second copy, but rather to have a single object which you can access from anywhere.
15:18:26Yardanicoor no
15:18:38Yardanicowell this works
15:18:42Yardanicobut it's a *hack*
15:19:02ArrrrYou can instantiate objects in global scope, that's your singleton
15:19:45mjanssenGrabli66 why would you want to disable creating of objects? What is the goal you are trying to achieve?
15:19:50federico3you can use global scoped variable and return the same instance or throw an exception
15:20:16Yardanicowell I think he's porting some code from C++
15:20:28Yardanicoand he doesn't know nim very well (only my thoughts)
15:20:45FromGitter<Grabli66> proc new(t: GameEngine) = discard
15:20:46Yardanicoso he's just doing the same as he would do in c++ (where possible)
15:20:47FromGitter<Grabli66> Works
15:20:49FromGitter<Grabli66> Great
15:20:51Yardanicobut pls don't use it
15:20:54Yardanicoit's ugly as well
15:21:07FromGitter<Grabli66> It's ugly but i like it :)
15:21:25subsetparkYeah my thought would be, create a private var in your module, export a proc that instantiates the var if nil and returns it
15:22:27YardanicoGrabli66: well I don't like when people do a straight port some code from another language to nim and then write an article about nim
15:22:46Yardanicojust generally
15:23:37FromGitter<Grabli66> I dont know how to make it better in nim. I used C#, Java, Haxe. And i am trying to write in same way :)
15:23:47Yardanicowell that's always bad
15:24:04Yardanicobecause different languages are DIFFERENT
15:24:32ArrrrI don't think there is a need for singletons in nim because nim doesn't put objects in the center of everything
15:24:40ArrrrDepends on what you want to achieve
15:24:53Yardanicowell he's doing a game engine :)
15:25:07mjanssensingletons are just global vars in class based systems
15:25:13FromGitter<Grabli66> I want a global object with possibility to get it from anywere
15:25:18Yardanicoyes
15:25:23Yardaniconim allows that
15:25:31mjanssenGrabli then use the proc with private global solution
15:25:45federico3Grabli66 are you releasing the engine and/or can we see an example? :)
15:26:29FromGitter<Grabli66> No, i am not releasing an engine. I am too old for that :)
15:27:29FromGitter<Grabli66> mjanssen, good idea. I'll do like this
15:27:53mjanssenGrabli66 it was subsetpark 's idea.
15:27:57*coffepot joined #nim
15:28:10coffepothey guys
15:28:52federico3too... old?
15:28:52*BigEpsilon quit (Ping timeout: 260 seconds)
15:29:00Yardanicocoffepot, he
15:29:18FromGitter<Grabli66> Too old for writing engines :)
15:29:30dave24def-: ping
15:29:34Yardanicoproc new(t: GameEngine) = discard :)
15:30:31*MyMind joined #nim
15:30:50coffepotso, Araq: I read this earlier about your plans for Nim v2: "atomic RC will be done for 'ref'". I'm gonna be "that guy" and be concerned that this is gonna turn out like Delphi strings in threads, aka forcing any threadding to choke up ala Python's GIL. Are my fears unfounded?
15:31:29ArrrrYou don't need new to instantiate ref objects, you can do `Object()`
15:31:50coffepotArrrr sure but what if you want ref semantics?
15:32:13coffepotsorry i misread that
15:32:15*Sembei quit (Ping timeout: 248 seconds)
15:32:29coffepotit'll still use the lock though even if u instantiate it differently
15:32:53coffepotis the lock is only for instantiation?
15:33:06Araqwho said anything about locks?
15:33:31coffepotI was just reading the chatlog and you said "Araq Nim v2 will get assignment operators and destructors much like C++, atomic RC will be done for 'ref' plus an optional cycle collector but this will most likely require explicit traceRoot(x) calls to break up cycles"
15:33:57coffepotatomic RC isn't a lock, true
15:34:07coffepotbut it still flushes cores, unless I'm mistaken?
15:35:34coffepoti hate to be the "performance is everything" guy, just that Delphi has really soured me on this particular approach as their strings all require atomic locks and thus kills threading performance unless you don't use strings
15:37:05coffepotonly thing I can think is, can we have it as a 'shared ref' or something? So normal refs are thread unsafe but less overhead? That is if, as I am assuming, the atomic operation is done for every access to a ref, if it's just for instantiation that's not as bad
15:37:13FromGitter<mratsim> Given the regular discussion on performance of immutable strings, I’m pretty sure any implementation change of strings will be duly checked for slowness
15:37:58coffepotstrings yes, but "atomic RC will be done for ref" implies it's not just strings
15:38:07def-dave24: pong
15:38:12Arrrr 1.0 is not even alive, i doubt any plan for 2.0 will survive for too long
15:39:01coffepotI know there's pressure to make Nim threadsafe, just thought I'd air my concerns on that one - if someone has better info to allay my fears?
15:39:01dave24def-: I was wondering; does your bigints library work on 32bit systems?
15:39:26def-I hope so
15:39:37*PMunch quit (Quit: leaving)
15:39:41def-it shouldn't use anything x86-64 specific
15:40:11dave24def-: right, I was just not sure because in the TODO it says "Fix the library on 32bit"
15:40:22def-Oh, then there is probably some bug
15:41:23dave24Ah, ok. I'll look for something else, thanks anyway.
15:41:40*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:45:26Araqcoffepot: I'll keep it in mind
15:46:08AraqI'm concerned about performance too ofc
15:47:08*cspar_ quit (Ping timeout: 246 seconds)
15:48:03*cspar joined #nim
15:52:58*Andris_zbx quit (Remote host closed the connection)
15:53:21coffepotAraq: :) awesome that's all I can ask. From what I've been reading the performance hit is probably only one or two cache misses in a thread's current execution which is minor (depending on application), but more concerning for me is cacheline contention - not so much for what I'm using Nim for now, but if people are doing highly parallel stuff it *
15:53:21coffepotcould* well have a bigger effect that translates to a lack of scaling with many threads. I think my concern is that this would be the default state so be a cost incurred at every ref access. If we only need to incur this cost when we need sharing which is surely the less common case then perhaps eg a shared ref type would help. I understand if you
15:53:21coffepotdon't want to complicate the type system though
15:54:17*cspar_ joined #nim
15:54:34Araqit's not just the type system
15:54:48Araqthe current solution has some serious composability problems
15:55:10Araqbut it's good enough for a version 1 esp since the other things are even more unproven
15:55:54coffepotisn't the current solution just copying with channels?
15:56:01*cspar quit (Ping timeout: 240 seconds)
15:56:46*claudiuinberlin joined #nim
15:57:51coffepotAre memory regions here yet, or... will they help?
15:57:56Araqor protect/dispose and cast to 'ptr'
16:02:43coffepotdefinitely good enough for version 1 from my perspective, Nim already feels pretty mature for what I use it for.
16:03:05*BigEpsilon joined #nim
16:03:40coffepottime for me to go, love all and have a great day/night :D
16:04:14coffepot*love you all, even! :D
16:04:23*coffepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:07:40*Trustable joined #nim
16:11:35*cspar joined #nim
16:13:51*cspar_ quit (Ping timeout: 248 seconds)
16:15:17*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:19:05YardanicoAraq, https://github.com/nim-lang/Nim/issues/4218#issuecomment-326563431
16:20:12*BitPuffin|osx quit (Ping timeout: 260 seconds)
16:24:37*sz0 quit (Quit: Connection closed for inactivity)
16:29:53*cspar quit (Ping timeout: 248 seconds)
16:29:54FromGitter<Grabli66> Nim says that using global variable in proc is not gc safe. What to do? :)
16:30:02*claudiuinberlin joined #nim
16:30:02*claudiuinberlin quit (Client Quit)
16:30:51YardanicoGrabli66: you use threads? then yes, you should care about memory safety
16:30:59ehmryGrabli66 use a Lock and {.guard.}?
16:31:12FromGitter<Grabli66> No. I only use async
16:31:24Arrrrheh
16:31:39Yardanicothen you don't need to care about gcsafe
16:31:42Yardanicoit's just a warning
16:31:45Yardaniconot an error
16:31:55FromGitter<Grabli66> Ok
16:33:14ehmryon the subject of threads, I want to spawn a proc but be sure it doesn't make any I/O, if I set ``{.tags: [].}`` I get an error about ``RootEffect`` from the GC, is there a way to get something more specific about the GC effect?
16:33:57Yardanicoehmry, IO is IOEffect
16:34:23Yardanicoah
16:34:29Yardanicoroot effect is just "base effect class; each effect should inherit from TEffect unless you know what you doing."
16:34:38ehmryyea
16:34:59Yardanicoyou should add it to your tags i think
16:36:02*endragor quit (Remote host closed the connection)
16:36:22*BitPuffin|osx joined #nim
16:39:45ehmrymy problem is that RootEffect covers IOEffect, but I'm not sure what to do with the warning ``Error: can have an unlisted effect: RootEffect``
16:40:25Yardanicoit's a warning though
16:40:51ehmryI mean error
16:46:34*yglukhov quit (Remote host closed the connection)
16:48:01*relax quit (Ping timeout: 248 seconds)
16:48:42*MyMind quit (Read error: Connection reset by peer)
16:49:41*MyMind joined #nim
16:50:42*yglukhov joined #nim
16:54:55*yglukhov quit (Ping timeout: 248 seconds)
16:56:03*ipjk joined #nim
16:57:32*yglukhov joined #nim
16:59:17*dddddd quit (Ping timeout: 260 seconds)
17:02:10*yglukhov quit (Ping timeout: 264 seconds)
17:06:20*Vladar quit (Quit: Leaving)
17:06:58*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
17:10:54*Snircle joined #nim
17:11:05*BigEpsilon quit (Ping timeout: 240 seconds)
17:11:38*dddddd joined #nim
17:18:20odchi there
17:18:41odcis PMunch here?
17:21:35Yardanicoit seems he's not :)
17:23:04odcyup
17:24:06odcso, i can't install Aporia : Cannot satisfy the dependency on gtk2 #head and gtk2 1.1
17:25:39odcit looks like dialogs and Apora have conflicting dependencies
17:31:34odco.O it worked when i installed the dependencies manually
17:40:52*yglukhov joined #nim
17:44:03*yglukhov quit (Remote host closed the connection)
17:44:17*yglukhov joined #nim
17:56:53Araqthat reads like a generic package manager description
17:57:09*Trustable quit (Remote host closed the connection)
17:58:15dom96If something like that happens then please zip up your ~/.nimble and send me it
17:58:22dom96together with the command you're running
18:03:00*skrylar joined #nim
18:18:44odcdom96: thanks. I'll try to do that next time.
18:22:26*ofelas joined #nim
18:24:18FromGitter<Grabli66> Is there build system for nim?
18:30:22dom96Nim is the build system
18:30:34FromGitter<Grabli66> :)
18:30:34Yardanicoyeah
18:30:46Yardanicoyou don't need to specify the order of files to compile like in C++/ etc
18:30:53Yardanicoif you need to run some scripts tho, use .nims file
18:31:22dom96if you're writing a Nimble package then write your build script in the .nimble file.
18:32:33FromGitter<Grabli66> I have directory "src". I want build project, and set src directory, and output directory, and nimcache directory. And all it settings in some file. Then compile like nim compile.
18:32:55FromGitter<Grabli66> Nims? Where i can finde info about it?
18:34:04Yardanicohttps://nim-lang.org/docs/nims.html NimScript as a build tool
18:34:11Yardanicohttps://github.com/nim-lang/Nim/wiki/Using-nimscript-for-configuration
18:36:39dom96Most of these are handled by nimble
18:37:22dom96https://github.com/nim-lang/nimble#creating-packages
18:37:23FromGitter<Grabli66> Ok. I'll try to understand
18:37:42dom96And then this is the list of all the options that you can put into the Nimble file: https://github.com/nim-lang/nimble#nimble-reference
18:38:00Yardanicodom96, well I know, but Grabli66 wants to make a build script only for himself
18:38:30FromGitter<Grabli66> Yes.
18:38:38dom96Why?
18:39:01dom96But that doesn't matter, you should still use Nimble.
18:39:22Yardanicowhy we have 2 different tools for 3 thing then? ah, even 3: nims, nimble, nakwe
18:39:24Yardanico*nake
18:39:25dom96it will manage dependencies for you
18:39:41dom96because both predate Nimble
18:40:09FromGitter<Grabli66> Ok. I'll try nimble
18:40:18Yardanicowell nake can be useful sometimes, when you need to use something which works only with nim
18:40:21Yardanicoe.g. http requests
18:41:45dom96You don't need nake for that. The Nim VM let's you execute processes so it's possible, albeit more difficult.
18:43:56Yardanicowell I don't understand why people still use .nims and nake
18:44:26dom96then why are you suggesting it?
18:46:25*rokups quit (Quit: Connection closed for inactivity)
18:47:03*Jesin quit (Quit: Leaving)
18:47:18FromGitter<Grabli66> Almost done. But i dont see how to set nimcache directory in nimble file.
18:47:51Yardanicowhy do you want to change it?
18:48:16FromGitter<Grabli66> I dont want it in src directory.
18:48:56FromGitter<Grabli66> It's not critical, though. :)
18:50:50dom96where do you want it?
18:51:06dom96you should probably change it in the Nim config.
18:51:09FromGitter<Grabli66> In project root directory
18:51:26Yardanicowell where you did create .nimble file?
18:51:30Yardanicoyou should create it in project root
18:51:48FromGitter<Grabli66> I create it in project root directory
18:52:01dom96You can change this using the --nimcache:<dir> option IIRC
18:52:11dom96put this in a yourMainModule.nim.cfg file
18:55:07FromGitter<Grabli66> Good. It works. Thanks guys
18:58:42*Matthias247 joined #nim
18:58:56*couven92 quit (Quit: Client disconnecting)
19:01:49FromGitter<Grabli66> Can i use uppercase in module names? Nim wan't build if i do.
19:03:53FromGitter<Grabli66> Sorry, i was wrong. It builds
19:07:34*scriptum joined #nim
19:12:02*sleepyqt joined #nim
19:20:00*couven92 joined #nim
19:20:44*haha_ quit (Quit: haha_)
19:26:13*Arrrr quit (Read error: Connection reset by peer)
19:30:08vlad1777dHello to all. I was busy many time. Does anybody knows, was ":" and "=" before procedures made optional, or, maybe, there are some such planes ?)
19:32:28Yardanicovlad1777d, no, I think there's no such plans at all
19:32:30Yardanicowhy do you want this?
19:32:54Yardanicoand yeah, : is optional if your proc doesn't return
19:33:08vlad1777dYardanico, I just asked =) I got used to this in Coffeescript =)
19:33:23Yardanicovlad1777d, well coffeescript isn't compiled to native binary :P
19:33:53vlad1777dYardanico, I know, thanks =) I just asked to know =)
19:35:03*claudiuinberlin joined #nim
19:42:17FromGitter<dandevelop> Is it possible to install Nim from source on Windows using only the Visual C++ compiler without having to install mingw?
19:42:52ipjkdandevelop: I reacalling reading about that, it works, but not 64-bit. Don't quote me on this however.
19:42:59ipjkrecall*
19:43:45*ShalokShalom_ is now known as ShalokShalom
19:47:38dom96dandevelop: what's your reasoning for not using mingw?
19:48:57*PMunch joined #nim
19:50:59Yardanicodandevelop: just install nim with mingw, and then make vcc default for all your programs :)
19:52:12*mahmudov joined #nim
19:58:57*krux02 quit (Remote host closed the connection)
19:59:47SusWombat_whats the fastest way to write to files in nim?
20:00:24AraqwriteBuffer
20:00:32SusWombat_ok thx
20:01:23*salewski joined #nim
20:01:57*ipjk_ joined #nim
20:02:03*ipjk quit (Ping timeout: 240 seconds)
20:02:23*Yardanico quit (Remote host closed the connection)
20:02:55salewskiAraq, is there a more general test for this: ((x is ref object) or (x is string) or (x is seq))
20:03:11salewskiI want to avoid the two or.
20:03:25Araqyou're likely doing it wrong
20:03:35*gokr joined #nim
20:03:36salewskiWhat I really want to know is, if I can apply GC_ref on x.
20:03:41Araqmacros should be syntactic, not overly analytical
20:03:59Araqwhen compiles(GC_ref(x)):
20:04:03Araq GC_ref(x)
20:05:25salewskiThanks.
20:08:24*salewski quit (Quit: WeeChat 1.4)
20:10:45*rauss quit (Quit: WeeChat 1.9)
20:18:28*nsf quit (Quit: WeeChat 1.9)
20:31:39FromGitter<dandevelop> @dom96 just wondering why mingw is a dependency on Windows
20:32:17*Pisuke joined #nim
20:32:35*miran quit (Ping timeout: 240 seconds)
20:34:08*MyMind quit (Ping timeout: 248 seconds)
20:35:04dom96https://nim-lang.org/blog/2017/09/07/version-0172-released.html
20:41:25FromGitter<dandevelop> Congrats on the new release!
20:46:33*nsf joined #nim
20:46:40FromGitter<Yardanico> Yay
20:46:47FromGitter<dandevelop> @dom96 regarding mingw, I don't have an issue with that. It's just curiosity to find out why it is a dependency
20:46:52FromGitter<Yardanico> Going to update russian wiki rn 
20:47:09FromGitter<Yardanico> I meant :P
20:48:56FromGitter<Yardanico> Wow, 0.17.0 released on May, 7
20:49:09FromGitter<Yardanico> And 0.17.2 on September, 7
20:50:32Araqthat's actually quite bad for a 0.0.2 release
20:50:45*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
20:50:54FromGitter<Yardanico> What do you mean by 0.0.2 ?
20:51:12dom96x.x.2
20:51:17FromGitter<Yardanico> AH
20:51:18*Sembei joined #nim
20:51:20dom96a minor release
20:51:24FromGitter<Yardanico> Yeah
20:52:58FromGitter<Yardanico> Second release for me :)
20:52:59FromGitter<Yardanico> Nim
20:53:03*Pisuke quit (Ping timeout: 240 seconds)
21:05:51PMunchHmm, how can I take a table or nothing as an argument?
21:06:04PMunchBy using an option?
21:06:49*ofelas quit (Quit: shutdown -h now)
21:09:04PMunchNever mind, had something else wrong with my code :P
21:09:27*nattefrost quit (Remote host closed the connection)
21:20:01*skrylar quit (Ping timeout: 240 seconds)
21:27:02*thomasross_ quit (Remote host closed the connection)
21:27:27*thomasross_ joined #nim
21:28:17FromGitter<mratsim> Do we need compiler magic to implement ref type with value semantics (like seq)? ⏎ I would like to have a seq like type backed by Nvidia GPU (Cuda).
21:30:24PMunchHmm, type mismatch got (Table[A, B]) but expected one of: TableRef(A, B)
21:37:23PMunchHow do I convert a Table to a TableRef?
21:40:25Araqyou can't, you have to start with one
21:41:51PMunchAh, newTable not toTable
21:44:51*Matthias247 quit (Read error: Connection reset by peer)
21:59:33dom96ooh, a £150 donation via PayPal.
22:00:16*nsf quit (Quit: WeeChat 1.9)
22:00:33TheManiacwhen `text` is a concept, does anyone know why `text.plain(int, int) is string` would give a 'too nested for type matching' error?
22:09:01Araqbecause you made 'text' a recursive concept definition?
22:09:37*couven92 quit (Ping timeout: 260 seconds)
22:10:01TheManiacit's not supposed to be recursive :(
22:10:15TheManiacText[C] = concept text
22:10:24TheManiactext.plain(int, int) is string
22:10:34TheManiactext.substr(int, int) is string
22:11:07TheManiaconce I've added a `plain` method, the intention is that `Text[char]` is basically a `string`
22:12:31TheManiacI feel like when I can get concepts to work I'm going to have superpowers, but I'm just not quite there yet...
22:13:34*PMunch quit (Quit: leaving)
22:17:06TheManiacwith great power comes great need for learning...
22:21:07TheManiacaha.
22:21:58TheManiacI mistyped above - I have `text.substr(int, int) is Text` and I'm guessing that's what you mean by recursive
22:22:27FromGitter<zacharycarter> @dom96 I had a look at writing that xz decompression lib and gave up
22:22:37dom96D:
22:22:46FromGitter<zacharycarter> seemed way over my head
22:23:16FromGitter<zacharycarter> I can't find a relatively simple example in any language, I'm guessing because it's not simple to implement
22:24:39TheManiacAraq: if I need that, am I SoL?
22:25:38FromGitter<zacharycarter> def-pri-pub: if you're around this evening please ping me
22:25:45FromGitter<zacharycarter> I have questions about your PR / the timer module
22:26:15AraqTheManiac: I'm not a concepts guy
22:27:10TheManiacaww. I kinda thought you knew everything
22:27:39FromGitter<zacharycarter> How asinine is this - today at work I was informed that the infrastructure for our solution includes a MySQL DB that can only be written to and not read from by applications utilizing it
22:28:04FromGitter<zacharycarter> it's only meant to stage data which is then supposed to be ETL'd somewhere or some nonsense like that
22:28:41FromGitter<zacharycarter> Concepts seem hard TheManiac - I suggest if you get a handle on them writing something up on them
22:29:42TheManiacso is there a method that takes a string and turns it into a seq[char]?
22:30:04TheManiacZacharyCarter: if I ever get that far, I might!
22:31:33FromGitter<zacharycarter> TheManiac: I think it already is : https://play.nim-lang.org/?gist=e7348b9e9a06581accd7261af3329112
22:32:31TheManiac@"foo" seems to work
22:33:07FromGitter<zacharycarter> oh I see cool
22:33:17FromGitter<zacharycarter> new trick learned
22:33:32*gokr quit (Ping timeout: 260 seconds)
22:38:14TheManiacfinally (I hope) is there a way to annotate the type in a function to indicate than it's an enum?
22:38:44TheManiaci.e. I want to write `proc[F: enum](foo: F)`
22:39:27TheManiacI'd hoped that `set[T]` would tell me how to do it, but it seems there's compiler magic going on
22:40:45FromGitter<cabhishek> Looks like tuple section https://nim-lang.org/docs/tut1.html#advanced-types-tuples is still outdated after 0.17.2 release. Release change log says it was fixed https://github.com/nim-lang/Nim/issues/6062
22:42:28*thomasross_ is now known as thomasross
22:45:04*Serenitor joined #nim
22:45:43*MyMind joined #nim
22:47:27*Sembei quit (Ping timeout: 248 seconds)
22:48:13FromGitter<zacharycarter> TheManiac: https://play.nim-lang.org/?gist=944f1f8e143d0c16ae59fcf6b4ca67f8 compiles and runs for me
22:48:17TheManiacooh, I was misreading the error message, looks like it works
22:48:33*TheManiac has been fluently writing nim for a few weeks now
22:48:52TheManiacbut just discovering quite how much I stub my toes when I try to move outside the part of it that I know...
22:49:01TheManiacThanks Zachary for all your help!
22:49:11FromGitter<zacharycarter> anytime!
22:50:33*cspar joined #nim
22:52:02Araqcabhishek: Version: 0.17.0 says it still
22:52:14Araqsomething has been forgotten to be updated
22:52:21Araqwill fix tomorrow, good night
22:52:27FromGitter<zacharycarter> night
22:53:30*pilne joined #nim
22:55:55*yglukhov quit (Remote host closed the connection)
22:56:18FromGitter<cabhishek> @Araq thanks
23:03:58FromGitter<adamrezich> is it not possible to manually declare specialized versions of generic procs? i.e. make a `proc foo[T]`, but then also declare how to handle it for T=Bar with `proc foo[T: Bar]`?
23:10:35FromGitter<zacharycarter> like this @adamrezich https://play.nim-lang.org/?gist=c0acb94b4b7b15caf4206f90ccce136a ?
23:15:33FromGitter<adamrezich> @zacharycarter apparently I can't do what I want to do, which is, have all of the procs have the same parameter types and no return type, only differing in the [T]: https://play.nim-lang.org/?gist=f7c5d2b1e3c123cd39b6608cf45541f4
23:17:48FromGitter<zacharycarter> hrm but why do you want to do such a thing since the T goes unused?
23:18:24FromGitter<adamrezich> I'm using typedesc[T] inside. it's for my component-based game engine, and the proc registers a component with the engine
23:18:39FromGitter<zacharycarter> gotcha
23:19:59FromGitter<zacharycarter> I think you're going to have to shoot for a different implementation as I doubt that's something the language can accommodate
23:20:21FromGitter<adamrezich> right now it's set up so to register a component, I call `registerMyComponent (app, procCalledWhenInstanceIsCreated, procCalledOnceOnly)`, and it works just fine... but I'm cleaning up my code, and it'd be awesome if component authors could write their own specialization of `register[T: MyComponent]`, so the game author doesn't have to write out `registerMyComponent (app, newMyComponent, regMyComponent)`
23:20:24FromGitter<zacharycarter> essentially you're declaring the same method three times, I don't think generics change the underlying method signature
23:20:55FromGitter<adamrezich> yeah that's what it seems like, which is too bad. I can just make `proc registerMyComponent` call the same underlying stuff
23:22:04FromGitter<adamrezich> I haven't written C++ in awhile, but I think you can do the thing I want to do in there with their templates, I could be wrong though
23:22:40FromGitter<zacharycarter> I'd ask again tomorrow when Araq / Dom96 are around
23:22:48FromGitter<zacharycarter> or Varriount or someone else
23:22:57FromGitter<zacharycarter> they can probably instruct you better than I can
23:23:03FromGitter<adamrezich> cool thanks
23:23:14Araqtold you how to do a component system in Nim days ago
23:25:58FromGitter<adamrezich> y-you did?
23:28:03*thomasross quit (Remote host closed the connection)
23:28:15TheManiacOK, I'm stuck again, but this time I'm pretty sure it's a bug
23:28:16TheManiachttps://play.nim-lang.org/?gist=11addf91d42ee54cf0b2b5fcefa3ecd3
23:28:25*thomasross joined #nim
23:28:50TheManiacthere's no way `Text[char, Text]` can be a thing
23:29:32TheManiacAnd how can `got 2 type(s) but expected 3` be right when calling a function that takes two type parameters?
23:33:12*TheManiac gives up for the day
23:43:05*JohnNovak joined #nim
23:43:23JohnNovakhi there
23:56:22*yglukhov joined #nim
23:59:44*def-pri-pub joined #nim