<< 25-03-2018 >>

00:02:14*arthurz joined #nim
00:27:27*vlad1777d joined #nim
00:28:38*vlad1777d quit (Remote host closed the connection)
00:29:19*vlad1777d joined #nim
00:35:57*yglukhov joined #nim
00:41:21*yglukhov quit (Ping timeout: 240 seconds)
00:59:55*vlad1777d quit (Ping timeout: 256 seconds)
01:04:24*S1tiSchu joined #nim
01:08:33*SitiSchu quit (Ping timeout: 260 seconds)
01:10:28*zolk3ri quit (Quit: leaving)
01:23:42PMunchHmm, would be really neat to have some syntactic sugar for "<long expression> == <one of these values>"
01:25:30*PMunch quit (Quit: leaving)
01:30:56FromGitter<AjBreidenbach> why not `contains`?
01:31:30FromGitter<AjBreidenbach> ```proc contains[T](a: openArray[T]; item: T): bool {..}```
01:35:34FromGitter<AjBreidenbach> `[<one of these values>].contains(<long expression>)`
01:37:04FromGitter<AjBreidenbach> there's also an `in` keyword
01:41:59FromGitter<AjBreidenbach> `<long expression> in <one of these values>` works with iterators
01:47:57*yglukhov joined #nim
01:51:57*yglukhov quit (Ping timeout: 240 seconds)
02:04:45*dddddd quit (Remote host closed the connection)
02:15:03*acidx quit (Quit: Lost terminal)
02:20:11*acidx joined #nim
03:26:53*kinkinkijkin quit (Read error: Connection reset by peer)
03:41:53*kinkinkijkin joined #nim
04:22:47xincognito10[m]1does nim have the same thread safe capabilities as rust? and if not, could it be implemented?
04:23:54*accidental joined #nim
04:25:02*accidental left #nim (#nim)
04:27:08kinkinkijkinnim has different sorts of thread safety from rust iirc
04:28:07kinkinkijkinrust allows pretty liberal thread memory passing but goes out of its way to make it work afaik, while nim is a bit more restrictive
04:28:27xincognito10[m]1ahh okay
04:29:06kinkinkijkinand it makes sense, since nim has a smaller dev base and thread safety and memory liberty at the same time are really difficult things
04:35:00xincognito10[m]1yeah
04:35:34*kinkinkijkin quit (Quit: Leaving)
04:37:19xincognito10[m]1would it be feasible in the future for nim to be compiled to rust?
04:38:17*kinkinkijkin joined #nim
05:04:55leorizexincognito10[m]1: why would you want that? Rust compliation time is horrible the last time I tried.
05:05:50xincognito10[m]1well i was reading about this OS made in rust
05:05:52xincognito10[m]1which seemed pretty cool
05:06:21xincognito10[m]1but i have doubts nim could do something similar
05:06:34xincognito10[m]1if it could that would be awesome
05:06:44xincognito10[m]1imagine a kernel and toolkit written in nim
05:06:53xincognito10[m]1i think i saw an example before
05:07:11xincognito10[m]1but would it be possible for a full scale kernel to be developed?
05:07:15leorizexincognito10[m]1: Every language can, you just need to invest some time in it
05:07:17leorizehttps://github.com/dom96/nimkernel
05:07:36xincognito10[m]1yeah this was the one i saw
05:08:02xincognito10[m]1but is this like a hobby, or could something serious be done with the language?
05:08:28leorizeSerious things can be done with any language.
05:08:52leorizeNim is a system language, so it's easier than say the ones that was designed for applications
05:10:37xincognito10[m]1ahh okay
05:15:06xincognito10[m]1its worth looking into
05:36:10*smt` is now known as smt
05:55:29*miran joined #nim
06:21:02kinkinkijkinI feel of nim more like an applications language
06:21:11kinkinkijkinjust very well-suited to systems tasks for such
06:26:50*kinkinkijkin_ joined #nim
06:27:03*kinkinkijkin quit (Disconnected by services)
06:27:08*yglukhov joined #nim
06:27:09*kinkinkijkin_ is now known as kinkinkijkin
06:30:25shashlickNim is good for any problem - it is expressive and performant so very effective in any domain
06:31:45kinkinkijkinthe fact that it emits C means I can write in nim to contribute to C projects, if I want to create a style mismatch nightmare for the maintainers
06:31:54kinkinkijkinwhich I would never do, but I could
06:32:44kinkinkijkinautogenerated C sounds scary to me, even when it's as small as the stuff the nim C emitter makes
06:35:57*yglukhov quit (Ping timeout: 240 seconds)
07:00:35*nsf joined #nim
07:18:02kinkinkijkinhow good is clang support in nim?
07:18:10kinkinkijkinjust found out openbsd uses clang now
07:18:15kinkinkijkinby default
07:19:04*Vladar joined #nim
07:19:12leorizekinkinkijkin: really good
07:19:29leorizeI used it as the default compiler for nim
07:19:58kinkinkijkingood, because the latest version of GCC provided on openbsd is 4.9.2
07:20:05kinkinkijkinnot even 4.9.4
07:20:29kinkinkijkinwhile openbsd uses the latest version of clang
07:20:35kinkinkijkinI think
07:41:10*miran quit (Ping timeout: 264 seconds)
07:44:25*jaco60 joined #nim
07:47:55*SenasOzys_ quit (Ping timeout: 256 seconds)
07:52:03*rokups joined #nim
08:00:35*jaco60 left #nim ("Textual IRC Client: www.textualapp.com")
08:24:12kinkinkijkinso to clear a named pipe I'm using, I use stream.setPosition(0) followed by stream.flush()
08:24:21kinkinkijkinis the first part unnecessary?
08:24:47kinkinkijkinor possibly harmful
08:40:34*aguspiza joined #nim
08:41:55*SenasOzys joined #nim
08:48:15*FromGitter quit (Remote host closed the connection)
08:48:15*oprypin quit (Quit: Bye)
08:48:32*FromGitter joined #nim
08:48:38*oprypin joined #nim
08:48:56*yglukhov joined #nim
08:49:30*yglukhov quit (Read error: Connection reset by peer)
08:49:40*FromGitter quit (Remote host closed the connection)
08:49:40*oprypin quit (Client Quit)
08:49:55*FromGitter joined #nim
08:50:02*yglukhov joined #nim
08:50:03*oprypin joined #nim
09:01:33*rauss quit (Read error: Connection reset by peer)
09:04:19*rauss joined #nim
09:11:23*endragor joined #nim
09:14:01*xkapastel quit (Quit: Connection closed for inactivity)
09:14:51*endragor quit (Remote host closed the connection)
09:47:42*yglukhov quit (Remote host closed the connection)
09:48:25*yglukhov joined #nim
09:49:52*gokr joined #nim
09:52:27FromGitter<alehander42> so, what would people use if they wanted to make a simple 3d multiplayer in Nim these days?
09:52:57*yglukhov quit (Ping timeout: 268 seconds)
09:53:36kinkinkijkin"simple" and "3d multiplayer" are mutually exclusive methinks
09:54:50kinkinkijkinin any case, look into a nim implementation of the 3d toolkit of your choice, most of them are relatively high-level compared to C bindings
09:57:21FromGitter<mratsim> import doom3 ⏎ ⏎ doom3_start()
09:58:03FromGitter<alehander42> :D ok, imagine a very simple toy game, not battlefield 4
09:58:44kinkinkijkinhow low-level of bindings are you willing to go?
09:59:27FromGitter<mratsim> By the way, for the performance freak, I just analyzed the “fastest way to cast in Nim”™ here: https://github.com/status-im/mpint/issues/3. Conclusion inline proc vs template and casting normally vs casting through pointer doesn’t matter. Assembly produced is the same.
09:59:33kinkinkijkinyou could go with the vulkan bindings if you're willing to go the extra mile for your players and torture yourself learning how to invent the graphical interface
10:01:39livcdWhy not use what Reel Valley uses ?
10:10:28*r3d9u11 joined #nim
10:12:02FromGitter<mratsim> hohoho: https://github.com/nim-lang/Nim/commit/1d9343080de8e19835c3f6568630ba759afbb94f
10:12:06FromGitter<alehander42> @mratsim awesome
10:12:57FromGitter<alehander42> @kinkinkijkin haha, I've played with opengl before, is it the same level of abstraction?
10:13:39kinkinkijkinopengl is to vulkan as python is to c
10:13:47kinkinkijkinI was joking
10:13:49kinkinkijkinbtw
10:14:10kinkinkijkinif you're wanting to make something simple, starting with vulkan is not a good idea unless you already have a vulkan backend implemented
10:17:31*r3d9u11 quit (Ping timeout: 256 seconds)
10:17:38FromGitter<alehander42> @livcd hm, I took a look, but afaik they mostly targeted the browser?
10:18:16kinkinkijkinwebgl is a thing
10:18:20FromGitter<alehander42> on the other hand, I can just make it in the browser using the js backend, but that would be too slow probably
10:18:27kinkinkijkinand the implementation isn't very different from desktop gl
10:18:52FromGitter<alehander42> ah, I see, vulkan is too low level then indeed
10:19:33Yardanicoalehander42: reel valley has native ios/android versions too
10:26:51*SenasOzys quit (Ping timeout: 240 seconds)
10:34:18*Ven`` joined #nim
10:34:22*SenasOzys joined #nim
10:37:05*noonien joined #nim
10:50:08*user1101 joined #nim
10:51:51*Ven`` quit (Read error: Connection reset by peer)
10:57:35*Ven`` joined #nim
10:59:31*leorize quit (Quit: WeeChat 2.1)
11:05:21*endragor joined #nim
11:05:38FromGitter<alehander42> I might try godot for a day, I see they have nim bindings and I an editor that actually works under linux
11:09:08*dddddd joined #nim
11:12:18*nsf quit (Quit: WeeChat 2.0.1)
11:21:58*endragor quit (Remote host closed the connection)
11:25:35*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:28:38YardanicoAraq, on last devel (trying to fix nimyaml) - https://gist.github.com/Yardanico/4908f5b3e5b3409acaeea8aefeca6b2a . Is this a regression in the compiler or an issue in the code itself?
11:32:53Yardanicowell, this is not really related to nimyaml but it's related to nimyaml's test suite
11:36:36Yardanico(I'm just trying to find best way to create configuration file, but I don't want to use json or parsecfg)
11:38:26Yardanicoprobably the only choice for now is toml
11:41:58*miran joined #nim
11:59:13AraqYardanico, huh, that's a bad regression
12:08:03*yglukhov joined #nim
12:08:18*yglukhov quit (Remote host closed the connection)
12:19:14*vlad1777d joined #nim
12:22:12*yglukhov joined #nim
12:22:15*yglukhov quit (Remote host closed the connection)
12:22:31*yglukhov joined #nim
12:23:02*yglukhov quit (Remote host closed the connection)
12:23:20*yglukhov joined #nim
12:23:50*yglukhov quit (Remote host closed the connection)
12:24:35*yglukhov joined #nim
12:24:37*yglukhov quit (Remote host closed the connection)
12:38:09*vlad1777d quit (Ping timeout: 264 seconds)
12:42:32*yglukhov joined #nim
12:53:54yglukhovAraq: thumbs up about openarray slicing!
13:17:24*yglukhov quit (Remote host closed the connection)
13:18:16*yglukhov joined #nim
13:34:03*dddddd quit (Ping timeout: 260 seconds)
13:34:26*dddddd joined #nim
13:34:47*yglukhov quit (Remote host closed the connection)
13:55:33*PMunch joined #nim
13:57:17*NimBot joined #nim
14:05:49*yglukhov joined #nim
14:25:11FromGitter<data-man> @Yardanico: https://github.com/nin-jin/tree.d ⏎ "Simple fast compact user-readable binary-safe extensible structural format." https://habrahabr.ru/post/248147/ :-D
14:28:32Yardanicodata-man: IMO it doesn't look very readable and/or user friendly
14:35:45FromGitter<alehander42> looks cool, but this `\` feels weeird
14:41:01*vlad1777d joined #nim
14:42:02FromGitter<data-man> @Yardanico: You can invent your own "wheel". :) ⏎ http://ogdl.org looks better
14:45:41*BitPuffin joined #nim
14:47:49federico3https://news.ycombinator.com/item?id=16667735 Q about debugging Nim
14:48:38*athenot joined #nim
14:50:49miranwhile you guys are here - i've created my first ever nimble package - https://github.com/narimiran/itertools - if you have any suggestions on how to improve it, let me know....
14:54:17*Trustable joined #nim
15:16:20*nsf joined #nim
15:19:36FromGitter<data-man> @miran: Maybe instead of SomeNumber to use a concept? Then bigints can be used, e.g. Or any other number-like type.
15:19:47Yardanicohow would it look though?
15:21:54mirandata-man: thanks, i will look at it. (i have never used concepts before)
15:23:25dom96miran: looks good :)
15:23:45miranthanks dom96! :)
15:24:49FromGitter<data-man> @miran: Like this https://github.com/unicredit/emmy/blob/master/emmy/structures.nim#L17
15:25:18*xkapastel joined #nim
15:30:56*vlad1777d quit (Ping timeout: 276 seconds)
15:32:35*gokr quit (Ping timeout: 256 seconds)
15:39:56YardanicoBTW, I probably found (one of) the best extension combos for Nim (in VSCode) : Nim extension (of course), Indented Block Highlighting, Rainbow Brackets, vscode-icons (because it has Nim icon!), Git Lens (for git-related info). For my theme I use Monokai Alt
15:40:01*edcragg quit (Quit: ZNC - http://znc.in)
15:40:30*edcragg joined #nim
15:44:20Yardanicohttps://i.imgur.com/Ua2hNFl.png
15:46:39*nsf quit (Quit: WeeChat 2.0.1)
15:46:51dom96Somebody should PR that icons extensions with an icon that works better on dark themes
15:49:53AraqI'm still looking for syntax highlighting without the "semantic" bullshit
15:51:53Araqwhite, yellow, blue, pink are randomly distributed
15:56:04dom96I don't think there is anything semantic here
15:56:07dom96just bad syntax highlighting
15:56:13dom96'of' is blue and 'if' is purple
15:56:18Yardanicoyes
15:56:35YardanicoAraq, vscode-nim detects CamelCase as type or constant
15:56:39Yardanicoany CamelCase
15:56:47Yardanicohttps://github.com/pragmagic/vscode-nim/blob/master/syntaxes/nim.json#L204 and 209
15:57:03Araqdest.add p(n[i], c)
15:57:03Araq # p is yellow
15:57:15Araqthe rest is white.
15:57:27Araqok, so before a '(' turns into yellow
15:58:57YardanicoAraq, colored brackets are because of Rainbow Brackets extension
15:59:23Yardanicoand about p... hmm
16:00:32YardanicoAraq, p is yellow because it's detected as a function call \\b\\w+\\b(?=\\()
16:00:52Yardanicoor not, I don't really know how these syntax files work
16:02:05miranYardanico: this is PascalCase, and this is camelCase ;)
16:02:11Yardanicomiran, yeah, sorry :D
16:03:05dom96The syntax highlighter isn't style insensitive :/
16:03:44*yglukhov quit (Remote host closed the connection)
16:11:42Yardanicodom96, there's only one way to properly highlight nim syntax
16:11:55Yardanicomake a tool based on compiler which will analyse nim files
16:12:07Yardanicoor can nimsuggest do that already?
16:12:22Yardanicoah yes, it can
16:14:09dom96what? why?
16:14:23dom96You don't need a compiler to syntax highlight code
16:17:40Yardanicodom96, how would you do it otherwise?
16:18:08Yardanicoyou'll need to write an addition to the nim extension
16:18:22Yardanicowhich will understand style insensitivity
16:18:25dom96You do exactly what the current extension is doing
16:18:36dom96You write a syntax highlighter
16:18:56dom96querying a compiler is what amounts of semantic highlighting which is what Araq was just complaining about
16:20:25*SitiSchu joined #nim
16:21:51*S1tiSchu quit (Ping timeout: 240 seconds)
16:24:21FromGitter<data-man> NimEdit uses the compiler modules ;)
16:28:37FromGitter<alehander42> @miran very cool lib!
16:29:10FromGitter<alehander42> what is this rawgit that you use to host the docs?
16:29:19miranalehander42: yeah, python's itertools are very cool :) i just translated it :)
16:30:02miranto be honest - i've seen rawgit for the first time yesterday :D when i was looking to see how the other nim packages show their documentations :)
16:30:17*yglukhov joined #nim
16:31:22*yglukhov quit (Remote host closed the connection)
16:37:42FromGitter<data-man> https://github.com/fabiocolacio/Marker pretty cool
16:40:02FromGitter<alehander42> nice, rawgit seems cool
16:46:50FromGitter<mratsim> @Yardanico how is indented block highlighting vs indent rainbow? (which was written by oderwat I think)
17:18:31*nsf joined #nim
17:33:05*oprypin quit (Quit: Bye)
17:33:22*oprypin joined #nim
17:35:58*oprypin quit (Client Quit)
17:36:13*oprypin joined #nim
17:53:35*SenasOzys quit (Read error: Connection reset by peer)
17:53:41*SenasOzys_ joined #nim
17:56:59*xet7 joined #nim
18:02:01*leorize joined #nim
18:03:48*find0x90 joined #nim
18:04:18*find0x90 quit (Client Quit)
18:04:51*xet7 quit (Quit: Leaving)
18:11:34*Snircle joined #nim
18:12:41*flyx quit (Quit: ZNC - http://znc.in)
18:12:55*flyx joined #nim
18:13:52*flyx quit (Client Quit)
18:14:05*flyx joined #nim
18:35:08*arecaceae quit (Remote host closed the connection)
18:35:32*arecaceae joined #nim
18:50:10*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:56:41*yglukhov joined #nim
19:08:05*gokr joined #nim
19:08:22*shadwick joined #nim
19:12:27*miran quit (Ping timeout: 240 seconds)
19:12:30*miran_ joined #nim
19:15:01shadwickHi all -- I'm having some trouble with using asynchttpserver and calling a method. It ends up causing a type error where it says the callback is `Future[void]{.locks: <unknown>}` when it expected `Future[void]`.
19:16:25shadwickI have a `type R = ref object of RootObj` and `type S = ref object of R` with `method get*(r: R): Table[...] {.base.}` and then a definition of `get` for S.
19:16:54shadwickas soon as I use `let s = newS(); discard s.get()` in my callback I get the compilation erro
19:17:38shadwickNim Compiler Version 0.17.2 (2017-09-18) [MacOSX: amd64]
19:21:18*Trustable quit (Remote host closed the connection)
19:22:15PMunchhttps://forum.nim-lang.org/t/3410
19:22:54PMunchshadwick ^
19:23:46shadwickI had a feeling there'd be a global variable somewhere but I only looked ~1 file deep.
19:25:08shadwickBut what's weird is that my method does *nothing*. It literally does `new(result)` and nothing else. It still gives me the exception as soon as I make a call to `s.get()`
19:25:43PMunchDo you have a minimal code snippet?
19:26:07shadwickLemme finangle this into one.
19:34:09shadwickPMunch: https://pastebin.com/raw/SBQ3tSGB
19:34:16dom96Pretty sure methods add some effects which changes your callback proc's signature
19:35:16dom96Adding gcsafe fixes it: {.async, gcsafe.}
19:36:17dom960.18.0 gives a better error message for this case
19:37:15shadwickdom96: Thanks -- I'm trying to find the docs on `gcsafe`. If I start to do GC-unsafe things inside that method will they not be caught if I have put that on the signature?
19:37:55dom96good question, I'm not sure
19:38:00*gokr quit (Quit: Leaving.)
19:38:08dom96I don't use methods often so I'm not sure exactly how they interact with gc safety
19:38:17dom96but you can easily test this
19:40:11shadwickTrue. I don't actually need to use dynamic dispatch here so I'll just stick to static to avoid this for now. Good to know about the `gcsafe`, though
19:40:22shadwickAnd I'll upgrade to 0.18.0 hopefully soon haha
19:43:44*NimBot joined #nim
19:44:02*gokr joined #nim
19:48:16FromGitter<abijahm> guy how do you copy data from one futurestream to another
19:51:09*yglukhov quit ()
19:52:05*arthurz quit (Ping timeout: 240 seconds)
19:52:34*yglukhov joined #nim
19:52:51dom96abijahm: currently you have to manually read from one and write to the other
19:53:00dom96The implementation of futurestreams might change in the future.
19:55:56*arthurz joined #nim
19:57:50FromGitter<abijahm> @dom96 thanks another question how do you deal with large file uploads in asynchttpserver without using alot of memory
19:59:31*rokups quit (Quit: Connection closed for inactivity)
20:00:14dom96you'd have to patch asynchttpserver for that I think
20:01:20*miran_ quit (Quit: Konversation terminated!)
20:04:34*shadwick quit (Ping timeout: 264 seconds)
20:04:40FromGitter<abijahm> ok thanks
20:10:34*SenasOzys_ quit (Ping timeout: 264 seconds)
20:18:48*SenasOzys_ joined #nim
20:19:53*PMunch quit (Quit: leaving)
20:24:52*nsf quit (Quit: WeeChat 2.0.1)
20:33:34*S1tiSchu joined #nim
20:33:35*S1tiSchu quit (Read error: Connection reset by peer)
20:35:45*SitiSchu quit (Ping timeout: 256 seconds)
21:10:48*vlad1777d joined #nim
21:41:51*find0x90 joined #nim
21:42:39*sz0 joined #nim
21:55:04shashlickare there some examples on how to pass params to macros? with or without static[] etc
21:55:13shashlickkeep getting type mismatch
21:55:59*Vladar quit (Quit: Leaving)
21:57:37*find0x90 quit (Quit: find0x90)
22:08:18*kinkinkijkin quit (Read error: Connection reset by peer)
22:10:01*xet7 joined #nim
22:10:17*SenasOzys_ quit (Read error: Connection reset by peer)
22:10:48*SenasOzys joined #nim
22:11:34*SenasOzys quit (Remote host closed the connection)
22:12:17FromGitter<data-man> @shashlick: tests/macros dir ? tstaticparamsmacro.nim, e.g.
22:13:32shashlick@data-man - if I have the following macro signature
22:13:33shashlickmacro setupDepFile*(filename: string, autowrite: bool): untyped =
22:13:54shashlickif not fileExists(filename) fails
22:19:26*kinkinkijkin joined #nim
22:23:33FromGitter<data-man> ```macro setupDepFile*(filename: static[string], autowrite: bool): untyped =```
22:33:39*leorize quit (Quit: WeeChat 2.1)
22:41:56*noonien quit (Quit: Connection closed for inactivity)
22:44:53*shadwick joined #nim
22:49:58*shadwick quit (Ping timeout: 268 seconds)
22:50:27*vlad1777d quit (Ping timeout: 240 seconds)
22:57:28*NimBot joined #nim
23:01:47*BitPuffin quit (Remote host closed the connection)
23:05:40*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
23:11:10*Snircle joined #nim
23:18:00*kinkinkijkin_ joined #nim
23:20:46*kinkinkijkin quit (Ping timeout: 264 seconds)
23:29:46*JacobEdelman quit (Ping timeout: 264 seconds)
23:30:01*joshbaptiste quit (Ping timeout: 252 seconds)
23:30:17*JacobEdelman joined #nim
23:57:02*joshbaptiste joined #nim