<< 24-07-2018 >>

00:00:22FromGitter<Varriount> Quelklef: Looks like one. Isn't an empty object invalid though?
00:00:37FromGitter<Quelklef> That's not the issue; adding fields doesn't fix it
00:00:52FromGitter<Quelklef> But I'll put fields in the bug report for clarity, ty
00:01:55FromGitter<Quelklef> Hm, plain `type Union[X: static[int]] = object \n\t discard` works fine so I guess empty objects are allowed
00:02:20FromGitter<Quelklef> Gotta have singletons somehow!
00:07:55stefanos82without knowing much about it, I have tried typetraits module and variable k is of type Union[0]
00:08:16stefanos82therefore f(k) is not of type Union[0]
00:08:36stefanos82f[0](k) though is, because f[0] matches the type of Union[0]
00:08:43stefanos82I hope I'm not wrong
00:09:11FromGitter<Quelklef> I'm not quite following
00:09:19FromGitter<Quelklef> of course `f(k)` is not `Union[0]`; it's `void`
00:09:23stefanos82f(k) is not of type X
00:09:33stefanos82thus, the error message
00:09:45FromGitter<Quelklef> Of course; it's `void`
00:09:45*BitPuffin quit (Remote host closed the connection)
00:12:38stefanos82OK, so what you don't understand with this code Quelklef?
00:13:24FromGitter<Quelklef> `k` is of type `Union[0]`, so calling `f(k)` should be able to deduce that the free `X` is `0`, since `Union[X]` must be `Union[0]` because it's `k`'s type.
00:14:36stefanos82what about the way f() has been defined?
00:14:50FromGitter<Quelklef> what about it
00:14:57stefanos82look closer to the restriction it had added to its arguments
00:15:05stefanos82to accept only of type static int
00:15:53FromGitter<Quelklef> Yes, and `0` is a static int. The program doesn't work even if it's `f[X](...`, anyway
00:16:02FromGitter<Quelklef> Without `: static[int]`
00:16:07stefanos82therefore, without the explicit use of [0] it won't work
00:16:39FromGitter<Quelklef> Can a static int not be inferred from a type?
00:17:04stefanos82that is something I cannot understand as I have very limited knowledge around Nim...for *now*! lol
00:17:50FromGitter<Quelklef> So, perhaps it should work, perhaps it shouldnt.
00:17:51stefanos82to give you a use, replace f[0] with f[10]
00:18:05stefanos82it's complaining about type mismatch
00:19:46FromGitter<Quelklef> ...it should infer the 0
00:19:51FromGitter<Quelklef> (theoretically)
00:26:06stefanos82actually no
00:26:14stefanos82you can try something if you want
00:26:33stefanos82use import typetraits
00:26:58stefanos82then right after let k add an echo k.type.name
00:27:28stefanos82and as your last line after f[0](k), try echo f.type.name
00:27:31stefanos82and see what it prints
00:27:43FromGitter<Quelklef> `Union[0]`...
00:27:51stefanos82then, add [] right next to f and see the new message
00:28:04FromGitter<Quelklef> Come again?
00:28:14FromGitter<Quelklef> `f0 (k)`? `f (k)`?
00:28:27FromGitter<Quelklef> Oh i missed some of your messages, sorry
00:28:52stefanos82your Union is of a Generic type
00:28:58stefanos82thus the use of [] before ()
00:29:31FromGitter<Quelklef> Wait I have `echo(k.ype.name)` (Union[0])
00:29:33stefanos82by telling it X: static[int], you are limiting the value input this function gets
00:29:38FromGitter<Quelklef> Right
00:30:11stefanos82therefore f.type.name != f[0].type.name
00:30:18FromGitter<Quelklef> Right, I agree
00:30:19stefanos82as it expects a generic type
00:30:25FromGitter<Quelklef> One is instantiated
00:30:58stefanos82if you mean variable k, yes
00:31:09stefanos82don't forget; your f is not a variable, but a proc
00:31:27stefanos82therefore, you need to use the whole signature
00:31:30FromGitter<Quelklef> I mean, can I not consider it a variable referring to a procedure?
00:31:41stefanos82which one, the k variable?
00:31:46FromGitter<Quelklef> `f`
00:31:56FromGitter<Quelklef> Also I mean by "One is instantiated" that `f[0]` is and `f` isn't
00:31:59stefanos82f is not a variable, it's the name of your proc f()
00:32:28FromGitter<Quelklef> `let f = proc(...` though
00:32:40stefanos82you didn't use let f in your gist
00:33:24FromGitter<Quelklef> Oh shoot you can't do `let f = proc ...` for generic procs can you
00:34:06stefanos82I have no idea; I'm checking the manual right now
00:34:13FromGitter<Quelklef> Seems like no
00:34:35FromGitter<Quelklef> I'm just having trouble seeing why `f` being a "name of a function" vs "a reference" is important. But I guess I'll see, please continue
00:34:55FromGitter<Quelklef> Or "an identifier" rather
00:36:05stefanos82I didn't find anything about anonymous proc in generics
00:36:18stefanos82therefore prefer to use the original code you shared in your gist example
00:36:23FromGitter<Quelklef> ok
00:38:11FromGitter<Quelklef> Using a let doesn't seem to work anyway
00:38:46stefanos82with generics, no...unless there is some special magic somewhere that is either not documented or well-hidden and cannot find it.
00:39:12FromGitter<Quelklef> By the way, before we continue, I want to note that the following code does compile:
00:39:52FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b56755832fa1b74086021e4]
00:40:11FromGitter<Quelklef> I don't know if that contradicts your explanation or not; if not, please continue
00:45:11stefanos82this is interesting
00:45:14stefanos82let me analyze it a bit
00:45:17FromGitter<Quelklef> Sure
00:45:27FromGitter<Quelklef> I'll get some cake in the meantime
00:49:22FromGitter<Varriount> Quelklef: Quit poking the Type Theory, you're only going to annoy it. :P
00:51:03*dddddd quit (Remote host closed the connection)
00:51:05FromGitter<Quelklef> haha
00:52:09stefanos82Quelklef: I guess the reason it works it's because X can be of any type
00:52:23FromGitter<Quelklef> Araq's gonna hunt be down if I keep submitting static[T] bug reports
00:52:44stefanos82whereas the X: static[int] limits your generic's use to a static integer type
00:52:47FromGitter<Quelklef> @stefanos82, no; run it with `f[X: static[int]]`. It also works
00:53:03stefanos82yes because it will work with your original type
00:53:19FromGitter<Quelklef> What do you mean?
00:53:31FromGitter<Quelklef> I mean change the code to read `func fX: static[int (v: Union[X]) = ...`
00:53:34FromGitter<Quelklef> It'll still compile
00:53:51stefanos82I use proc, not func
00:53:56stefanos82I have no idea what func is
00:54:08FromGitter<Quelklef> `func X` just stands for `proc X {.noSideEffect.}`. Shouldn't make a difference
00:54:25FromGitter<Quelklef> I just use it out of habit at this point
00:54:26stefanos82OK, tell me again what to check?
00:54:36FromGitter<Quelklef> Here, I'll just paste the code
00:54:43stefanos82sure
00:55:24stefanos82LOL "@dom96: banned"
00:55:31stefanos82what the hell did you do man? :D
00:55:37FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Compiles fine [https://gitter.im/nim-lang/Nim?at=5b5679099ddf5f4aad0419f8]
00:58:41stefanos82yes, because you are not using the when limitations
00:59:00FromGitter<Quelklef> Why would that matter
00:59:29FromGitter<Quelklef> Either way, I assume that it fully instantiates `f`
00:59:39*stefanos82 processes it while drinking wotta!
01:00:00FromGitter<Quelklef> It must, unless it does something fancy like figuring out that `X` does nothing and just removing it from the `Union` definition
01:00:08FromGitter<Quelklef> oh hey cheers I got some water here too
01:01:08stefanos82indeed the problem is with when
01:01:36FromGitter<Quelklef> Evidently, since that's the only time the compiler fails..
01:01:40stefanos82by using the when statement and testing it against 0, you are limiting it to accept only 0 as its static int value
01:01:49stefanos82the rest discards them anyway
01:01:57FromGitter<Quelklef> ...no
01:02:07FromGitter<Quelklef> `X` may be any int, with or without the when
01:02:36stefanos82I didn't say the opposite; I said "the rest discards them anyway"
01:02:38stefanos82meaning
01:02:55stefanos82no matter what value or what type, it discards them as they don't pass the matching criteria in when
01:03:08FromGitter<Quelklef> Ok..
01:03:26stefanos82try f[1](k) which matches the type
01:03:28stefanos82it won't compile
01:03:28FromGitter<Quelklef> Then why does this compile:
01:03:36FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b567ae8c86c4f0b472cf89a]
01:04:12FromGitter<Quelklef> If the error happens because `X` is actually used
01:04:26FromGitter<Quelklef> Also, of course `f1 (k)` won't work, `k` is of `Union[0]`, not `Union[1]`
01:04:37stefanos82OK, let me test this as well
01:07:48stefanos82it compiles because you are not using the data array
01:07:57FromGitter<Quelklef> no
01:07:59FromGitter<Quelklef> no that's
01:08:02FromGitter<Quelklef> no
01:08:32FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Also compiles [https://gitter.im/nim-lang/Nim?at=5b567c10f9ffc4664bfa0dfd]
01:12:09stefanos82I think I got it
01:12:21stefanos82yep, it must be it
01:12:36stefanos82X inside data is of type static int
01:13:01stefanos82and int it's the value input array accepts
01:13:18stefanos82thus it works
01:13:23FromGitter<Quelklef> dude
01:13:26stefanos82it echoes empty array, but works
01:13:38FromGitter<Quelklef> like
01:13:41FromGitter<Quelklef> you're trolling right
01:14:14stefanos82you mean I'm wasting my time instead of sleeping to troll you for fun? yeah, sure...as if I don't have other important things to do!
01:14:33FromGitter<Quelklef> ok, do me a favor
01:14:49FromGitter<Quelklef> change it from `array[X, int]` to `array[X, array[10, char]]`
01:14:58FromGitter<Quelklef> an `array[10, char]` is NOT an `int`, but it still compiles
01:15:17FromGitter<Quelklef> Next you'll say that the issue is there's nothing in the array
01:15:20FromGitter<Quelklef> OK, I'll add something
01:16:25FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Still compiles [https://gitter.im/nim-lang/Nim?at=5b567de9b2411177a2682fb3]
01:16:32FromGitter<Quelklef> Let me guess. The issue is there's only one nested array?
01:16:44FromGitter<Quelklef> Please, let me fix that
01:17:16FromGitter<Quelklef> ```code paste, see link``` ⏎ ⏎ Still compiles [https://gitter.im/nim-lang/Nim?at=5b567e1ce06d7e74099a5937]
01:17:43FromGitter<Quelklef> OK, I'm being mean
01:17:58FromGitter<Quelklef> But if you get any more theories about why it's working, please test them first
01:18:08FromGitter<Quelklef> I really can't help but think you're a troll at this point
01:18:16FromGitter<Quelklef> So if you're not, test your theories
01:18:20FromGitter<Quelklef> And if you are, well, ok
01:22:18stefanos82I have tried to figure out what's going on and indeed seems there's an issue with generics mechanism. Anyhow, I won't continue any further, because you are too exhausted and irritated right now and blasting offenses to me even though I'm doing my best to help you out. Feel free to report your cases to Araq in the form of a ticket with all the necessary steps for reproduction
01:24:29FromGitter<Varriount> stefanos82: Don't forget that generics are a tricky part of the compiler.
01:24:44stefanos82Varriount: I know mate...I know -_-
01:25:07FromGitter<Varriount> It could be worse, you could be trying to debug closure/lambda lifting. >:D
01:26:36stefanos82I'm alright, I have enough traumas from C++'s metaprogramming
01:27:38FromGitter<Quelklef> sorry @stefanos82
01:27:56stefanos82no worries, you need to rest your mind
01:28:24stefanos82and I think as it is, the code works because the test checks *X only* for validation inside data
01:28:30stefanos82the rest it ignores it
01:28:38stefanos82think of it as in C++
01:29:02stefanos82f<T>(T, std::array())
01:29:20FromGitter<Quelklef> Unfortunately, I haven't learned C++
01:29:54stefanos82T is of type static[int] in our case and the rest is not of template's concern, *unless* T is used behind the scenes by std::array()
01:31:51stefanos82in other words, the generics validation takes place *only for X*, for nothing else
01:31:58stefanos82that's why it works as it works
01:32:12stefanos82now...does it work correctly, that is as it should? I have no idea
01:32:24stefanos82but based on what I'm reading, I think it's correct
01:32:31stefanos82I hope I'm wrong, because indeed it looks confusing
01:37:39FromGitter<gogolxdong> @zacharycarter I didn't expect the layout feature that doesn't work to work but merely to try and see , just want to know how does layout and transition works with wasm , there is little reference mentioned this.
01:38:23stefanos82goodnight people
01:38:24*stefanos82 quit (Quit: Quitting for now...)
01:38:31FromGitter<Quelklef> night
01:38:33FromGitter<gogolxdong> good night.
01:43:27FromGitter<gogolxdong> 1) the elements will be created the upon the first render, but the dynamic part has been moved out of the cached children, and is executed on every render. This is the core concept Imba uses for it's lightning fast rendering*
02:13:13*yglukhov[i] joined #nim
02:17:27*yglukhov[i] quit (Ping timeout: 240 seconds)
02:19:19FromGitter<asampal> @gogolxdong what did you mean with that reference from the Imba docs?
02:21:56*dorelix quit (Remote host closed the connection)
02:22:15*dorelix joined #nim
03:02:44FromGitter<gogolxdong> share its core concept which I don't know.
03:03:00FromGitter<gogolxdong> and don't understand.
03:04:28FromGitter<gogolxdong> How to split with re module to split by CreateEnumType(...), CreateDataType(...),CreateManagedType(...) , this `CreateEnumType|CreateDataType|CreateManagedType (*)` doesn't work.
03:06:48FromGitter<gogolxdong> oh ,it should be escaped `[CreateEnumType|CreateDataType|CreateManagedType]\(*)`
03:10:34FromGitter<gogolxdong> no, needs a pair of parenthesis.
03:11:04FromGitter<gogolxdong> this doesn't work.
03:12:57FromGitter<gogolxdong> or scanf* works?
03:25:04*erratic quit (Quit: this server has gone to sleep)
03:34:44FromGitter<Varriount> @gogolxdong Doesn't a square bracket indicate a type class?
03:36:08*erratic joined #nim
03:39:57*endragor joined #nim
03:43:11FromGitter<gogolxdong> re"(CreateEnumType|CreateDataType|CreateManagedType)+.*"
03:43:33FromGitter<gogolxdong> it's a re match not generic
03:44:44FromGitter<Varriount> Yes, but I mean a regular expression type class.
03:46:04FromGitter<Varriount> `re"[123abc]"` will match a single character that is equal to a character between the square brackets.
04:05:58FromGitter<gogolxdong> like how to get the content in parenthesis CreateDataType("vim.fault.CpuCompatibilityUnknown", "CpuCompatibilityUnknown", "vim.fault.CpuIncompatible", "vim.version.version1", None)
04:08:45FromGitter<Varriount> Eh, matching parenthesis with reference can't actually be done, not if they're nested. The regular expression will either stop at the last parentheses in the string or it will stop at th first one
04:09:17FromGitter<Varriount> You might be better off using the peg module.
04:09:31*death916 is now known as death916_
04:09:52*death916_ is now known as death916
04:13:59FromGitter<gogolxdong> good to know, what's the difference between peg and re?
04:20:37FromGitter<gogolxdong> then how to do it in peg?
04:25:58FromGitter<Varriount> @gogolxdong Do you just need to match, or do you need to extract the contents between parenthesis?
04:31:31FromGitter<gogolxdong> first match ,then extract the content between parenthesis.
04:31:43FromGitter<gogolxdong> I tried 'if l =~ peg"CreateEnumType'('@,')'":'
04:34:55FromGitter<gogolxdong> no documentation describe @ in peg?
04:36:09FromGitter<gogolxdong> as in `assert match("(a b c)", peg"'(' @ ')'")`
04:47:40FromGitter<Varriount> @gogolxdong you need to create a rule which matches parenthesis and the contents between them. That role will need to be conditionally recursive.
04:47:45FromGitter<Varriount> *rule
05:05:39*bozaloshtsh quit (Remote host closed the connection)
05:05:47*bozaloshtsh joined #nim
05:05:47*bozaloshtsh quit (Changing host)
05:05:47*bozaloshtsh joined #nim
05:11:34*nsf joined #nim
05:14:28FromGitter<gogolxdong> yeah,it's hard.
05:17:52FromGitter<gogolxdong> What does @ mean in peg
05:23:33FromGitter<gogolxdong> ```if "(a b c)" =~ peg"'(' @ ')'": ⏎ echo matches``` [https://gitter.im/nim-lang/Nim?at=5b56b7d563cf1636bde9e025]
05:23:40FromGitter<gogolxdong> ```import pegs ⏎ if "(a b c)" =~ peg"'(' @ ')'": ⏎ echo matches``` [https://gitter.im/nim-lang/Nim?at=5b56b7dc9ddf5f4aad0495a4]
05:24:52*donotturnoff joined #nim
05:25:01FromGitter<gogolxdong> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
05:35:39*donotturnoff quit (Ping timeout: 244 seconds)
05:42:22FromGitter<Varriount> Why are you using "@"?
05:45:04FromGitter<Varriount> @gogolxdong Are these function calls? If so, what language are they?
05:51:32*donotturnoff joined #nim
05:53:17*donotturnoff quit (Client Quit)
05:59:29FromGitter<Varriount> @gogolxdong https://gist.github.com/Varriount/0cabcc4998f6f784b554bbe31ea16f37
06:06:28*xylef joined #nim
06:11:47FromGitter<gogolxdong> It's https://raw.githubusercontent.com/vmware/pyvmomi/master/pyVmomi/ServerObjects.py.
06:38:10*Vladar joined #nim
06:55:53*yglukhov[i] joined #nim
07:13:41FromGitter<gogolxdong> Can I match and extract at the same time?
07:30:16FromGitter<mratsim> @gogolxdong maybe this would help? https://nim-lang.org/docs/strscans.html
07:58:35*thor77 quit (Quit: ZNC 1.7.0 - https://znc.in)
07:58:52*thor77 joined #nim
08:22:09FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b56e1b126bfd636be4535a4]
08:23:07*yglukhov[i] quit (Read error: Connection reset by peer)
08:23:11FromGitter<gogolxdong> props and methods are array .
08:23:43*yglukhov[i] joined #nim
08:23:49FromGitter<gogolxdong> like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b56e21526bfd636be45365d]
08:31:42FromGitter<gogolxdong> scanf took `[("activePartition"` as props and the rest to the next right parenthesis as methods.
08:35:43FromGitter<gogolxdong> it has to find the matched parenthesis and square bracket which could be nested.
08:36:39FromGitter<gogolxdong> Is this the only capability peg has?
08:41:57*Vladar quit (Quit: Leaving)
08:45:46FromGitter<mratsim> I’m pretty sure you can parse CreateManagedType and then use the JSON module to parse everything else.
08:46:05FromGitter<mratsim> but to be honest this sounds like Perl programming :P
08:46:50FromGitter<mratsim> this seems like stuff that would come from a .cfg or a .yaml file
08:47:18FromGitter<mratsim> parsecfg or nimyaml would be much better and easier to maintain for this.
08:52:06*yglukhov[i] quit (Read error: Connection reset by peer)
08:56:29*Tanger quit (Quit: Leaving)
08:56:59*yglukhov[i] joined #nim
09:09:22*Entropic quit (Ping timeout: 245 seconds)
09:09:51FromGitter<gogolxdong> Will scanp be better?
09:13:58*Entropic joined #nim
09:17:07FromGitter<mratsim> if you need to parse something that is not fixed with potentially recursive brackets, it’s probably much more robust to implement your own, by following the json module lexer/parser
09:17:18FromGitter<gogolxdong> scanf is straightforward and easy to understand but might not be capable to deal with complex nested structured string, scanp resembles EBNF or PEG grammars in which an ordered choice may help.
09:18:55FromGitter<gogolxdong> sadly not familiar enough with PEG.
09:19:26FromGitter<mratsim> alternatively, instead of parsing, if the data comes from your own environment, you can create a domain specific language instead: ⏎ ⏎ https://github.com/mratsim/glyph/blob/master/glyph/snes/opcodes.nim#L8-L23
09:19:42*gangstacat quit (Quit: Ĝis!)
09:19:54FromGitter<mratsim> this way you leverage the Nim parser
09:20:14FromGitter<mratsim> macro that parses this language: https://github.com/mratsim/glyph/blob/master/glyph/snes/private/macros_opcodes.nim#L9
09:21:40FromGitter<mratsim> maybe you can use parseStmt on this string? https://nim-lang.org/docs/macros.html#parseStmt,string
09:24:06FromGitter<mratsim> @gogolxdong try this, it works ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b56f03632fa1b740861495e]
09:26:51FromGitter<gogolxdong> This is encouraging .
09:28:14FromGitter<gogolxdong> we can generate object directly from the result.
09:33:20FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b56f2604b880b3e6a458664]
09:33:28FromGitter<gogolxdong> Error: request to generate code for .compileTime proc: parseStmt
09:37:05FromGitter<mratsim> parseStmt needs data at compile time, let lines should be a const, and for l in lines should be either in a macro or in a static context
09:54:59*gangstacat joined #nim
09:58:27FromGitter<gogolxdong> ```code paste, see link``` ⏎ ⏎ Error: attempt to access a nil address at line of parsestmt. [https://gitter.im/nim-lang/Nim?at=5b56f84363cf1636bdea9768]
10:00:49FromGitter<gogolxdong> firstly write found lines to *ServerObjects* file then staticRead.
10:11:38FromGitter<mratsim> I wonder if staticRead can be used in a static context. Try to assign it to a const first then use the const in static.
10:25:54FromGitter<codem4ster> hi, I have a code like this; ```nim import net proc processClient(client: Socket) {.thread.} = while true: # I want this line as blocking echo client.recv(4096).repr proc main = var socket = newSocket() socket.bindAddr(Port(12345)) socket.listen() var address = "" while true: var client = new Socket socket.acceptAddr(client, address) echo("Client connected from: ", address) processClient client main() ``` how can I
10:25:54FromGitter... make that line as blocking? İs there any method like readBytes or smt?
10:26:44FromGitter<codem4ster> hi, I have a code like this; ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b56fee49ddf5f4aad0558f2]
10:27:52FromGitter<codem4ster> I have a code like this; ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ how can I make that line blocking [https://gitter.im/nim-lang/Nim?at=5b56ff28c579673e6b8f0c76]
10:29:37*NimBot joined #nim
10:32:32FromGitter<gogolxdong> ```code paste, see link``` ⏎ ⏎ the same. [https://gitter.im/nim-lang/Nim?at=5b570040c331e0355213e6fd]
10:33:33*BitPuffin joined #nim
10:33:51FromGitter<mratsim> and if instead of static you use a macro
10:35:05*nc-x joined #nim
10:36:18nc-x@codem4ster Sorry if I misunderstood your question but isn't it already blocking? It returns the data only when it gets 4096 bytes since it does not have any timeout specified.
10:39:18FromGitter<codem4ster> nope nc-x it prints empty data like this `while true:` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5701d626bfd636be459691]
10:41:32euantorAnybody know why `nimble install serial` installs v1.0.0 when there is a `v1.1.0` tag which is greater? https://github.com/euantorano/serial.nim/releases
10:42:33nc-x@codem4ster Which nim version are you on? And OS? It does not do that for me. Once it has all 4096 bytes it prints it all out at once then (for me).
10:50:43*Vladar joined #nim
10:56:17*nc-x quit (Quit: Page closed)
10:57:35FromGitter<codem4ster> windows10, stable 0.18.0
10:59:13*nc-x joined #nim
10:59:29nc-xTry devel. (I am on W10, nim devel)
11:04:14*nc-x quit (Quit: Page closed)
11:08:44*yglukhov[i] quit (Ping timeout: 260 seconds)
11:14:17*yglukhov[i] joined #nim
11:15:31*craigger quit (Quit: bye)
11:18:06*craigger joined #nim
11:21:41*xylef quit (Quit: WeeChat 2.2)
11:26:30*xet7 joined #nim
11:26:36FromGitter<codem4ster> I'm giving up :( I don't want to compile devel version to Win10 as it is time consuming and complicated for me. I wrote this code in Rust, Ruby, Crystal before but couldn't succeeded in Nim. I found socket programming in Nim is hard and buggy. I think this leads to a slow or buggy http server implementation thus httpbeast and jester is slow in benchmark and not support multiplatform. Also I think http server
11:26:36FromGitter... implementation must be threaded not async. From my side I found Nim's web capabilities in this manner is below average, sorry. May be Nim is not the right tool for the web as it claims that its a systems programming language :(
11:33:49*nc-x joined #nim
11:34:41nc-xFrom where did you get the idea that compiling nim is hard? It is essentially a 2 minute process where you just have to copy paste commands from the github readme
11:35:30nc-xI have no experience with socket programming in general so can't comment on that part.
11:38:12FromGitter<codem4ster> where is that 2min readme?
11:39:22federico3dom96: ^^^
11:39:45*nc-x quit (Ping timeout: 252 seconds)
11:40:05FromGitter<codem4ster> https://github.com/nim-lang/Nim#compiling talking about this?
11:40:38FromGitter<codem4ster> how can I run this in windows: `sh build.sh`
11:41:24*nc-x joined #nim
11:41:25nc-x(in the place of sh build.sh you should substitute build.bat on x86 Windows or build64.bat on x86_64 Windows):
11:42:11nc-xBTW i can reproduce your issue now. After the client quits, it runs into an infinite loop and prints empty string.
11:42:28FromGitter<Varriount> codem4ster: Or you can just download the latest stable version of Nim https://nim-lang.org/install_windows.html
11:43:31FromGitter<codem4ster> @Varriount we are talking about compiling devel. I have already have lastest stable.
11:43:37FromGitter<Varriount> I generally download the latest stable version, then use that to compile the latest development version.
11:44:14FromGitter<Varriount> Well then all you need to do is download the development version of the repository, run `nim c koch`, in the devel repository, then run `koch boot`.
11:45:38*nc-x quit (Client Quit)
11:46:08FromGitter<Varriount> Regarding socket programming you appear to be using a lower-ish level library (the net module). I don't know what problems you encountered with async, since I've had fairly good success with it.
11:46:44FromGitter<Varriount> httpbeast wasn't written for cross-platform use, if I recall correctly.
11:47:52FromGitter<Varriount> codem4ster: Are you writing an HTTP client/server?
11:47:55*stefanos82 joined #nim
11:47:59FromGitter<codem4ster> Async uses only one core.
11:48:14FromGitter<codem4ster> I need true power of multithreads :)
11:50:58FromGitter<codem4ster> I'm trying to understand socket implementation. Then I will write a TCP tunnel (Socks server) to my server which will tunnel data Browser -> MyLocal -> MyServer and vice versa.
11:53:51FromGitter<mratsim> For IO you will also need async, otherwise you will block your threads.
11:55:10FromGitter<codem4ster> threads are for that purpose, they can block themselves but the main program will continue to work.
11:55:19FromGitter<mratsim> On Windows the easiest way to get Nim devel and switch between devel and stable is via choosenim: https://github.com/dom96/choosenim#windows
11:55:25FromGitter<Varriount> You really don't want to base your entire model on threads.
11:55:55FromGitter<mratsim> after you just need to do `choosenim devel` or `choosenim stable`
11:56:22dom96Rust is easier when it comes to sockets? Really?
11:56:37dom96That sucks. But what code are you writing?
11:57:12FromGitter<codem4ster> @dom96 sorry but really it is. :(
11:57:25FromGitter<mratsim> @dom96 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b57142505e1cc355308da0a]
11:57:35FromGitter<Varriount> codem4ster: https://corbinsimpson.com/entries/take-a-bow.html
11:57:57FromGitter<codem4ster> this is only the initial part
11:58:31dom96Why don't you simply use async?
11:58:49FromGitter<Varriount> He want's to use a threaded model.
12:00:01FromGitter<codem4ster> hard part in Rust threads are Arc type mutexes.
12:00:17dom96So how did you get this working on Crystal?
12:00:23dom96It doesn't support Windows
12:00:28dom96and it also doesn't support parallelism
12:00:51FromGitter<Varriount> dom96: Oh, does Crystal have a global interpreter lock type thing?
12:01:09dom96No, it just doesn't support parallelism right now
12:01:21FromGitter<codem4ster> im here because it has only concurrency :)
12:01:54FromGitter<Varriount> dom96: Is it possible to start multiple async loops on different threads?
12:02:06dom96Yeah
12:02:19FromGitter<Varriount> And they can accept incoming connections from the same port?
12:02:19dom96That's precisely how you should parallelise in Nim
12:02:25FromGitter<mratsim> @codem4ster : https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/server.nim#L25-L28
12:02:42dom96On Linux, yes.
12:02:53dom96I haven't looked at doing it in Windows yet
12:03:07FromGitter<codem4ster> I tried this but it doesn't work with threads or I couldn't manage it work
12:03:21FromGitter<codem4ster> I made it in Rust in Windows
12:03:30FromGitter<codem4ster> https://doc.rust-lang.org/std/net/struct.TcpListener.html
12:03:45FromGitter<mratsim> iirc dom96 had a “isReady” workaround to use async with threadpool.
12:04:12dom96codem4ster: Are you sure you even need this to be parallel?
12:04:13FromGitter<Varriount> Ugh, threadpool
12:04:14FromGitter<mratsim> But I’m also interesting in a canonical M:N threading example. (I asked on Sunday but no reply).
12:04:30FromGitter<Varriount> I dislike threadpool because it's locked to a global resource.
12:04:45FromGitter<codem4ster> I'm here for this. @dom96 :)
12:04:48FromGitter<Varriount> All you need is one bad library that spawns long-running processes on it, and it becomes useless.
12:06:05FromGitter<codem4ster> I already made this on Crystal with one threaded Fibers.
12:06:18dom96codem4ster: I know, but please explain why you need this to be parallel
12:06:22dom96Why isn't one thread enough?
12:07:41FromGitter<gogolxdong> how to catch the exception in macro?
12:07:53FromGitter<codem4ster> In global manner, and for Nim, all the best benchmarked web servers use the full power of the processors of the server.
12:08:55FromGitter<codem4ster> I'm working in a very big traffic sited company, and I want to make some tests about speed.
12:09:48dom96okay, and where will your program be hosted?
12:09:54dom96Will it be on a Windows server?
12:10:20*dorelix_ joined #nim
12:12:05FromGitter<codem4ster> and for my specific reason for that, I'm using a tunnel to bypass my internet provider's restricted sites. Firefox sends me large amount binary data and I encrypt them on my local computer, and decrypt on my personal server. My local computer is windows and linux.
12:12:27*dorelix quit (Ping timeout: 240 seconds)
12:14:05dom96If you're happy to target Unix (which Win10 supports too with WSL) then you can follow the same approach as httpbeast
12:15:39FromGitter<codem4ster> Browser (Firefox on windows or linux) -> [socks5 data] -> Encrypter(.exe) on my local machine-> [encrypted socks5 data] -> decrypter on my server(linux) -> decrypted data to host (google.com etc...) ...... and going back to my browser with the reverse progress.
12:17:25FromGitter<codem4ster> we have also windows servers in company also (for the first reason I mention)
12:21:12FromGitter<Varriount> dom96: Is httpbeast on TechEmpower?
12:23:05dom96Yes, and in 4 hours we'll have the results: https://tfb-status.techempower.com/
12:23:14FromGitter<Varriount> :O
12:23:17dom96You can already see how well httpbeast did by looking at the raw results
12:23:33dom96If my calculations are correct it's doing well :)
12:24:40FromGitter<codem4ster> it looks like this in Rust; ⏎ https://pastebin.com/Gd0L6C6a
12:25:37FromGitter<Varriount> Hm, this says httpbeast had problems starting/stopping. https://tfb-status.techempower.com/results/a684944d-1888-4467-8155-92d782d42a25
12:25:51dom96.unwrap().unwrap()
12:26:02dom96Varriount: Yes, that's an older run
12:26:05dom96I fixed it
12:26:56FromGitter<codem4ster> if you don't want to catch the exceptions you must write .unwrap() :( Ugly :)
12:27:58dom96From what I can see you can totally do the exact same thing in Nim
12:28:07dom96just use threadpool's spawn
12:29:48dom96although hrm, currently threadpool is limited to a set amount of threads so that might not work
12:29:49FromGitter<codem4ster> is .recv blocking? I need that info.
12:31:02FromGitter<codem4ster> I saw in other language tcp implementations like read, get, recv, bufferedRead etc...
12:31:34FromGitter<codem4ster> every method doing a different read type.
12:31:47dom96it is, but you can also set a socket to be non-blocking: sock.getFd.setBlocking(false)
12:31:56dom96(You'll need to import net, nativesockets for that
12:32:24FromGitter<codem4ster> I need blocking buffered read for 4096 bytes
12:32:56dom96https://nim-lang.org/docs/net.html#recv,Socket,string,int
12:33:21dom96var data = newString(4096); socket.recv(data, 4096)
12:35:01*nsf quit (Quit: WeeChat 2.1)
12:35:10FromGitter<codem4ster> what happens if client send 3 bytes and started to wait data?
12:37:45dom96I'm not 100% sure, but I think it will wait until it gets 4096 bytes
12:40:25euantorIf it's a buffered socket, it waits until client disconnect or full requested amount is received I believe
12:43:28FromGitter<codem4ster> or until it reaches timeout
12:43:32*livcd quit (Ping timeout: 276 seconds)
12:43:34*CcxWrk quit (Ping timeout: 264 seconds)
12:44:53*livcd joined #nim
12:51:04*CcxWrk joined #nim
13:03:47FromGitter<codem4ster> I tried non-blocking but getting this; `Error: unhandled exception: A non-blocking socket operation could not be completed immediately. ⏎ [OSError]`
13:04:00FromGitter<codem4ster> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5723c04b880b3e6a462291]
13:08:27*halirc joined #nim
13:17:03stefanos82codem4ster: where's {.async.} in your main proc?
13:18:45dom96codem4ster: that's not needed
13:18:56dom96er, s/codem4ster/stefanos82/
13:19:11stefanos82ah OK
13:19:27dom96codem4ster: You're calling `recv` on a non-blocking socket
13:19:33dom96The data isn't there
13:19:35dom96that's why you get the error
13:20:42FromGitter<mratsim> @yglukhov : https://forum.nim-lang.org/t/4071
13:21:47*xylef joined #nim
13:28:12FromGitter<codem4ster> this look likes working: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b57296cf02a0977a3f7f205]
13:32:28FromGitter<codem4ster> there is an article here: ⏎ https://www.scottklement.com/rpg/socktut/nonblocking.html
13:33:34FromGitter<codem4ster> is this the error: `Operation Would Block! == Error: unhandled exception: A non-blocking socket operation could not be completed immediately. [OSError]`
13:34:59dom96yes
13:35:27dom96You don't need {.async.} in there
13:35:35FromGitter<codem4ster> ok I will try to handle this
13:35:53dom96In your code at least it doesn't do anything
13:36:11dom96You can check whether a socket is readable using either async or the selectors module
13:37:20*yglukhov[i] quit (Read error: Connection reset by peer)
13:37:56*yglukhov[i] joined #nim
13:39:19stefanos82dom96: do you have any blog or website that you use it to share useful tips and tricks around Nim's advanced topics, such as metaprogramming?
13:39:34dom96nope, just nim-lang.org
13:39:44stefanos82can I suggest something then?
13:40:28stefanos82how about having a place in official docs that you, the core members, share your thoughts on specific topics?
13:41:27stefanos82this way, each author could compliment others' articles by either completing specific concepts or building on top of them
13:43:24stefanos82dom96: much like what nim-lang.org/blog is all about, but more active around programming, than official announcements
13:43:39stefanos82they could be place under a different sub-category
13:43:57stefanos82such as nim-lang.org/announcements
13:44:06stefanos82and blog be clear for discussion
13:49:01FromGitter<codem4ster> `var selector: Selector[???] = newSelector()`
13:49:20FromGitter<codem4ster> how can I use selectors any example?
13:49:52*endragor quit (Remote host closed the connection)
13:51:14dom96type Data = object
13:51:17dom96Selector[Data]
13:51:26dom96selector.register(socket.getFd)
13:51:54dom96echo selector.select(1000)
14:05:18FromGitter<codem4ster> `.register(fd: AsyncFD)`
14:05:25Calinouhttps://hastebin.com/afecokutih.nim
14:05:51Calinouso I'm adding support for 32-bit Windows cross-compilation, however Nim is adding an .exe extension to the GCC path which breaks compilation, but *only* when specifying --cpu:i386
14:06:00Calinouit works if I don't specify (which uses amd64)
15:05:01*ftsf quit (Ping timeout: 244 seconds)
15:10:37*planetis[m] left #nim ("Kicked by @appservice-irc:matrix.org : removing from IRC because user idle on matrix for 30+ days")
15:11:49*couven92 joined #nim
15:22:00*Jipok[m] quit (Quit: removing from IRC because user idle on matrix for 30+ days)
15:32:00*tyrion[m] quit (Quit: removing from IRC because user idle on matrix for 30+ days)
15:38:03*Trustable joined #nim
15:45:29*couven92 quit (Read error: Connection reset by peer)
15:51:21*marszym[m] quit (Quit: removing from IRC because user idle on matrix for 30+ days)
15:52:32*libman[m] quit (Quit: removing from IRC because user idle on matrix for 30+ days)
15:55:03FromGitter<gogolxdong> How to re match ` CreateEnumType(...), CreateDataType(...),CreateManagedType(...) `
15:55:44*Flox[m] quit (Quit: removing from IRC because user idle on matrix for 30+ days)
15:57:52*ng0 joined #nim
15:57:52*sroecker[m] quit (Quit: removing from IRC because user idle on matrix for 30+ days)
15:58:50FromGitter<Varriount> @gogolxdong Use the pegs module.
15:59:00FromGitter<Varriount> I posted that gist that matches the function calls.
16:12:41*Ven`` joined #nim
16:29:41dom96https://www.techempower.com/benchmarks/#section=test&runid=2a8f2912-c4a2-4c32-a576-b1e2e932a906&hw=ph&test=json
16:30:00dom96#17
16:30:12dom96and wow, apparently my jester optimisations are pretty freaking awesome
16:30:18dom96because it's #18
16:30:38FromGitter<Vindaar> awesome work, congrats! :)
16:31:05dom96far more overhead evident in plaintext for Jester
16:31:11dom96#8 vs. #25
16:31:54dom96For plaintext I think the top 13 are basically tied
16:32:08dom96They're all IO bound
16:32:22dom96In the last run officefloor-raw was #1
16:32:37dom96So I wonder what happened there
16:33:16FromGitter<Varriount> dom96: Huh, why do the results not show up in the "latest round" tab?
16:33:35dom96Because the latest round was done a month ago
16:33:46dom96Rounds are rarer
16:33:57dom96They have a CI that runs the benchmarks too
16:34:00dom96which is what you're seeing
16:34:14FromGitter<Varriount> Also, shouldn't JSON be slower than plaintext?
16:34:22dom96it is?
16:41:27*Sembei quit (Ping timeout: 240 seconds)
16:41:49*Pisuke joined #nim
16:46:50FromGitter<rayman22201> Congrats @dom96!
16:48:13dom96Thanks :D
16:51:47Calinouhttps://hastebin.com/afecokutih.nim
16:51:47Calinouso I'm adding support for 32-bit Windows cross-compilation, however Nim is adding an .exe extension to the GCC path which breaks compilation, but *only* when specifying --cpu:i386
16:51:47Calinouit works if I don't specify (which uses amd64)
17:16:08Calinounevermind, it was my fault… I had 64-bit GCC symlinked to the .exe name but not the 32-bit one
17:16:19CalinouI just checked, the produced binary is 32-bit so it's working :)
17:18:10*yglukhov[i] quit (Read error: Connection reset by peer)
17:18:46*yglukhov[i] joined #nim
17:19:52FromGitter<alehander42> wow very nice results @dom96
17:20:33FromGitter<alehander42> why are java libs so far ahead in those :O
17:27:58*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:36:00CalinouJava is still pretty fast today
17:36:14Calinouit does power that voxel game :) even though it uses significant native (C) parts thanks to LWJGL
17:37:26zacharycarter[m]not anymore
17:37:31zacharycarter[m]they rewrote it in C++
17:38:02zacharycarter[m]xbox one / ps4 won't run java anyway so there was no way it was going to those platforms as a java app
17:38:23Calinouwell, it depends on whether you still consider the Java Edition the prime option for playing Minecraft
17:38:26zacharycarter[m]or iOS for that matter
17:38:30Calinou(for the vast majority of power Minecrafters… it is :P)
17:38:42zacharycarter[m]it's the shitty edition
17:38:43zacharycarter[m]because notch wrote it
17:38:52CalinouI've never played any other edition
17:39:06zacharycarter[m]I've never played minecraft
17:39:10Calinouheh
17:39:11zacharycarter[m]so I can beat you there
17:39:47Yardanicoyou can go to #nim-offtopic btw:)
17:42:59*thomasross quit (Remote host closed the connection)
17:43:23*thomasross joined #nim
17:47:10Yardanicohttps://github.com/dylanbeattie/rockstar currently trending on github :D
17:53:35FromGitter<rayman22201> so, @dom96, what bottlenecks are left in httpbeast? what needs to happen to get it into the top 10? :-D
17:54:35Calinouhttps://gitlab.com/Calinou/clr/-/jobs/84073188 :|
17:54:41Calinouit's calling the 64-bit compiler on CI, but it works locally
17:55:07dom96rayman22201: no idea :)
17:56:11FromGitter<rayman22201> time to break out the profiler :-)
18:01:24*TheLemonMan joined #nim
18:02:23dom96It's fast enough. I'm happy with those results :)
18:02:40TheLemonManhello people, I wrote a small lib to detect if your cpu supports a given set of features (eg AVX or SSE), you can find it here https://github.com/LemonBoy/cpu_featuredet
18:03:36TheLemonManas usual I winged the windows/vcc part so feel free to test it (at least before I submit this to the package central)
18:11:57YardanicoTheLemonMan, does it work for osx? https://github.com/jackmott/nim_simd had issues with osx
18:16:26FromGitter<Varriount> dom96: Why isn't it present in the single-request/multi-request categories?
18:16:28TheLemonManYardanico, I think so, unless Apple botched the cpuid implementation :)
18:17:53dom96Varriount: Because I didn't implement that
18:17:58dom96It requires a DB
18:27:01*halirc quit (Quit: Leaving)
18:44:20*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
18:57:48*xylef quit (Quit: WeeChat 2.2)
19:05:17*dddddd joined #nim
19:07:31Calinounew version is up, with 32-bit Windows binaries :) I had to symlink the 32-bit MinGW compiler to the 64-bit one so that Nim picked the right one :|
19:07:31Calinouhttps://github.com/Calinou/clr/releases
19:08:04CalinouI know 32-bit Windows is very uncommon, but surely someone has a 32-bit Windows Vista machine they love to use for color manipulation /s
19:08:12Calinou(it's uncommon in developer circles at least)
19:25:23FromGitter<Varriount> Calinou: Most games are distributed as 32-bit binaries.
19:45:57*Vladar quit (Quit: Leaving)
19:49:23Calinouthat's not true for modern AAA or even indie releases :)
19:49:33Calinouindies often still distribute 32-bit binaries, but many AAAs already went 64-bit only
19:49:38CalinouBattlefield 4 was one of the first, in 2013
19:49:47Calinouthey also don't support Windows XP anymore for the most part
19:50:27Calinouof course, many games have a significant userbase using 32-bit Windows or even Windows XP, so these are going to keep working on those platforms for a while
20:04:45FromGitter<Quelklef> Is the behavior of `shr` and `shl` dependent on endianness?
20:05:04*yglukhov[i] quit (Read error: Connection reset by peer)
20:05:38*yglukhov[i] joined #nim
20:06:42FromGitter<Quelklef> I'm little endian, but `1 shl 2 == 4`. So... no?
20:07:15*Trustable quit (Remote host closed the connection)
20:11:35*stefanos82 quit (Ping timeout: 240 seconds)
20:14:14FromGitter<Quelklef> `18 shr 4` is giving `0` in certain situations, what the hell?
20:14:52FromGitter<Quelklef> `18'u64` to be precise
20:15:59*iffy joined #nim
20:16:09FromGitter<Varriount> What situations would this be?
20:18:53FromGitter<Quelklef> Wait, this is probably my error
20:18:59iffyComing from Python. What's the equivalent of ["a","b","c"][1:]? (I have a seq[string] and I want a new seq[string] with all but the first element). Also, is this the place to ask?
20:19:10FromGitter<Quelklef> But to be sure @Varriount, does shr/shl depend on endianness?
20:19:30FromGitter<Quelklef> I'm trying to understand precisely how they work, and I think my misuse of them is causing the error
20:24:26Araqiffy: right place and it's ["a", "b", "c"][1 .. ^1]
20:25:49iffyAraq: ah, ^1, not ^0 :) Thanks
20:28:24*stefanos82 joined #nim
20:42:28*arecacea1 quit (Read error: Connection reset by peer)
20:42:52*arecacea1 joined #nim
20:47:08*nekits joined #nim
20:49:57*ieatnerds quit (Ping timeout: 240 seconds)
20:57:00*yglukhov[i] quit (Remote host closed the connection)
20:57:35*yglukhov[i] joined #nim
21:02:02*yglukhov[i] quit (Ping timeout: 244 seconds)
21:03:43*Jesin quit (Quit: Leaving)
21:05:53*Jesin joined #nim
21:17:25*iffy quit (Quit: Leaving.)
21:25:57*yglukhov[i] joined #nim
21:38:03FromGitter<Quelklef> !eval 8'u64 shl 64
21:38:13FromGitter<Quelklef> !eval echo(8'u64 shl 64)
21:38:21FromGitter<Quelklef> uhh
21:38:33NimBotCompile failed: <no output>
21:38:45NimBotCompile failed: <no output>
21:38:55FromGitter<Quelklef> !eval echo(int(8'u64 shl 64))
21:39:26NimBotCompile failed: <no output>
21:39:53FromGitter<Quelklef> Ok, whatever. With `nim secret`, it gives `8`. Is that a bug?
21:44:35*yglukhov[i] quit (Remote host closed the connection)
21:58:10*BitPuffin quit (Remote host closed the connection)
22:01:02*Jesin quit (Quit: Leaving)
22:02:40*beatmox quit (Remote host closed the connection)
22:03:10*beatmox joined #nim
22:12:59dom96https://play.nim-lang.org/ is down again it seems
22:13:26dom96zacharycarter[m]: do I need to implement a feature in NimBot that highlights you when this happens?
22:15:53stefanos82Quelklef: I tested it with numpy's uint64 and it returns 8
22:16:03stefanos82so I guess it's the correct output
22:17:27FromGitter<Quelklef> ...odd
22:17:48FromGitter<Quelklef> Maybe it's a C detail
22:17:52FromGitter<Quelklef> that leaked into Nim?
22:19:02stefanos82I have also tried it with C's uint64_t and returns 8 as well
22:20:30FromGitter<Quelklef> This post: https://www.experts-exchange.com/questions/28219698/How-to-left-or-right-shift-all-the-bits-in-a-64-bit-unsigned-integer.html seems to say that it's undefined behavior
22:20:36FromGitter<Quelklef> Hm
22:34:29*icebattle joined #nim
22:45:07FromGitter<honewatson> Well done on your improved benchmarks @dom96
22:48:20*ng0 quit (Quit: Alexa, when is the end of world?)
22:59:57FromDiscord<2vg> wow, httpbeast is god speed 😃
23:05:47FromGitter<gogolxdong> How to transform NimNode which repr is [...] to seq or array?
23:08:22FromGitter<Quelklef> @gogolxdong
23:08:48FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b57b17f6dd1ab572339f856]
23:09:33FromGitter<Quelklef> Ah cool the `{.compileTime.}` pragma doesn't need to be explicitely mentioned
23:19:20FromGitter<gogolxdong> Yes ,it works. I tried newLit repr n[4] ,which n[4] repr is like ["singleHost", "multiHost"]
23:19:50FromGitter<Quelklef> Come again?
23:20:10FromGitter<gogolxdong> and I'm trying to make enum `newEnum(typeIdent,n[4], true,true)`
23:21:17FromGitter<Quelklef> I've no idea what you're talking about
23:21:44*Jesin joined #nim
23:34:50FromGitter<gogolxdong> I'm trying to make enum using newEnum(typeIdent,n[4], true,true), which n[4] repr is like ["singleHost", "multiHost"], wondering whether there is a one line transform to do like what it does as your func.
23:36:06FromGitter<gogolxdong> actually it's ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b57b7e6c0fa8016e7355f4e]
23:36:27*ftsf joined #nim
23:36:56FromGitter<gogolxdong> to strip double quote mask.
23:38:11FromGitter<Quelklef> what's wrong with just using my function and `newEnum(typeIdent, @n[4], true, true)`?
23:41:25FromGitter<Quelklef> How can I use bash escape codes like `\033[1A` with `echo` or `stdout.write`?
23:41:55FromGitter<gogolxdong> n[4] is NimNode, I think this is the only way.
23:42:32FromGitter<Quelklef> `newEnum(typeIdent, @(n[4]), true, true)` should do exactly what you want @gogolxdong
23:43:05FromGitter<Quelklef> Oh fantastic, the terminal module lets me set the cursor position. Never mind!
23:43:33FromGitter<gogolxdong> type mismatch: got <NimNode>
23:43:49FromGitter<Quelklef> Right, you have to put my `@` definition as well
23:48:27FromGitter<gogolxdong> what's the trick of `func` ,does it allow you to overload operator?
23:48:48FromGitter<gogolxdong> without warning.
23:48:50FromGitter<Quelklef> No, `func X` just means `proc X {.noSideEffect.}`
23:52:11FromGitter<gogolxdong> what does this mean `This means that the proc/iterator only changes locations that are ⏎ reachable from its parameters and the return value only depends on the ⏎ arguments.`
23:53:00FromGitter<Quelklef> Essentially, `func` means "I keep to my signature"
23:53:14FromGitter<Quelklef> so if `func` has a `var` parameter, it's allowed to modify that. If it doesn't, it's not
23:53:19FromGitter<Quelklef> It's not allowed to modify any globals
23:53:25FromGitter<Quelklef> It can't print to screen
23:53:26FromGitter<Quelklef> etc etc etc
23:56:02FromGitter<gogolxdong> then debug for `func` is tricky.
23:57:54FromGitter<rayman22201> there is `debugEcho` for that