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:26 | relax | what's the best way to do endian-aware file IO? |
02:45:51 | relax | the 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:14 | FromGitter | <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:13 | MagpieMcGraw | HelloĄ |
06:06:37 | * | BigEpsilon joined #nim |
06:06:40 | MagpieMcGraw | I 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:43 | MagpieMcGraw | I 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:55 | MagpieMcGraw | that 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:02 | Araq | MagpieMcGraw: known problem, will be gone with today's release. workaround: nim c koch |
06:21:06 | Araq | koch nimble |
06:21:28 | Araq | you have a working 'nim.exe' that's all you need really |
06:22:45 | couven92 | Araq: good morning! :) Saw my fix for yesterday? (https://github.com/nim-lang/Nim/issues/6342) |
06:23:01 | Araq | indeed |
06:23:06 | Araq | foo= |
06:23:12 | Araq | looks so strange :P |
06:23:24 | couven92 | Yeah! :D But I assign to it conditionally later |
06:23:46 | couven92 | so, I thought it best to have it there, just to say, this might get a value later during the script |
06:24:56 | couven92 | But, if I havent f***ed up anything else lately, we should be good to go to another releease today? |
06:25:29 | MagpieMcGraw | okay, now I have succesfully ivoked nimble.exe. Thanks so muchĄ |
06:25:54 | * | endragor joined #nim |
06:26:29 | couven92 | Is it just me, or do the lines from MagpieMcGraw end with a weird UTF-8 rune? Ą |
06:27:31 | MagpieMcGraw | sorry 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:16 | couven92 | Araq, 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:47 | couven92 | The PR details my train of thought |
06:39:43 | Araq | bugfix releases do not need new features |
06:39:51 | Araq | your PR will be merged after 0.17.2 |
06:40:44 | couven92 | Yes of course, right... okay, then we'll talk about that later :) |
06:41:23 | * | Vladar joined #nim |
06:50:34 | FromGitter | <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:24 | FromGitter | <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:27 | FromGitter | <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:08 | FromGitter | <BigEpsilon> I was alos able to compile the nim compiler with reorder enabled (I enabled it in "passes") |
07:03:14 | FromGitter | <BigEpsilon> It compile successfuly |
07:04:01 | FromGitter | <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:07 | FromGitter | <BigEpsilon> I'll have to investigate why |
07:06:29 | * | PMunch joined #nim |
07:06:50 | FromGitter | <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:31 | Araq | well compilerRtl is a user defined pragma |
07:25:50 | Araq | which we do not yet consider in the reorder pass at all, good catch |
07:26:01 | * | Arrrr joined #nim |
07:26:58 | Araq | awesome that it works for the whole compiler! :D |
07:33:50 | * | BitPuffin|osx joined #nim |
07:34:29 | FromGitter | <BigEpsilon> yes indeed :) |
07:34:49 | FromGitter | <BigEpsilon> I'll see what I can do for the user defined pragmas |
07:36:55 | Araq | watch out for the "pragma" pragma |
07:37:03 | Araq | that's the only one that can define a new pragma |
07:37:32 | couven92 | whaaaat???? `vswherepkg\setup_configuration.nim(189, 28) Error: can raise an unlisted exception: Exception` |
07:37:53 | couven92 | adding `{.raises: [Exception].}` does not work |
07:38:11 | * | gokr joined #nim |
07:38:42 | couven92 | why do I get this error, and how do I fix it? |
07:40:56 | * | endragor quit (Remote host closed the connection) |
07:44:39 | FromGitter | <BigEpsilon> @Araq , ok |
07:46:51 | couven92 | ah! |
07:46:56 | couven92 | found it :) |
07:49:43 | * | yglukhov joined #nim |
07:53:53 | Araq | what was it? |
07:53:55 | * | endragor joined #nim |
07:54:01 | Araq | these error messages need to be improved |
07:54:09 | * | yglukhov quit (Ping timeout: 248 seconds) |
07:54:15 | couven92 | Araq, it was calling another proc without raises annotation |
07:54:30 | Araq | so? |
07:54:52 | * | Andris_zbx joined #nim |
07:54:52 | couven92 | so the proc where the error occurred had a raises annotation |
07:55:30 | couven92 | I 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:14 | Araq | did it point to the appropriate line or not? |
08:00:39 | couven92 | Araq, it pointed to where I invoked the non-annotated proc, but "can raise an unlisted exception: Exception" was a bit misleading... |
08:01:23 | couven92 | or rather the "Exception" at the end was misleading... it led me to believe I had to add `{.raises: [Exception].}` to my proc |
08:02:41 | Araq | ok |
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:50 | FromGitter | <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:09 | Arrrr | We are living in the best timeline. |
08:24:13 | * | Cranberry joined #nim |
08:24:19 | Cranberry | Guys, 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:17 | couven92 | If 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:44 | Cranberry | i don't know |
08:28:42 | Cranberry | cya |
08:28:44 | * | yglukhov joined #nim |
08:28:52 | * | Cranberry quit (Quit: Bye) |
08:29:19 | Arrrr | Yeah, 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:55 | couven92 | Arrrr, right... thx! :) |
08:31:27 | * | Matthias247 quit (Read error: Connection reset by peer) |
08:34:13 | Araq | sometimes it's unsafeAddr(s[0]) |
08:36:38 | couven92 | Araq, in case of a let? |
08:38:18 | * | krux02 joined #nim |
08:38:47 | FromGitter | <mratsim> yes |
08:39:16 | FromGitter | <mratsim> addr only works for var or ref |
08:41:15 | krux02 | whichlist: I wish that porting this to nim https://golang.org/pkg/math/bits/ is as easy as it is in go |
08:42:32 | crem | I hope nim won't become 1.0 soon! I |
08:43:02 | FromGitter | <Grabli66> I hope nim become 1.0 soon! I |
08:43:37 | crem | It would be like prison architect. While it was alpha it was a good game. |
08:47:05 | FromGitter | <k0pernicus> I hope nim become 1.0 soon too! :-) |
08:47:27 | krux02 | well I have my doubt it will become 1.0 soon |
08:48:51 | FromGitter | <k0pernicus> (The trick here is it depends what you mean by “soon” ;-) ) |
08:49:30 | FromGitter | <Grabli66> In this year :) |
08:50:25 | FromGitter | <Grabli66> That's the problem? Change version to 1.0 and push to github :) |
08:50:25 | FromGitter | <k0pernicus> 4 months to release a stable and “fully” tested version… Not impossible, but hard work |
08:50:35 | krux02 | Well there is one thing I really wish for nim, before it goes to version 1.0 |
08:50:55 | krux02 | make nim suitable for C library development. |
08:51:07 | federico3 | +1 krux02 ! |
08:51:13 | FromGitter | <k0pernicus> I agree |
08:51:27 | krux02 | like c++ is already |
08:51:45 | federico3 | it would be an advantage over other languages |
08:51:46 | krux02 | when a library has a C API people don't care if it uses c++ internally |
08:51:49 | krux02 | I want the same for Nim |
08:53:23 | FromGitter | <BigEpsilon> @krux02 , +1000 |
08:54:52 | Araq | krux02: you will be pleased by my plans then... |
08:55:31 | Araq | but there are more for a Nim version 2 |
08:55:37 | Araq | *they |
08:56:12 | FromGitter | <BigEpsilon> pls can you tell us more about it ? |
08:57:04 | 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 |
08:57:20 | federico3 | and perhaps merging async and non-async procs |
08:58:12 | Araq | strings and seqs stay as they are (they never required GC) conceptually but will get a different implementation |
08:59:09 | FromGitter | <BigEpsilon> So you have plans to better support nogc libraries like they are doing with D |
08:59:37 | FromGitter | <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:41 | Araq | that's not comparable |
09:00:41 | * | claudiuinberlin joined #nim |
09:01:28 | Araq | my 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:22 | Araq | my 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:25 | Araq | anyway, 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:46 | FromGitter | <BigEpsilon> Coming from C++, I often miss RAII when using GCed language implementations |
09:10:09 | Araq | no cheers for my plans, krux02? :-) |
09:12:52 | couven92 | Araq, 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:13 | couven92 | or does setLen zero the seq contents? |
09:13:43 | krux02 | couven92: the new elements, yes |
09:14:06 | krux02 | Araq: I was afk for a few minutes, getting tea :P |
09:14:38 | couven92 | krux02, my importc function takes to additional parameters: the capacity, and a out variable that returns the number of elements written |
09:15:10 | Araq | couven92: depends on the API, newSeq(length) can also be fine |
09:15:32 | couven92 | yeah, but I don't know how many items will be returned |
09:16:44 | couven92 | doing 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:49 | krux02 | Araq: I have to say I am not 100% sure how to understand your plan |
09:19:45 | krux02 | well yes, I agree on your plan |
09:19:58 | krux02 | basically it is what I imagined too. |
09:21:59 | krux02 | well 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:43 | krux02 | And last but not least, I really think it should be possible to pass a subsequence as an openarray |
09:24:01 | krux02 | it's trivial in C but not so much in Nim |
09:26:36 | Araq | system.slice lets you do that but is underdeveloped |
09:26:46 | Araq | in fact, I only tested it within 'parallel' |
09:29:18 | krux02 | that is good to hear that there is at least something already |
09:29:27 | krux02 | I 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:04 | FromGitter | <Bennyelg> @Yardanico Sup |
10:16:22 | FromGitter | <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:53 | FromGitter | <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:52 | FromGitter | <Bennyelg> BUT, if Iam running using for loop I can append each key to the array |
10:59:29 | FromGitter | <Bennyelg> ``` s.add(k)``` |
10:59:50 | FromGitter | <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:40 | def- | keys is an inline iterator |
11:02:53 | FromGitter | <Bennyelg> I saw that, how do I convert it to seq |
11:03:00 | FromGitter | <Bennyelg> or any other way to do so |
11:03:01 | def- | strutils.toSeq |
11:03:08 | FromGitter | <Bennyelg> tried that |
11:03:08 | def- | sequtils* |
11:03:28 | FromGitter | <Bennyelg> myPrettyTable.keys().toSeq |
11:03:34 | FromGitter | <Bennyelg> not work |
11:04:59 | def- | toSeq(myPrettyTable.keys()) |
11:05:46 | FromGitter | <Bennyelg> Not work |
11:06:36 | def- | works for me: https://gist.github.com/def-/4ab840ae6db77d27b2c6ad92508ba4ad |
11:06:52 | FromGitter | <Bennyelg> your solution work on the nim-play but it doesnt on mine :| |
11:07:04 | FromGitter | <Bennyelg> Maybe version problem? |
11:07:13 | def- | current nim devel branch |
11:07:46 | * | mjanssen joined #nim |
11:08:01 | FromGitter | <Bennyelg> Sec I'll check |
11:09:04 | FromGitter | <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:29 | def- | should be 0.17.2 |
11:09:46 | FromGitter | <Bennyelg> I use brew to install it on mac |
11:10:26 | def- | you can compile your own from github |
11:10:32 | FromGitter | <Bennyelg> :( Error: nim 0.17.0 already installed the feature is entered only from 0.17.2? |
11:10:36 | FromGitter | <Bennyelg> U will now |
11:10:40 | FromGitter | <Bennyelg> I* |
11:14:20 | FromGitter | <Bennyelg> ➜ csources git:(master) sh build.sh ⏎ uname: illegal option -- o ⏎ usage: uname [-amnprsv] |
11:15:12 | FromGitter | <Bennyelg> or sorry |
11:15:15 | FromGitter | <Bennyelg> my bad :D |
11:18:19 | * | Yardanico joined #nim |
11:18:28 | FromGitter | <Bennyelg> nop I thougt I was wrong but this is problem |
11:19:23 | FromGitter | <Yardanico> it's fixed in devel |
11:19:32 | FromGitter | <Yardanico> hi btw |
11:19:56 | * | Matthias247 joined #nim |
11:20:17 | FromGitter | <Yardanico> https://github.com/nim-lang/Nim/commit/811fbdafd958443ddac98ad58c77245860b38620 |
11:21:29 | FromGitter | <Bennyelg> but I just cloned the delvel |
11:21:50 | FromGitter | <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:04 | FromGitter | <Bennyelg> this is from my git log |
11:22:43 | FromGitter | <couven92> you'll have to run `koch csources` |
11:23:02 | FromGitter | <Bennyelg> where |
11:23:12 | couven92 | from the nim main repo root |
11:23:36 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b12c38c101bc4e3a9c5e68] |
11:23:41 | couven92 | that will place the sources into the build folder... |
11:24:05 | FromGitter | <couven92> ah! run `nim c koch` |
11:24:13 | FromGitter | <Bennyelg> thanks |
11:25:28 | FromGitter | <Bennyelg> after the `koch csources` I still need to run the build.sh ? |
11:25:59 | FromGitter | <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:50 | FromGitter | <Bennyelg> koch csources failed ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b12cfabc4647297406d2ee] |
11:27:33 | FromGitter | <couven92> huh... that's not good... |
11:27:36 | FromGitter | <Bennyelg> lol |
11:27:38 | def- | try just ./koch boot -d:release |
11:27:38 | FromGitter | <Bennyelg> :D |
11:27:58 | couven92 | ah, right! of course, yes, def- is right! |
11:27:59 | FromGitter | <Bennyelg> I see thats not Good :) |
11:28:31 | FromGitter | <Bennyelg> I'm starting to learn nim in my university |
11:28:55 | FromGitter | <Bennyelg> as an instructor to industrial Engineers students |
11:29:11 | couven92 | Arrrr, 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:25 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b12d95ee5c9a4c5f41a65d] |
11:29:26 | Araq | ptr UncheckedArray[T] |
11:29:33 | FromGitter | <Bennyelg> what a mess |
11:29:36 | couven92 | Ah! :) |
11:34:07 | couven92 | Araq, in which module is UncheckedArray? |
11:34:58 | Arrrr | I don't know how choosenim works, i always use https://github.com/nim-lang/Nim/#compiling |
11:36:13 | couven92 | ah, okay got it: https://nim-lang.org/docs/manual.html#foreign-function-interface-unchecked-pragma |
11:39:35 | Arrrr | I think UncheckedArray was added recently |
11:39:52 | Yardanico | couven92, in system |
11:39:59 | Yardanico | ah no |
11:40:01 | FromGitter | <Bennyelg> donnu cant build it |
11:40:08 | Yardanico | Bennyelg: clone fresh nim repo |
11:40:12 | Yardanico | from scratch |
11:40:17 | FromGitter | <Bennyelg> This is what I did |
11:40:26 | Yardanico | did you also remove your nim installation? |
11:40:36 | FromGitter | <Bennyelg> I did just brew uninstall nim |
11:40:57 | Yardanico | Arrrr, UncheckedArray is not exported |
11:41:07 | Yardanico | it's in system.nim, but you can't use it |
11:41:15 | Arrrr | Why not? is public |
11:41:21 | Yardanico | Arrrr, ah yes |
11:41:27 | Arrrr | Maybe i'm looking at an old commit |
11:41:34 | Yardanico | nonono you're right |
11:41:43 | Arrrr | Is defined liked this `UncheckedArray* {.unchecked.}[T] = array[0, T]` |
11:41:53 | Yardanico | yes |
11:46:40 | FromGitter | <Bennyelg> this is so frustrating lol |
11:46:58 | Yardanico | well I've never encountered any issues lol |
11:47:41 | * | dddddd quit (Ping timeout: 240 seconds) |
11:48:14 | FromGitter | <Bennyelg> you got a mac ? |
11:48:47 | Yardanico | I have a hackintosh on my pc, it's sierra 10.12.6, so basically yes :) |
11:48:50 | Yardanico | and nim works here too |
11:48:59 | * | cspar_ joined #nim |
11:49:38 | FromGitter | <Bennyelg> strage, if I build it myself, How come it need choose nim |
11:49:40 | FromGitter | <Bennyelg> donnu |
11:49:49 | Yardanico | it doesn't need it |
11:49:51 | * | endragor joined #nim |
11:50:29 | Yardanico | choosenim is a relatively new thing |
11:51:10 | FromGitter | <Bennyelg> I choose my desired directory. |
11:51:14 | FromGitter | <Bennyelg> I run git clone |
11:51:26 | FromGitter | <Bennyelg> I git clone --depth 1 the csources |
11:51:49 | FromGitter | <Bennyelg> run nim c koch |
11:51:52 | * | endragor quit (Remote host closed the connection) |
11:51:56 | Yardanico | why are you copy-pasting commands? |
11:52:00 | Yardanico | no |
11:52:03 | Yardanico | you're wrong |
11:52:08 | Yardanico | you firstly need to build nim from csources |
11:52:13 | * | ajusa joined #nim |
11:52:13 | FromGitter | <Bennyelg> Can't |
11:52:14 | Yardanico | you don't need to run "nim c koch" |
11:52:22 | FromGitter | <Bennyelg> it's doesnt work |
11:52:22 | Yardanico | if you have nim or choosenim installed - remove them |
11:52:30 | Yardanico | fully remove them |
11:52:45 | ajusa | Okay, here is a stupid question: How do I create a nested sequence of type "seq[seq[float]]"? |
11:52:47 | FromGitter | <Bennyelg> I did |
11:53:12 | Yardanico | ajusa, why do you mean by "Create"? |
11:53:18 | Yardanico | just create it as any other sequence |
11:53:23 | FromGitter | <Bennyelg> Yaaa ITS WORKING |
11:53:25 | FromGitter | <Bennyelg> thanks. |
11:53:33 | ajusa | Basically I want a two dimensional sequence |
11:53:34 | crem | ajusa: = @[] ? |
11:53:49 | ajusa | I tried this: newSeq[seq[float]] |
11:54:00 | FromGitter | <Bennyelg> var x: seq[seq[string]] = @[] |
11:54:21 | Yardanico | ajusa, not like this |
11:54:26 | Yardanico | like this: var a = newSeq[seq[float]]() |
11:54:32 | Yardanico | you've forgotten about () :) |
11:54:51 | ajusa | oh right xD |
11:55:13 | Arrrr | can't you create one with size w * h ? |
11:55:22 | Yardanico | Arrrr, yeah, basically a grid |
11:55:29 | Yardanico | +1 from me :) |
11:55:43 | FromGitter | <Bennyelg> @Yardanico what after csource finished |
11:55:49 | Yardanico | cd .. |
11:55:53 | Yardanico | bin/nim c koch |
11:55:56 | ajusa | YES THANK YOU ALL OF MY CODE WORKS NOW :D |
11:56:21 | FromGitter | <Bennyelg> Enjoy, and hang around |
11:56:41 | * | endragor joined #nim |
11:58:15 | FromGitter | <Bennyelg> After bin/nim c koch what now |
11:59:11 | Yardanico | ./koch boot -d:release |
11:59:26 | FromGitter | <Bennyelg> So freaking funny. ⏎ I did ./koch boot -d:release |
11:59:57 | FromGitter | <Bennyelg> Done succesffuly |
12:00:00 | Yardanico | then you have newest nim |
12:00:05 | Yardanico | in bin folder |
12:00:05 | Yardanico | try |
12:00:08 | Yardanico | bin/nim -v |
12:00:22 | FromGitter | <Bennyelg> But why i still get ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b134d69acddb240711018b] |
12:00:47 | Yardanico | because you didn't fully remove choosenim! |
12:00:49 | Yardanico | as I said! |
12:00:56 | FromGitter | <Bennyelg> I did lol I dont know where else |
12:01:07 | Yardanico | rm -rf ~/.choosenim |
12:01:10 | FromGitter | <Bennyelg> if i run from bin/nim all work |
12:01:12 | FromGitter | <Bennyelg> I did lol |
12:01:13 | * | dddddd joined #nim |
12:01:16 | Yardanico | rm -rf ~/.nimble/bin |
12:01:27 | * | claudiuinberlin joined #nim |
12:01:35 | FromGitter | <Bennyelg> Done |
12:01:37 | FromGitter | <Bennyelg> fantastic |
12:01:42 | FromGitter | <Bennyelg> the nimble is what I missed. |
12:01:44 | Yardanico | and after you delete it, add your "bin" folder to your PATH |
12:01:46 | FromGitter | <Bennyelg> thanks |
12:01:50 | FromGitter | <Bennyelg> I did :) |
12:05:09 | Yardanico | ajusa, also: about multidimensional seqs: https://play.nim-lang.org/?gist=a7cccf467fb0f2e8f71f7d5b5c2d52f2 |
12:05:23 | Yardanico | also it's requires no reallocations since the size of grid is known |
12:05:30 | Yardanico | only 1 allocation |
12:05:49 | Yardanico | and you need only 1 seq |
12:06:20 | ajusa | huh, thats pretty cool |
12:07:08 | * | haha_ quit (Quit: haha_) |
12:07:11 | Yardanico | but yeah, it requires one mul and one add operation! |
12:07:17 | Yardanico | for accessing right index :P |
12:07:36 | FromGitter | <Bennyelg> vs code crying :d ⏎ No 'nim' binary could be found in PATH environment variable ⏎ Any quick tip? |
12:07:51 | Yardanico | yes |
12:09:17 | Yardanico | Bennyelg: https://serverfault.com/a/277034 |
12:09:18 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:09:29 | Yardanico | and then relogin |
12:09:40 | Yardanico | or maybe reboot, IDK |
12:10:10 | Yardanico | ajusa, you can even create a grid of array instead of seq if you know exact grid size at compile time |
12:10:22 | Yardanico | it would be more performant i think |
12:11:19 | ajusa | Performance doesn't really matter for this bit. I am just reading a static table into nim, and doing lookups not very often |
12:11:25 | ajusa | But I will keep it in mind :D |
12:11:38 | ajusa | How do I get the name of a tag when parsing xml? |
12:12:19 | ajusa | https://play.nim-lang.org/?gist=070bea801e346236f3df9f48c79ad577 |
12:12:42 | Yardanico | ajusa, https://nim-lang.org/docs/xmltree.html#tag,XmlNode ? |
12:12:59 | Yardanico | maybe you can try renaming your "tag" here? |
12:13:15 | Yardanico | maybe nim doesn't like things like "tag.tag" |
12:14:20 | ajusa | making it thing.tag didn't help lol. Error: unhandled exception: n.k == xnElement [AssertionError] |
12:14:51 | Yardanico | well you're trying to get a tag of something which isn't an element |
12:14:59 | Yardanico | error is pretty clear here |
12:15:58 | ajusa | Yeah... But I think everything is an element. Unless I am misunderstanding the way Nim gets elements. Let me share the xml file |
12:16:33 | Yardanico | no |
12:16:38 | Yardanico | not everything is an lement |
12:16:40 | Yardanico | element |
12:16:43 | ajusa | https://pastebin.com/kgc58iH9 |
12:16:59 | Yardanico | ok |
12:17:01 | ajusa | As in, everything in my xml file should be an element |
12:17:03 | Yardanico | what do you want to get? |
12:17:24 | ajusa | I want a for loop that loops over each element and returns the tag name |
12:17:33 | Yardanico | for each time or space? |
12:17:35 | ajusa | *each parent element |
12:18:04 | ajusa | In this case, I should get just one tag: space |
12:18:40 | * | claudiuinberlin joined #nim |
12:18:49 | ajusa | then, I can do .items to get children of that and parse it recursively |
12:19:17 | * | cspar_ quit (Ping timeout: 260 seconds) |
12:19:58 | ajusa | oh im dumb |
12:20:04 | ajusa | if $thing.kind == "xnElement": |
12:20:12 | ajusa | I should have checked if it was an element |
12:20:17 | Yardanico | ehm |
12:20:17 | ajusa | Never mind, I got it |
12:20:18 | Yardanico | also |
12:20:23 | Yardanico | if thing.kind == xnElement |
12:20:26 | Yardanico | you don't need to use $ here |
12:20:35 | ajusa | It gave me errors without |
12:20:43 | Yardanico | maybe you've used "from" imports? |
12:20:52 | Yardanico | ah yes |
12:20:56 | Yardanico | node kinds aren't exported |
12:21:00 | ajusa | Error: type mismatch: got (XmlNodeKind, string) |
12:21:07 | Yardanico | yes 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:29 | grape | https://pastebin.com/aKPbf5R9 |
12:29:37 | grape | my first nim program |
12:29:41 | grape | :D |
12:30:13 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:31:13 | Yardanico | grape, 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:27 | Yardanico | but you're not disallowed to use other styles |
12:31:28 | Yardanico | ah |
12:31:30 | Yardanico | also |
12:31:34 | Yardanico | you don't need "break" in case statement |
12:32:07 | grape | thanks guys, the break is for the while loop |
12:32:10 | Yardanico | also you don't need to define variables before they're used :) |
12:32:10 | Yardanico | ah |
12:32:23 | * | ajusa quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
12:32:52 | grape | Oh, :o i will test that now |
12:33:17 | Yardanico | grape, https://gist.github.com/Yardanico/e6c77ab67f5c2fe50462ad2dc3c9ab54 |
12:35:08 | Yardanico | also you may notice that you don't need to write any types of variables by yourself in this code :) |
12:35:18 | Yardanico | ah sorry |
12:35:22 | Yardanico | I removed break statement |
12:37:04 | grape | its fine, yes i see, i get it now |
12:37:31 | grape | i understand :D |
12:38:05 | * | dddddd joined #nim |
12:39:34 | grape | well 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:15 | grape | it is good style to Not write the types? |
12:40:59 | FromGitter | <Grabli66> Can i implement ++ operator? I tried https://play.nim-lang.org/?gist=a636a6e9a371bedb370fa8120fa9c53b |
12:41:04 | FromGitter | <Grabli66> But fail |
12:42:06 | grape | Anyway thank you very much for to be friendly, i am glad to learn |
12:44:06 | grape | i didn't know the camelCase thing tho, so thanks :) |
12:46:17 | grape | cya <3 |
12:46:20 | * | grape quit (Quit: Bye) |
12:49:11 | Yardanico | Grabli: why do you need it? |
12:49:25 | Yardanico | there's "inc" thing, which is the same as "+=" |
12:50:08 | Yardanico | Grabli: you can use this operator, but it would work like this: "++v" |
12:50:29 | FromGitter | <Grabli66> I want to write like this: this.buffer[len++] = char(value and 0xFF) |
12:51:24 | Yardanico | just write it in two lines? |
12:51:31 | FromGitter | <Grabli66> Yes :) |
12:51:47 | FromGitter | <Grabli66> Just write it in one line. |
12:52:45 | Yardanico | it would look ugly if you write two statements with ";" |
12:54:27 | FromGitter | <Grabli66> Why it's ugly? |
12:54:43 | Yardanico | well because you need to use ";"? |
12:56:09 | FromGitter | <Grabli66> It's strange, many languages have ++ operator. |
12:58:01 | Yardanico | well nim doesn't meant to be similar to other languages |
12:58:04 | Yardanico | *wasn't |
12:59:00 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
12:59:14 | FromGitter | <Grabli66> Ohhh. I found the problem. Python does not have ++ operator :) |
12:59:33 | Yardanico | well Nim has mostly took only syntax from python |
12:59:47 | Yardanico | e.g. indentation and some keywords |
13:00:21 | FromGitter | <Grabli66> Ok. I can live without ++ |
13:02:16 | Yardanico | nim just doesn't want to allow this: "++i + ++" |
13:02:20 | Yardanico | ++i + ++i |
13:02:42 | FromGitter | <couven92> ooohh... @Yardanico that's ugly! :O |
13:03:08 | FromGitter | <couven92> I just realized that you can actually *really* do that in C! |
13:03:12 | Araq | the primary reason we don't have ++ is that we don't have postfix operators. |
13:03:27 | FromGitter | <couven92> except for `*`! :P |
13:03:40 | Yardanico | I don't think it's an operator |
13:03:46 | crem | Postfix ++ is a weird one anyway. |
13:03:57 | crem | But there's no also prefix ++, is there? |
13:04:01 | FromGitter | <couven92> yes it is, that was my first major gotcha when I started with macros |
13:04:12 | Yardanico | crem, you can do that |
13:04:23 | Araq | template `++`(x: untyped) = inc x |
13:04:39 | Araq | but then people will complain there is no postfix ++ and it's not "consistent" |
13:05:16 | * | sz0 joined #nim |
13:05:20 | Araq | which seems to mean nothing beyond "I don't like this" anymore |
13:06:28 | crem | In go there is ++ (only postfix, but it acts more like C's prefix, or even worse as it's statement not expression) |
13:07:20 | crem | (but I'm not advocating introducing ++!) It may seem as I do. Again. |
13:08:09 | Yardanico | crem, nah, it doesn't seem that you're advocating about ++ :) |
13:09:10 | crem | Does nim emit "++x" when compiling "x += 1" to C? |
13:09:22 | Yardanico | crem, one sec, I'll try:) |
13:09:34 | Yardanico | but I think no |
13:09:45 | Yardanico | yeah |
13:09:49 | Yardanico | it has |
13:09:50 | Yardanico | "x_41MPy1A9aRwuiSralpD6vTQ += ((NI) 1);" |
13:09:51 | * | rauss joined #nim |
13:10:18 | crem | That's creative variable name! |
13:10:27 | Yardanico | crem, name mangling, nothing new here :) |
13:10:59 | FromGitter | <Grabli66> I found a solution for me https://play.nim-lang.org/?gist=ad6cbce321f58729afe84cbe994ff928 |
13:11:10 | FromGitter | <Grabli66> Now i can write all in one line |
13:11:28 | FromGitter | <Grabli66> this.buffer[len.inc] = char(value and 0xFF) |
13:11:34 | * | dddddd quit (Ping timeout: 240 seconds) |
13:11:52 | Yardanico | but why do you need this proc for only one occurence? |
13:12:07 | Yardanico | *occurrence |
13:12:16 | FromGitter | <Grabli66> It's not once in my code |
13:12:27 | FromGitter | <Grabli66> There is just an example |
13:13:15 | FromGitter | <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:34 | Yardanico | hmm |
13:13:36 | * | Snircle joined #nim |
13:13:37 | Yardanico | is this base64 ? |
13:14:18 | FromGitter | <Grabli66> It's for add uint32 to buffer |
13:14:42 | Araq | you can't write it in one line when you care about buffer overflows |
13:14:51 | FromGitter | <Grabli66> How? |
13:15:37 | * | claudiuinberlin joined #nim |
13:16:49 | FromGitter | <Grabli66> Ohhh. I check buffer before add |
13:24:11 | * | dddddd joined #nim |
13:26:56 | Yardanico | Araq, wait, did you just made a release :P ? |
13:27:23 | Yardanico | I mean v0.17.2 tag |
13:34:19 | Araq | the release is complete when the website tells 0.17.2 is out |
13:34:26 | Araq | the tagging is just a step |
13:34:27 | Yardanico | yeah I know |
13:34:39 | Yardanico | but at least we know exact commit for new release :) |
13:37:18 | * | relax joined #nim |
13:38:25 | * | haha_ joined #nim |
13:39:28 | Arrrr | will reorder by default be included in this release? |
13:39:40 | Yardanico | Arrrr, no |
13:39:47 | Yardanico | well I don't know really |
13:40:03 | Yardanico | but probably in v0.18.0 (if there would be no v0.17.4) |
13:40:48 | crem | What will be after v0.99? v0.100? There was v0.9 not v0.09, right? |
13:40:58 | Yardanico | crem, no jokes pls :P |
13:41:07 | Yardanico | there would be no v99 |
13:41:10 | Yardanico | 0.99 |
13:41:15 | crem | :( Tjat |
13:41:18 | crem | That's sad |
13:41:20 | Yardanico | Arrrr, https://github.com/nim-lang/Nim/pull/6326 |
13:41:38 | * | zielmicha_ quit (Read error: Connection reset by peer) |
13:41:55 | Yardanico | when 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:01 | Yardanico | *implemented |
13:42:03 | crem | also 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:56 | FromGitter | <BigEpsilon> It already compiles wxwidget |
13:57:03 | FromGitter | <BigEpsilon> and nim compiler |
13:57:21 | FromGitter | <BigEpsilon> @Yardanico |
13:57:21 | * | SusWombat quit (Ping timeout: 248 seconds) |
13:57:30 | Yardanico | BigEpsilon: woah |
13:57:49 | FromGitter | <BigEpsilon> I think it will be ready soon |
13:57:56 | Yardanico | BigEpsilon: so you can mark it as "ready" ? :) |
13:58:02 | Yardanico | I mean "test on all compiler modules" and "test on wxWidget wrapper" |
13:58:14 | Yardanico | but cool work anyway |
13:58:22 | FromGitter | <BigEpsilon> yes but it fails on system.nim |
13:58:37 | FromGitter | <BigEpsilon> because it still dont support user defined pragma |
13:59:13 | FromGitter | <BigEpsilon> I'll add that maybe tonight or tomorrow and the update the PR |
13:59:59 | Arrrr | upvoted |
14:00:15 | FromGitter | <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:13 | Yardanico | Grabli66: 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:39 | FromGitter | <Grabli66> Streams module uses proc, not method |
14:04:59 | * | rauss joined #nim |
14:05:44 | Araq | BigEpsilon: afterwards you can work on tyForward :D |
14:06:23 | Araq | we 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:21 | Araq | then 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:34 | Yardanico | Grabli66: yeah, for performance |
14:14:52 | * | claudiuinberlin joined #nim |
14:17:28 | FromGitter | <BigEpsilon> hahaha |
14:17:39 | FromGitter | <BigEpsilon> I have a family and a job ! |
14:18:48 | Araq | sounds familiar |
14:19:28 | Araq | how does reorder: on influence compile times? |
14:22:06 | FromGitter | <BigEpsilon> I didn't check |
14:22:20 | FromGitter | <BigEpsilon> as I m working only with the debug build |
14:22:26 | FromGitter | <BigEpsilon> "nimd" |
14:23:52 | * | gangstacat quit (Quit: Ĝis!) |
14:29:22 | * | PMunch joined #nim |
14:31:50 | Arrrr | We are your new family |
14:32:05 | Yardanico | mwahahaha |
14:33:43 | Yardanico | *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:08 | FromGitter | <BigEpsilon> :P |
14:47:08 | FromGitter | <mratsim> Wow I just discovered that play.nim-lang.org is working. There isn’t even a (stickied?) post on Reddit ! |
14:48:09 | Yardanico | it was working for one month already IIRC |
14:48:54 | FromGitter | <mratsim> I was playing RPGs instead of coding the past month :P |
14:49:50 | FromGitter | <mratsim> I would love to have, C, ASM, JS and PHP (!!!) output :D |
14:52:17 | Yardanico | well php isn't supported at all |
14:52:27 | Yardanico | I actually think that it was an Araq's experiment |
14:52:46 | subsetpark | PHP? gross |
14:53:12 | Yardanico | and there was FASM |
14:53:21 | Yardanico | but it was removed (IDK why, I wasn't using nim this time) |
14:53:30 | Araq | got paid for php |
14:53:38 | Yardanico | ah |
14:55:06 | FromGitter | <mratsim> is it still working? |
14:55:13 | Yardanico | well |
14:55:17 | Yardanico | you *can* use it |
14:55:21 | Yardanico | but many things don't work here |
14:55:26 | Yardanico | I mean MANY |
14:56:02 | subsetpark | Araq, you whore! |
14:58:05 | crem | Any 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:36 | Araq | crem: karax is very simple to use, what do you want to know? |
15:13:10 | crem | If anyone actually used it. :) |
15:14:12 | FromGitter | <Grabli66> Is there are possibility to create singleton in nim? :) |
15:15:54 | Arrrr | What is the problem? |
15:16:51 | FromGitter | <Grabli66> I see no way how to disable of creating object by "new SingletonObject()" |
15:17:06 | FromGitter | <Grabli66> Can't create private constructor. |
15:17:48 | Arrrr | So, if the question is "Can't i disable object construction" no you can't. You can only discourage it |
15:17:52 | Arrrr | *can |
15:18:09 | Yardanico | proc new(t: MyType) = discard lol |
15:18:12 | crem | Sense 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:26 | Yardanico | or no |
15:18:38 | Yardanico | well this works |
15:18:42 | Yardanico | but it's a *hack* |
15:19:02 | Arrrr | You can instantiate objects in global scope, that's your singleton |
15:19:45 | mjanssen | Grabli66 why would you want to disable creating of objects? What is the goal you are trying to achieve? |
15:19:50 | federico3 | you can use global scoped variable and return the same instance or throw an exception |
15:20:16 | Yardanico | well I think he's porting some code from C++ |
15:20:28 | Yardanico | and he doesn't know nim very well (only my thoughts) |
15:20:45 | FromGitter | <Grabli66> proc new(t: GameEngine) = discard |
15:20:46 | Yardanico | so he's just doing the same as he would do in c++ (where possible) |
15:20:47 | FromGitter | <Grabli66> Works |
15:20:49 | FromGitter | <Grabli66> Great |
15:20:51 | Yardanico | but pls don't use it |
15:20:54 | Yardanico | it's ugly as well |
15:21:07 | FromGitter | <Grabli66> It's ugly but i like it :) |
15:21:25 | subsetpark | Yeah 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:27 | Yardanico | Grabli66: 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:46 | Yardanico | just generally |
15:23:37 | FromGitter | <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:47 | Yardanico | well that's always bad |
15:24:04 | Yardanico | because different languages are DIFFERENT |
15:24:32 | Arrrr | I don't think there is a need for singletons in nim because nim doesn't put objects in the center of everything |
15:24:40 | Arrrr | Depends on what you want to achieve |
15:24:53 | Yardanico | well he's doing a game engine :) |
15:25:07 | mjanssen | singletons are just global vars in class based systems |
15:25:13 | FromGitter | <Grabli66> I want a global object with possibility to get it from anywere |
15:25:18 | Yardanico | yes |
15:25:23 | Yardanico | nim allows that |
15:25:31 | mjanssen | Grabli then use the proc with private global solution |
15:25:45 | federico3 | Grabli66 are you releasing the engine and/or can we see an example? :) |
15:26:29 | FromGitter | <Grabli66> No, i am not releasing an engine. I am too old for that :) |
15:27:29 | FromGitter | <Grabli66> mjanssen, good idea. I'll do like this |
15:27:53 | mjanssen | Grabli66 it was subsetpark 's idea. |
15:27:57 | * | coffepot joined #nim |
15:28:10 | coffepot | hey guys |
15:28:52 | federico3 | too... old? |
15:28:52 | * | BigEpsilon quit (Ping timeout: 260 seconds) |
15:29:00 | Yardanico | coffepot, he |
15:29:18 | FromGitter | <Grabli66> Too old for writing engines :) |
15:29:30 | dave24 | def-: ping |
15:29:34 | Yardanico | proc new(t: GameEngine) = discard :) |
15:30:31 | * | MyMind joined #nim |
15:30:50 | coffepot | so, 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:29 | Arrrr | You don't need new to instantiate ref objects, you can do `Object()` |
15:31:50 | coffepot | Arrrr sure but what if you want ref semantics? |
15:32:13 | coffepot | sorry i misread that |
15:32:15 | * | Sembei quit (Ping timeout: 248 seconds) |
15:32:29 | coffepot | it'll still use the lock though even if u instantiate it differently |
15:32:53 | coffepot | is the lock is only for instantiation? |
15:33:06 | Araq | who said anything about locks? |
15:33:31 | coffepot | I 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:57 | coffepot | atomic RC isn't a lock, true |
15:34:07 | coffepot | but it still flushes cores, unless I'm mistaken? |
15:35:34 | coffepot | i 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:05 | coffepot | only 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:13 | FromGitter | <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:58 | coffepot | strings yes, but "atomic RC will be done for ref" implies it's not just strings |
15:38:07 | def- | dave24: pong |
15:38:12 | Arrrr | 1.0 is not even alive, i doubt any plan for 2.0 will survive for too long |
15:39:01 | coffepot | I 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:01 | dave24 | def-: I was wondering; does your bigints library work on 32bit systems? |
15:39:26 | def- | I hope so |
15:39:37 | * | PMunch quit (Quit: leaving) |
15:39:41 | def- | it shouldn't use anything x86-64 specific |
15:40:11 | dave24 | def-: right, I was just not sure because in the TODO it says "Fix the library on 32bit" |
15:40:22 | def- | Oh, then there is probably some bug |
15:41:23 | dave24 | Ah, ok. I'll look for something else, thanks anyway. |
15:41:40 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:45:26 | Araq | coffepot: I'll keep it in mind |
15:46:08 | Araq | I'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:21 | coffepot | Araq: :) 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:21 | coffepot | could* 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:21 | coffepot | don't want to complicate the type system though |
15:54:17 | * | cspar_ joined #nim |
15:54:34 | Araq | it's not just the type system |
15:54:48 | Araq | the current solution has some serious composability problems |
15:55:10 | Araq | but it's good enough for a version 1 esp since the other things are even more unproven |
15:55:54 | coffepot | isn'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:51 | coffepot | Are memory regions here yet, or... will they help? |
15:57:56 | Araq | or protect/dispose and cast to 'ptr' |
16:02:43 | coffepot | definitely 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:40 | coffepot | time for me to go, love all and have a great day/night :D |
16:04:14 | coffepot | *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:05 | Yardanico | Araq, 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:54 | FromGitter | <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:51 | Yardanico | Grabli66: you use threads? then yes, you should care about memory safety |
16:30:59 | ehmry | Grabli66 use a Lock and {.guard.}? |
16:31:12 | FromGitter | <Grabli66> No. I only use async |
16:31:24 | Arrrr | heh |
16:31:39 | Yardanico | then you don't need to care about gcsafe |
16:31:42 | Yardanico | it's just a warning |
16:31:45 | Yardanico | not an error |
16:31:55 | FromGitter | <Grabli66> Ok |
16:33:14 | ehmry | on 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:57 | Yardanico | ehmry, IO is IOEffect |
16:34:23 | Yardanico | ah |
16:34:29 | Yardanico | root effect is just "base effect class; each effect should inherit from TEffect unless you know what you doing." |
16:34:38 | ehmry | yea |
16:34:59 | Yardanico | you 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:45 | ehmry | my 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:25 | Yardanico | it's a warning though |
16:40:51 | ehmry | I 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:20 | odc | hi there |
17:18:41 | odc | is PMunch here? |
17:21:35 | Yardanico | it seems he's not :) |
17:23:04 | odc | yup |
17:24:06 | odc | so, i can't install Aporia : Cannot satisfy the dependency on gtk2 #head and gtk2 1.1 |
17:25:39 | odc | it looks like dialogs and Apora have conflicting dependencies |
17:31:34 | odc | o.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:53 | Araq | that reads like a generic package manager description |
17:57:09 | * | Trustable quit (Remote host closed the connection) |
17:58:15 | dom96 | If something like that happens then please zip up your ~/.nimble and send me it |
17:58:22 | dom96 | together with the command you're running |
18:03:00 | * | skrylar joined #nim |
18:18:44 | odc | dom96: thanks. I'll try to do that next time. |
18:22:26 | * | ofelas joined #nim |
18:24:18 | FromGitter | <Grabli66> Is there build system for nim? |
18:30:22 | dom96 | Nim is the build system |
18:30:34 | FromGitter | <Grabli66> :) |
18:30:34 | Yardanico | yeah |
18:30:46 | Yardanico | you don't need to specify the order of files to compile like in C++/ etc |
18:30:53 | Yardanico | if you need to run some scripts tho, use .nims file |
18:31:22 | dom96 | if you're writing a Nimble package then write your build script in the .nimble file. |
18:32:33 | FromGitter | <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:55 | FromGitter | <Grabli66> Nims? Where i can finde info about it? |
18:34:04 | Yardanico | https://nim-lang.org/docs/nims.html NimScript as a build tool |
18:34:11 | Yardanico | https://github.com/nim-lang/Nim/wiki/Using-nimscript-for-configuration |
18:36:39 | dom96 | Most of these are handled by nimble |
18:37:22 | dom96 | https://github.com/nim-lang/nimble#creating-packages |
18:37:23 | FromGitter | <Grabli66> Ok. I'll try to understand |
18:37:42 | dom96 | And 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:00 | Yardanico | dom96, well I know, but Grabli66 wants to make a build script only for himself |
18:38:30 | FromGitter | <Grabli66> Yes. |
18:38:38 | dom96 | Why? |
18:39:01 | dom96 | But that doesn't matter, you should still use Nimble. |
18:39:22 | Yardanico | why we have 2 different tools for 3 thing then? ah, even 3: nims, nimble, nakwe |
18:39:24 | Yardanico | *nake |
18:39:25 | dom96 | it will manage dependencies for you |
18:39:41 | dom96 | because both predate Nimble |
18:40:09 | FromGitter | <Grabli66> Ok. I'll try nimble |
18:40:18 | Yardanico | well nake can be useful sometimes, when you need to use something which works only with nim |
18:40:21 | Yardanico | e.g. http requests |
18:41:45 | dom96 | You don't need nake for that. The Nim VM let's you execute processes so it's possible, albeit more difficult. |
18:43:56 | Yardanico | well I don't understand why people still use .nims and nake |
18:44:26 | dom96 | then why are you suggesting it? |
18:46:25 | * | rokups quit (Quit: Connection closed for inactivity) |
18:47:03 | * | Jesin quit (Quit: Leaving) |
18:47:18 | FromGitter | <Grabli66> Almost done. But i dont see how to set nimcache directory in nimble file. |
18:47:51 | Yardanico | why do you want to change it? |
18:48:16 | FromGitter | <Grabli66> I dont want it in src directory. |
18:48:56 | FromGitter | <Grabli66> It's not critical, though. :) |
18:50:50 | dom96 | where do you want it? |
18:51:06 | dom96 | you should probably change it in the Nim config. |
18:51:09 | FromGitter | <Grabli66> In project root directory |
18:51:26 | Yardanico | well where you did create .nimble file? |
18:51:30 | Yardanico | you should create it in project root |
18:51:48 | FromGitter | <Grabli66> I create it in project root directory |
18:52:01 | dom96 | You can change this using the --nimcache:<dir> option IIRC |
18:52:11 | dom96 | put this in a yourMainModule.nim.cfg file |
18:55:07 | FromGitter | <Grabli66> Good. It works. Thanks guys |
18:58:42 | * | Matthias247 joined #nim |
18:58:56 | * | couven92 quit (Quit: Client disconnecting) |
19:01:49 | FromGitter | <Grabli66> Can i use uppercase in module names? Nim wan't build if i do. |
19:03:53 | FromGitter | <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:08 | vlad1777d | Hello 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:28 | Yardanico | vlad1777d, no, I think there's no such plans at all |
19:32:30 | Yardanico | why do you want this? |
19:32:54 | Yardanico | and yeah, : is optional if your proc doesn't return |
19:33:08 | vlad1777d | Yardanico, I just asked =) I got used to this in Coffeescript =) |
19:33:23 | Yardanico | vlad1777d, well coffeescript isn't compiled to native binary :P |
19:33:53 | vlad1777d | Yardanico, I know, thanks =) I just asked to know =) |
19:35:03 | * | claudiuinberlin joined #nim |
19:42:17 | FromGitter | <dandevelop> Is it possible to install Nim from source on Windows using only the Visual C++ compiler without having to install mingw? |
19:42:52 | ipjk | dandevelop: I reacalling reading about that, it works, but not 64-bit. Don't quote me on this however. |
19:42:59 | ipjk | recall* |
19:43:45 | * | ShalokShalom_ is now known as ShalokShalom |
19:47:38 | dom96 | dandevelop: what's your reasoning for not using mingw? |
19:48:57 | * | PMunch joined #nim |
19:50:59 | Yardanico | dandevelop: 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:47 | SusWombat_ | whats the fastest way to write to files in nim? |
20:00:24 | Araq | writeBuffer |
20:00:32 | SusWombat_ | 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:55 | salewski | Araq, is there a more general test for this: ((x is ref object) or (x is string) or (x is seq)) |
20:03:11 | salewski | I want to avoid the two or. |
20:03:25 | Araq | you're likely doing it wrong |
20:03:35 | * | gokr joined #nim |
20:03:36 | salewski | What I really want to know is, if I can apply GC_ref on x. |
20:03:41 | Araq | macros should be syntactic, not overly analytical |
20:03:59 | Araq | when compiles(GC_ref(x)): |
20:04:03 | Araq | GC_ref(x) |
20:05:25 | salewski | Thanks. |
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:39 | FromGitter | <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:04 | dom96 | https://nim-lang.org/blog/2017/09/07/version-0172-released.html |
20:41:25 | FromGitter | <dandevelop> Congrats on the new release! |
20:46:33 | * | nsf joined #nim |
20:46:40 | FromGitter | <Yardanico> Yay |
20:46:47 | FromGitter | <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:52 | FromGitter | <Yardanico> Going to update russian wiki rn |
20:47:09 | FromGitter | <Yardanico> I meant :P |
20:48:56 | FromGitter | <Yardanico> Wow, 0.17.0 released on May, 7 |
20:49:09 | FromGitter | <Yardanico> And 0.17.2 on September, 7 |
20:50:32 | Araq | that's actually quite bad for a 0.0.2 release |
20:50:45 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:50:54 | FromGitter | <Yardanico> What do you mean by 0.0.2 ? |
20:51:12 | dom96 | x.x.2 |
20:51:17 | FromGitter | <Yardanico> AH |
20:51:18 | * | Sembei joined #nim |
20:51:20 | dom96 | a minor release |
20:51:24 | FromGitter | <Yardanico> Yeah |
20:52:58 | FromGitter | <Yardanico> Second release for me :) |
20:52:59 | FromGitter | <Yardanico> Nim |
20:53:03 | * | Pisuke quit (Ping timeout: 240 seconds) |
21:05:51 | PMunch | Hmm, how can I take a table or nothing as an argument? |
21:06:04 | PMunch | By using an option? |
21:06:49 | * | ofelas quit (Quit: shutdown -h now) |
21:09:04 | PMunch | Never 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:17 | FromGitter | <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:24 | PMunch | Hmm, type mismatch got (Table[A, B]) but expected one of: TableRef(A, B) |
21:37:23 | PMunch | How do I convert a Table to a TableRef? |
21:40:25 | Araq | you can't, you have to start with one |
21:41:51 | PMunch | Ah, newTable not toTable |
21:44:51 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:59:33 | dom96 | ooh, a £150 donation via PayPal. |
22:00:16 | * | nsf quit (Quit: WeeChat 1.9) |
22:00:33 | TheManiac | when `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:01 | Araq | because you made 'text' a recursive concept definition? |
22:09:37 | * | couven92 quit (Ping timeout: 260 seconds) |
22:10:01 | TheManiac | it's not supposed to be recursive :( |
22:10:15 | TheManiac | Text[C] = concept text |
22:10:24 | TheManiac | text.plain(int, int) is string |
22:10:34 | TheManiac | text.substr(int, int) is string |
22:11:07 | TheManiac | once I've added a `plain` method, the intention is that `Text[char]` is basically a `string` |
22:12:31 | TheManiac | I 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:06 | TheManiac | with great power comes great need for learning... |
22:21:07 | TheManiac | aha. |
22:21:58 | TheManiac | I mistyped above - I have `text.substr(int, int) is Text` and I'm guessing that's what you mean by recursive |
22:22:27 | FromGitter | <zacharycarter> @dom96 I had a look at writing that xz decompression lib and gave up |
22:22:37 | dom96 | D: |
22:22:46 | FromGitter | <zacharycarter> seemed way over my head |
22:23:16 | FromGitter | <zacharycarter> I can't find a relatively simple example in any language, I'm guessing because it's not simple to implement |
22:24:39 | TheManiac | Araq: if I need that, am I SoL? |
22:25:38 | FromGitter | <zacharycarter> def-pri-pub: if you're around this evening please ping me |
22:25:45 | FromGitter | <zacharycarter> I have questions about your PR / the timer module |
22:26:15 | Araq | TheManiac: I'm not a concepts guy |
22:27:10 | TheManiac | aww. I kinda thought you knew everything |
22:27:39 | FromGitter | <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:04 | FromGitter | <zacharycarter> it's only meant to stage data which is then supposed to be ETL'd somewhere or some nonsense like that |
22:28:41 | FromGitter | <zacharycarter> Concepts seem hard TheManiac - I suggest if you get a handle on them writing something up on them |
22:29:42 | TheManiac | so is there a method that takes a string and turns it into a seq[char]? |
22:30:04 | TheManiac | ZacharyCarter: if I ever get that far, I might! |
22:31:33 | FromGitter | <zacharycarter> TheManiac: I think it already is : https://play.nim-lang.org/?gist=e7348b9e9a06581accd7261af3329112 |
22:32:31 | TheManiac | @"foo" seems to work |
22:33:07 | FromGitter | <zacharycarter> oh I see cool |
22:33:17 | FromGitter | <zacharycarter> new trick learned |
22:33:32 | * | gokr quit (Ping timeout: 260 seconds) |
22:38:14 | TheManiac | finally (I hope) is there a way to annotate the type in a function to indicate than it's an enum? |
22:38:44 | TheManiac | i.e. I want to write `proc[F: enum](foo: F)` |
22:39:27 | TheManiac | I'd hoped that `set[T]` would tell me how to do it, but it seems there's compiler magic going on |
22:40:45 | FromGitter | <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:13 | FromGitter | <zacharycarter> TheManiac: https://play.nim-lang.org/?gist=944f1f8e143d0c16ae59fcf6b4ca67f8 compiles and runs for me |
22:48:17 | TheManiac | ooh, 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:52 | TheManiac | but just discovering quite how much I stub my toes when I try to move outside the part of it that I know... |
22:49:01 | TheManiac | Thanks Zachary for all your help! |
22:49:11 | FromGitter | <zacharycarter> anytime! |
22:50:33 | * | cspar joined #nim |
22:52:02 | Araq | cabhishek: Version: 0.17.0 says it still |
22:52:14 | Araq | something has been forgotten to be updated |
22:52:21 | Araq | will fix tomorrow, good night |
22:52:27 | FromGitter | <zacharycarter> night |
22:53:30 | * | pilne joined #nim |
22:55:55 | * | yglukhov quit (Remote host closed the connection) |
22:56:18 | FromGitter | <cabhishek> @Araq thanks |
23:03:58 | FromGitter | <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:35 | FromGitter | <zacharycarter> like this @adamrezich https://play.nim-lang.org/?gist=c0acb94b4b7b15caf4206f90ccce136a ? |
23:15:33 | FromGitter | <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:48 | FromGitter | <zacharycarter> hrm but why do you want to do such a thing since the T goes unused? |
23:18:24 | FromGitter | <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:39 | FromGitter | <zacharycarter> gotcha |
23:19:59 | FromGitter | <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:21 | FromGitter | <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:24 | FromGitter | <zacharycarter> essentially you're declaring the same method three times, I don't think generics change the underlying method signature |
23:20:55 | FromGitter | <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:04 | FromGitter | <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:40 | FromGitter | <zacharycarter> I'd ask again tomorrow when Araq / Dom96 are around |
23:22:48 | FromGitter | <zacharycarter> or Varriount or someone else |
23:22:57 | FromGitter | <zacharycarter> they can probably instruct you better than I can |
23:23:03 | FromGitter | <adamrezich> cool thanks |
23:23:14 | Araq | told you how to do a component system in Nim days ago |
23:25:58 | FromGitter | <adamrezich> y-you did? |
23:28:03 | * | thomasross quit (Remote host closed the connection) |
23:28:15 | TheManiac | OK, I'm stuck again, but this time I'm pretty sure it's a bug |
23:28:16 | TheManiac | https://play.nim-lang.org/?gist=11addf91d42ee54cf0b2b5fcefa3ecd3 |
23:28:25 | * | thomasross joined #nim |
23:28:50 | TheManiac | there's no way `Text[char, Text]` can be a thing |
23:29:32 | TheManiac | And 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:23 | JohnNovak | hi there |
23:56:22 | * | yglukhov joined #nim |
23:59:44 | * | def-pri-pub joined #nim |