00:00:24 | * | thomasross joined #nim |
00:00:38 | * | rnrwashere joined #nim |
00:01:08 | * | vivus quit (Remote host closed the connection) |
00:02:35 | * | rnrwashere quit (Remote host closed the connection) |
00:04:15 | * | rnrwashere joined #nim |
00:06:40 | * | rnrwashere quit (Remote host closed the connection) |
00:10:33 | * | rnrwashere joined #nim |
00:16:57 | * | rnrwashere quit (Remote host closed the connection) |
00:17:11 | * | rnrwashere joined #nim |
00:23:00 | * | rnrwashere quit (Remote host closed the connection) |
00:24:02 | * | rlr quit (Read error: Connection reset by peer) |
00:26:17 | * | rnrwashere joined #nim |
00:26:24 | * | tiorock joined #nim |
00:26:25 | * | rockcavera quit (Killed (adams.freenode.net (Nickname regained by services))) |
00:26:25 | * | tiorock is now known as rockcavera |
00:42:54 | FromGitter | <gogolxdong> In a sdl2+nuklear GUI context, which to set the font, sdl2 or nuklear? |
00:45:46 | FromGitter | <zacharycarter> https://twitter.com/Hahaitsfunny/status/1047996844872224768?s=19 ⏎ Very personal - but hopefully sharing will give someone else encouragement / hope ⏎ Please also RT if you think my message / sentiments are valid. Id appreciate the support in many ways. |
00:50:50 | FromGitter | <zacharycarter> @gogolxdong sdl2 is backend agnostic so the draw calls would come from sdl2 / opengl |
00:54:07 | FromGitter | <gogolxdong> ok, thanks. |
00:58:44 | * | owner_ joined #nim |
00:59:08 | * | owner_ is now known as Guest74242 |
00:59:46 | FromGitter | <zacharycarter> Err i meant nuklear is backend agnostic - @gogolxdong - my bad |
00:59:54 | FromGitter | <zacharycarter> Not sdl2 |
01:00:21 | * | Tortice quit (Ping timeout: 252 seconds) |
01:00:31 | FromGitter | <zacharycarter> Sdl2 is very oriented towards the OpenGL drawing api |
01:00:48 | * | vlad1777d quit (Ping timeout: 272 seconds) |
01:03:13 | * | Guest74242 quit (Remote host closed the connection) |
01:03:40 | * | Guest74242 joined #nim |
01:22:01 | * | Guest74242 left #nim (#nim) |
01:22:22 | * | Tortice joined #nim |
01:24:51 | FromGitter | <gogolxdong> Is this the way to set font ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb6bd63271506518dbb2929] |
01:25:10 | FromGitter | <gogolxdong> got ⏎ A s s e r t i o n f a i l e d ! ⏎ ⏎ P r o g r a m : D : \ n i m n u k l e a r \ d e m o \ s d l _ o p e n g l 3 \ g u a r d i a n . e x e ⏎ F i l e : C : \ U s e r s \ l x d o n \ . n i m b l e \ p k g s \ n i m n u k l e a r - 0 . 1 . 0 \ n i m n u ... [https://gitter.im/nim-lang/Nim?at=5bb6bd766e5a401c2d1afa08] |
01:40:03 | FromGitter | <zacharycarter> @gogolxdong - I guess not - I'm guessing you need to invoke some other function which is going to produce a pointer or something to pass to the font_atlas_add - I think a lot of your frustration/ friction with nuklear is the lack of docs behind the lib - which I undrestand because it's composed by a single author / a huge library |
01:40:31 | FromGitter | <zacharycarter> I'd suggest looking at how other backends (and really you should be looking at the straight OpenGL / other drawing API backends - not ones that leverage frameworks like SDl2) to see how they're doing things |
01:40:49 | FromGitter | <zacharycarter> most likely that's the behavior you need to replicate - so it might be a C function pointer or a pointer to a C struct |
01:41:10 | FromGitter | <zacharycarter> but you're going to have to figure out what is needed - and then make sure you're passing the correct consrtuct to the API |
01:41:40 | FromGitter | <zacharycarter> it's difficult to reason about what is wrong from a Nim view - because the original API is written in C, and whatever Nim interop code exists - needs to adhere to that interface |
01:42:35 | FromGitter | <zacharycarter> I know the example I constructed isn't a full representation of the nuklear API - not to mention it's extremely outdated - but you should be able to find other usages of the library / see how it's being used / how other bindings call it |
01:44:30 | * | rnrwashere quit (Remote host closed the connection) |
01:56:45 | * | rnrwashere joined #nim |
01:58:01 | * | xet7 quit (Remote host closed the connection) |
02:04:13 | shashlick | TheLemonMan, ng0: so nimzbar now compiles fine on Windows and Linux |
02:05:56 | * | Tortice quit (Remote host closed the connection) |
02:06:43 | shashlick | @zacharycarter, @gogolxdong, @AlexMax: are we there yet as far as replacing nuklear-nim with nimnuklear in nimble? |
02:07:26 | * | xet7 joined #nim |
02:10:03 | FromGitter | <zacharycarter> I has no idea |
02:10:17 | FromGitter | <zacharycarter> I've been so out of touch with Nim and game dev since I started trying to care about work |
02:10:34 | FromGitter | <zacharycarter> but that care is quickly fading / pretty much non-existant at ths point |
02:10:43 | FromGitter | <zacharycarter> so I'm hopefully shortly going to be focusing again more on Nim game dev |
02:11:12 | FromGitter | <zacharycarter> and hopefully - if I can pony up - that means more maintenance and usage of these bindings / libs I've authored |
02:11:28 | FromGitter | <zacharycarter> and also - hopefully I can help out with their new incarnations / stabilization |
02:12:04 | FromGitter | <zacharycarter> but I've been going through a massive amount of personal issues - like I'm already a very unstable individual and I deal with a lot of mental health issues - so I'm not great at managing time and resources |
02:12:33 | FromGitter | <zacharycarter> and what little time I can find to concentrate on personal projects - often ends up taking a very sparatic / non-focused form |
02:13:18 | FromGitter | <zacharycarter> but I'm trying to work through these things and find a new job / opportunity that allows me to grow in the areas I want to but also allows me to flex my strengths - so I think once I get through this personal hell - I'll be a much more useful contributor to Nim and its ecosystem |
02:13:23 | FromGitter | <zacharycarter> especially in regards to game development |
02:13:46 | FromGitter | <zacharycarter> until then - I'm pretty much just useful for creating libraries and bindings and not being able to spend much time keeping them up to date / maintaining / improving them |
02:14:03 | FromGitter | <zacharycarter> I'm just spread very thin in terms of personal pursuits and not getting fired at work |
02:18:09 | shashlick | no worries, we'll see how it goes then |
02:24:53 | * | rnrwashere quit (Remote host closed the connection) |
02:25:46 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb6cba9435c2a518e533e94] |
02:25:57 | FromGitter | <gogolxdong> https://github.com/vurtun/nuklear/issues/505 |
02:25:58 | * | rnrwashere joined #nim |
02:32:29 | FromGitter | <gogolxdong> change msyh.ttc to other font.ttf works. |
02:33:09 | FromGitter | <gogolxdong> but doesn't display the input method. blind typing. |
02:37:19 | * | xet7 quit (Remote host closed the connection) |
02:45:07 | * | tiorock joined #nim |
02:45:07 | * | tiorock quit (Changing host) |
02:45:07 | * | tiorock joined #nim |
02:45:07 | * | rockcavera is now known as Guest8873 |
02:45:07 | * | Guest8873 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
02:45:07 | * | tiorock is now known as rockcavera |
02:46:46 | dom96 | hello guys |
02:49:05 | FromGitter | <malkomalko> 👋 |
02:52:03 | * | rockcavera quit (Ping timeout: 268 seconds) |
03:02:57 | FromGitter | <malkomalko> TIL about the `gui` lldb command. Pretty neat as I explore debugging nim applications. |
03:07:00 | * | rockcavera joined #nim |
03:07:00 | * | rockcavera quit (Changing host) |
03:07:00 | * | rockcavera joined #nim |
03:07:52 | * | rnrwashere quit (Remote host closed the connection) |
03:08:59 | * | rnrwashere joined #nim |
03:11:05 | * | rnrwashere quit (Remote host closed the connection) |
03:13:06 | * | rockcavera quit (Ping timeout: 252 seconds) |
03:14:25 | * | rockcavera joined #nim |
03:14:25 | * | rockcavera quit (Changing host) |
03:14:25 | * | rockcavera joined #nim |
03:16:55 | * | rnrwashere joined #nim |
03:19:09 | * | rockcavera quit (Ping timeout: 252 seconds) |
03:20:05 | * | rockcavera joined #nim |
03:20:05 | * | rockcavera quit (Changing host) |
03:20:05 | * | rockcavera joined #nim |
03:20:55 | FromGitter | <bung87> what’s the `x[i]` operate for float in c++ ? bit operation? |
03:21:28 | * | dddddd quit (Remote host closed the connection) |
03:21:51 | * | tiorock joined #nim |
03:21:51 | * | rockcavera is now known as Guest3840 |
03:21:51 | * | tiorock quit (Changing host) |
03:21:51 | * | tiorock joined #nim |
03:21:51 | * | Guest3840 quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
03:21:51 | * | tiorock is now known as rockcavera |
03:23:45 | * | rnrwashere quit (Remote host closed the connection) |
03:26:22 | * | rockcavera quit (Ping timeout: 246 seconds) |
03:29:03 | * | rnrwashere joined #nim |
03:31:01 | * | rnrwashere quit (Remote host closed the connection) |
03:31:58 | * | endragor joined #nim |
03:33:25 | * | rnrwashere joined #nim |
03:33:34 | * | yemelBz joined #nim |
03:34:37 | * | darithorn quit () |
03:34:40 | * | yemelBz quit (K-Lined) |
03:45:15 | * | chemist69 quit (Ping timeout: 252 seconds) |
03:45:45 | FromDiscord_ | <treeform> I kind of expected a way to generate query string like "?a=1&b=2" from {a: 1, b: 2} some place in nim stdlib, maybe https://nim-lang.org/docs/uri.html, but I can't find it? |
03:47:08 | * | chemist69 joined #nim |
03:48:15 | * | gangstacat quit (Quit: Ĝis!) |
03:49:12 | * | rockcavera joined #nim |
03:49:12 | * | rockcavera quit (Changing host) |
03:49:12 | * | rockcavera joined #nim |
03:53:22 | * | rnrwashere quit (Remote host closed the connection) |
03:55:37 | * | rnrwashere joined #nim |
03:55:45 | * | rnrwashere quit (Remote host closed the connection) |
03:55:47 | dom96 | treeform: don't think so. I've got a PR open to go the other way: https://github.com/nim-lang/Nim/pull/7761/files |
03:56:02 | dom96 | Blocked by Araq :( |
03:56:36 | dom96 | but it should be easy to fix |
03:56:42 | dom96 | feel free to do that if you'd like |
03:59:04 | FromGitter | <7sDream> Does anyone know which online nim ice/code runner has been upgraded to 0.19.0? |
04:01:55 | FromGitter | <malkomalko> anybody use vscode/lldb to debug? I'm trying https://github.com/vadimcn/vscode-lldb but not having much luck |
04:05:34 | dom96 | Join the echo-debug-master-race :P |
04:08:02 | * | rnrwashere joined #nim |
04:09:49 | FromGitter | <7sDream> I can’t create a async proc whose name is a nnkSym from macro/template, is this expected behavior? ⏎ Working on a MWE. |
04:11:48 | dom96 | seems like a bug |
04:11:59 | dom96 | but yeah, these macro-macro interactions are tricky |
04:12:03 | FromGitter | <7sDream> http://ix.io/1ol4/nim |
04:12:29 | * | leorize quit (Quit: WeeChat 2.2) |
04:13:50 | FromGitter | <7sDream> Seems we can’t get symbol’s final output name in compile time |
04:15:07 | FromGitter | <7sDream> line #15 of that MWE is an typo error, please delete it if you want try... |
04:17:43 | * | leorize joined #nim |
04:23:40 | * | narimiran joined #nim |
04:23:50 | FromGitter | <7sDream> Issue #9201 for this bug(?) |
04:26:59 | FromGitter | <bung87> `c_memset` and `nimSetMem` doest exported ? |
04:29:15 | * | nsf joined #nim |
04:42:05 | * | rnrwashere quit (Remote host closed the connection) |
04:43:27 | * | gangstacat joined #nim |
04:44:11 | * | rnrwashere joined #nim |
04:46:18 | * | joshbaptiste quit (Ping timeout: 252 seconds) |
04:47:38 | * | joshbaptiste joined #nim |
04:52:08 | * | redlegion quit (*.net *.split) |
04:52:08 | * | deepend quit (*.net *.split) |
04:57:08 | FromGitter | <kaushalmodi> I am able to init a nested table, but unable to figure out how to assign to it |
04:57:08 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb6ef0182893a2f3ba08128] |
04:57:09 | * | redlegion joined #nim |
04:57:09 | * | deepend joined #nim |
05:03:52 | leorize | I'm surprised that even worked |
05:06:42 | FromGitter | <kaushalmodi> yeah.. as I later find.. the inside should not have initTable |
05:07:02 | FromGitter | <kaushalmodi> but still.. unable to assign values to it |
05:07:04 | FromGitter | <7sDream> I usually make value type to a table, not key type |
05:07:23 | FromGitter | <kaushalmodi> @7sDream I am trying that too.. no success |
05:07:33 | FromGitter | <7sDream> https://glot.io/snippets/f5fge4wv6i |
05:07:36 | FromGitter | <7sDream> Try this |
05:08:05 | leorize | that shouldn't work :/ |
05:08:07 | leorize | weird |
05:08:23 | leorize | inside the those brackets `[]` should only contains typedesc |
05:10:09 | leorize | kaushalmodi: well it's not possible to have table key as an another table if you don't have a hash function for it :P |
05:10:31 | FromGitter | <bung87> why not use tuple inside? |
05:10:45 | * | Tongir joined #nim |
05:11:07 | FromGitter | <kaushalmodi> @bung87 I need nested hash |
05:11:07 | shashlick | Why would you use a table as a key |
05:11:25 | shashlick | I did a nested table in snip, but as a value |
05:11:29 | FromGitter | <kaushalmodi> shashlick: I don't have to.. I was just trying out weird things |
05:11:37 | FromGitter | <kaushalmodi> in the end, I need nested hash |
05:11:38 | FromGitter | <kaushalmodi> :) |
05:11:51 | shashlick | https://github.com/genotrance/snip/blob/master/src/snip/compile.nim |
05:12:00 | FromGitter | <bung87> what do you mean nested hash ? |
05:12:01 | shashlick | See the variable MODES |
05:12:19 | shashlick | Declared in globals.nim |
05:12:43 | FromGitter | <kaushalmodi> @bung87 ⏎ ⏎ https://perlmaven.com/multi-dimensional-hashes |
05:12:59 | FromGitter | <kaushalmodi> shashlick: will have a look |
05:13:14 | FromGitter | <kaushalmodi> @7sDream I am going through your example too |
05:13:36 | FromGitter | <kaushalmodi> trying to understand it, and see if a simpler sugar syntax can be created |
05:14:06 | leorize | here's my take on it: https://ptpb.pw/cSPB |
05:15:17 | FromGitter | <bung87> I cant get the point , the data struct you declared can simply using a tuple as key ,string as value. |
05:15:31 | FromGitter | <7sDream> (https://files.gitter.im/nim-lang/Nim/7HfE/Xnip2018-10-05_13-14-59.jpg) |
05:15:43 | FromGitter | <7sDream> add a new `[]` func to simplify usage |
05:17:33 | FromGitter | <kaushalmodi> Thanks shashlick: https://ptpb.pw/hzms/nim |
05:17:58 | FromGitter | <kaushalmodi> @7sDream Nice! Let me try that |
05:18:10 | FromGitter | <gogolxdong> https://github.com/gogolxdong/guardian |
05:18:28 | FromGitter | <7sDream> https://glot.io/snippets/f5fgoyumwx |
05:18:41 | FromGitter | <bung87> I dont think it’s productive data structure. |
05:18:44 | * | leorize quit (Quit: WeeChat 2.2) |
05:21:27 | shashlick | @gogolxdong nice work! Screen shot would be cool |
05:22:07 | FromGitter | <kaushalmodi> @bung87 I want to do something like .. if nestT[1]["b"] exists, use that, else use nestT[0]["b"], else nestT[1][""], else nestT[0][""] |
05:22:42 | FromGitter | <kaushalmodi> may be I can use tuple as key .. |
05:23:05 | FromGitter | <kaushalmodi> though I am not a data structure efficiency expert.. so I'll try out your approach |
05:23:05 | FromGitter | <bung87> in this case you can simply usiing tuple key. |
05:23:47 | FromGitter | <bung87> when you assign inner table that will assign by copy |
05:24:22 | FromGitter | <gogolxdong> (https://files.gitter.im/nim-lang/Nim/sKYj/image.png) |
05:26:08 | FromGitter | <gogolxdong> (https://files.gitter.im/nim-lang/Nim/t5Va/image.png) |
05:26:52 | shashlick | 👍 |
05:28:58 | shashlick | I've been thinking of writing a chat native client in Nim |
05:29:21 | shashlick | Front end for slack, gitter and so on |
05:30:13 | * | rnrwashere quit (Remote host closed the connection) |
05:30:29 | Tongir | shashlick, Oooh, cool. I banged out some code for hooking up to the Slack RealTime API for v0.18 which would probably still work |
05:34:14 | FromGitter | <kaushalmodi> Thanks @bung87, this is as per your suggestion: https://ptpb.pw/0u01/nim |
05:34:20 | FromGitter | <kaushalmodi> I think this will work. |
05:34:49 | FromGitter | <kaushalmodi> Thanks all: shashlink, @7sDream and @bung87, I learned quite a bit about nested tables :) |
05:35:53 | * | styx_ joined #nim |
05:35:54 | shashlick | Tongir: link? |
05:36:44 | FromGitter | <bung87> you’are welcome :) |
05:37:27 | FromGitter | <7sDream> 😉 |
05:40:17 | * | styx_ quit (Remote host closed the connection) |
05:40:44 | FromGitter | <7sDream> Does anyone have time to look at #9201, Is there a possible solution? |
05:41:54 | Tongir | shashlick, https://github.com/Tangdongle/nim-slack-client |
05:42:48 | Tongir | Some features are half complete. But the general authorisation and websocket connection to the slack RTM worked fined last time I checked |
05:43:05 | Tongir | ~1-2 months ago or something |
05:43:26 | shashlick | Nice work |
05:48:21 | Tongir | If you do end up doing it, I'd love to contribute to the slack integration :D |
05:49:23 | * | narimiran quit (Quit: Konversation terminated!) |
05:50:29 | * | leorize joined #nim |
05:53:26 | * | stefanos82 joined #nim |
06:06:09 | FromGitter | <kaushalmodi> .. coming back to that tuple-key table example: https://ptpb.pw/0u01/nim |
06:06:33 | FromGitter | <kaushalmodi> if I change the int type of orgLevel field in that tuple to Natural, it doesn't compile |
06:07:01 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb6ff855331811c2e50ff5f] |
06:08:20 | leorize | `0.Natural` |
06:08:25 | leorize | That's what you're missing |
06:08:30 | FromGitter | <kaushalmodi> yeah, now I need to do `pnt[(0.Natural, "nim")] = "abc"` |
06:09:06 | FromGitter | <kaushalmodi> seems counter intuitive.. |
06:09:26 | FromGitter | <kaushalmodi> if I have `var foo: Natural`, I can do `foo = 0` |
06:09:44 | FromGitter | <bung87> @7sDream hi,what the use case looks like ? seems you declared a proc that you dont have the proc name |
06:10:17 | leorize | kaushalmodi: The problem with tuples is that they don't have type information |
06:10:29 | FromGitter | <bung87> even you macro work out , I cant see how you get the proc to use |
06:11:09 | leorize | when you create a tuple like `(0, "string")` it won't infer to the tuple type you created, but instead an anonymous `(int, string)` tuple instead |
06:11:21 | FromGitter | <kaushalmodi> leorize: hmm, ok.. so to avoid such verbose code, I should stick to base types in tuples? |
06:11:50 | FromGitter | <kaushalmodi> and then some assert later in the code to prevent illegal field vals |
06:12:11 | leorize | or you could write a `[]` proc that takes a `(int, string)` tuple |
06:13:00 | FromGitter | <kaushalmodi> but `[]` already accept `(int, string)` |
06:13:08 | FromGitter | <kaushalmodi> s/accept/accepts |
06:13:45 | FromGitter | <kaushalmodi> hmm, I think I understood.. let me try that |
06:18:33 | FromGitter | <7sDream> @bung87 I |
06:18:44 | FromGitter | <7sDream> I’m write a DSL for a class |
06:19:36 | FromGitter | <bung87> yeah I can see, you want a anoymous async function like in js |
06:19:43 | FromGitter | <7sDream> a class has method like `addOnMessageListener` |
06:20:09 | FromGitter | <7sDream> so I write a macro, this marco create a proc and set it as a listener |
06:20:23 | FromGitter | <7sDream> so, every time I use this macro, the name should be different |
06:20:47 | FromGitter | <bung87> but when you call `genSym` you did not get the generated symbol. |
06:21:11 | FromGitter | <bung87> then how could you use it ? |
06:21:35 | FromGitter | <7sDream> I reuse the nnkSym node when pass it the the `addOnMessageListener` function |
06:22:28 | FromGitter | <7sDream> So it will use same name in func definition and as a proc variable passed into addOnMessageListener |
06:22:29 | FromGitter | <bung87> you cant , you have no the generated symbol of proc |
06:23:23 | FromGitter | <7sDream> emm, wait for a minute, I’m writing a example(without async) |
06:29:21 | * | nimrodfrfr joined #nim |
06:43:15 | * | Tongir quit (Remote host closed the connection) |
06:43:36 | FromGitter | <7sDream> @bung87 https://glot.io/snippets/f5fj19hfbr |
06:44:09 | FromGitter | <7sDream> uncomment line 60 to see the code generated by macro |
06:50:04 | FromGitter | <bung87> yeah runs without problem |
06:52:28 | FromGitter | <gogolxdong> @bung87 and @7sDream join our Nim in china community and talk in chinese. |
06:53:35 | FromGitter | <gogolxdong> https://discord.gg/pEDQeK |
06:54:24 | FromGitter | <7sDream> I need install discord for my new laptop first... |
06:55:26 | FromGitter | <gogolxdong> It's a piece of cake for you. |
06:57:57 | FromGitter | <gogolxdong> Is it out of blocked ? |
06:59:07 | FromGitter | <7sDream> no, I think. But my shadowsocks is running now(and never stopped) |
07:03:52 | FromGitter | <bung87> `listenerFuncDef.addPragma ident("async”)` you can try do like this |
07:04:26 | FromGitter | <bung87> I cant follow the whole codes, just have some thoughts |
07:05:11 | FromGitter | <bung87> first you code gen listener is inline proc, seems closure proc more suitable. |
07:05:54 | FromGitter | <bung87> second the code gen,set listenner before the listenner proc declared. |
07:06:31 | FromGitter | <7sDream> closure is easy to add, just add it in template listenerFunc |
07:07:18 | FromGitter | <7sDream> but add {.async.} to it will case the #9201 issue |
07:07:39 | FromGitter | <7sDream> not sure about use.addPragma, I’ll try it |
07:09:54 | FromGitter | <7sDream> But I think it won’t change anything, because the error is happened when compile the generated code, whatever the {.async.} is generate by template or macro |
07:09:57 | FromGitter | <bung87> seems more like it calls before it generated. |
07:10:38 | FromGitter | <bung87> maybe needs change the macro parse order. |
07:20:52 | * | Tongir joined #nim |
07:23:29 | * | jjido joined #nim |
07:31:51 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:48:35 | * | kapil____ joined #nim |
07:55:14 | * | krux02 joined #nim |
07:56:16 | * | PMunch joined #nim |
07:57:19 | * | Vladar joined #nim |
07:59:29 | FromGitter | <ephja> is it possible to statically link against a library with the required lib files but without C files declaring the symbols? |
08:00:40 | leorize | what do you mean? |
08:01:50 | FromGitter | <ephja> it should be possible but I dunno maybe it's difficult to implement. of course, the symbols would have to be declared in Nim then |
08:02:11 | FromGitter | <ephja> leorize: the libs that support static linking against a C lib currently require both lib files and the C sources that define the symbols |
08:02:32 | FromGitter | <ephja> which seems like duplicated effort to me |
08:03:15 | leorize | I still don't get it. Could you show me an example? |
08:03:18 | * | gmpreussner quit (Ping timeout: 252 seconds) |
08:03:44 | * | gmpreussner joined #nim |
08:07:25 | FromGitter | <ephja> leorize: like this https://github.com/ephja/nim-glfw/blob/master/glfw/wrapper.nim#L14 but with only static libs (.a/.lib, ...) |
08:08:33 | * | MBS joined #nim |
08:09:46 | leorize | I think just need to `{.passL: "/path/to/lib.a".}`, no C sources necessary |
08:12:25 | * | MBS quit (Remote host closed the connection) |
08:33:16 | FromGitter | <bung87> @7sDream after debuging , the `getName` get nnkSym node, you can try add ` of nnkSym: ⏎ ⏎ ```return node.strVal` in``` [https://gitter.im/nim-lang/Nim?at=5bb721cc3844923661e9587b] |
08:34:07 | leorize | bung87: https://github.com/nim-lang/Nim/pull/9204 |
08:34:15 | leorize | I've already made a PR for it ;) |
08:34:19 | FromGitter | <bung87> and will pass this raise another issue |
08:35:16 | FromGitter | <7sDream> I notice the reason,but not sure get the prefix of sym node will make other part of asyncmacro works |
08:37:21 | FromGitter | <bung87> @leorize cool |
08:50:40 | FromGitter | <tim-st> if that can still be changed without problems, I think the `nimcache` should be named `.nimcache` (prefix dot) |
08:51:08 | FromGitter | <tim-st> chossenim and nimble also have the dot |
08:51:58 | FromGitter | <ephja> leorize: good to know that it's supposed to work. I've had issues with dynamic linking on windows before, and now static linking fails. who knows why it never seems to work. well, I'm gonna try it with Linux |
08:52:01 | leorize | tim-st: nimcache has been moved to ~/.cache/nim so... |
08:52:12 | FromGitter | <tim-st> not on windows |
08:53:26 | leorize | dotfiles doesn't mean anything on windows... |
08:53:52 | FromGitter | <tim-st> it means sort order |
08:54:28 | leorize | is it that important? |
08:55:03 | FromGitter | <tim-st> sure, do you want the three nim folder next to each other or do you want to search in the directory? |
08:55:21 | leorize | the only purpose of dotfile is to hide stuff. The fact that choosenim and nimble use dotfile on windows can be considered a bug |
08:56:55 | FromGitter | <tim-st> VirtualBox, vscode, texlive, ssh, jetbrains, rust, eclipse do it too with prefix dot on windows |
09:00:14 | * | leorize quit (Ping timeout: 272 seconds) |
09:08:27 | * | floppydh joined #nim |
09:22:27 | FromGitter | <mratsim> @bung87 import system/ansi_c -> https://github.com/nim-lang/Nim/blob/devel/lib/system/ansi_c.nim |
09:23:27 | FromGitter | <mratsim> and you can access c_memset |
09:23:59 | FromGitter | <mratsim> or just use reset |
09:24:09 | FromGitter | <mratsim> https://nim-lang.org/docs/system.html#reset%2CT |
09:24:39 | FromGitter | <ephja> doesn't it have to be included since it isn't not exported? |
09:26:07 | FromGitter | <mratsim> it’s not exported by system.nim but the proc live in another nim files with a * marker |
09:55:11 | * | zakora joined #nim |
10:03:26 | * | seni joined #nim |
10:07:40 | * | kapil____ quit (Quit: Connection closed for inactivity) |
10:13:05 | * | Vladar quit (Remote host closed the connection) |
10:21:55 | FromGitter | <bung87> I get confused ,it is not exported |
10:32:28 | FromGitter | <bung87> does all system things implicitly exported? the vscode hints `undeclared identifier: 'c_memset’` even I `import system/ansi_c` |
10:36:00 | * | elrood joined #nim |
10:37:58 | PMunch | bung87, c_memset is not exported from the system/ansi_c module it looks like. Try to `include system/ansi_c` instead of importing it |
10:39:38 | FromGitter | <bung87> wow so any module not exported I can using include to get to use? |
10:40:31 | PMunch | Note that in Nim we have two different ways to interact with modules. Import is the normal one, it reads the file and allows you to use the exported modules without executing anything in the module. Include on the other hand simply copies the module into your code, this means you can now use all procedures (and the exported ones will be visible to modules importing your module) and any code in the main scope will get executed in your module. |
10:40:44 | PMunch | bung87, well yes in a way |
10:41:10 | PMunch | But note that that's not what it's intended purpose is |
10:41:33 | PMunch | If someone has designed a library with non-exported procedures it's probably for a reason |
10:42:26 | FromGitter | <bung87> I also trying to using Nim/lib/system/memory.nim also not exported.. |
10:42:36 | PMunch | include is more intended to be able to split a logical module into multiple files, and to allow certain kinds of things to work (like having a global state variable) |
10:43:35 | PMunch | bung87, all of these modules are included into system |
10:43:47 | PMunch | https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L2981 |
10:44:41 | PMunch | Hmm, but since that's imported into your own module you won't see the symbols |
10:45:08 | PMunch | Not sure why they aren't exported tbh |
10:45:36 | * | leorize joined #nim |
10:45:44 | FromGitter | <bung87> hmm so they just not exported, actually be used. |
10:46:05 | * | vlad1777d joined #nim |
10:54:18 | * | dddddd joined #nim |
10:58:11 | FromGitter | <bung87> ```const uint8_t* codes ⏎ codes[i]``` ⏎ ⏎ `[i]` is it a bit index operatoration, how can I do it in nim ? [https://gitter.im/nim-lang/Nim?at=5bb743c35331811c2e52b22b] |
10:58:31 | FromGitter | <bung87> operation |
11:02:29 | FromGitter | <bung87> found `let d = castptr UncheckedArray[byte (dest)` in /system/memory.nim |
11:09:10 | * | nimrodfrfr quit (Quit: Page closed) |
11:21:44 | * | yoplaid left #nim (#nim) |
11:27:30 | * | rnrwashere joined #nim |
11:31:57 | * | rnrwashere quit (Ping timeout: 252 seconds) |
11:55:38 | * | Vladar joined #nim |
12:05:46 | * | xace quit (Remote host closed the connection) |
12:14:50 | * | Vladar quit (Remote host closed the connection) |
12:15:27 | * | Vladar joined #nim |
12:37:15 | * | seni quit (Quit: Leaving) |
12:46:24 | * | matthewprengerKo joined #nim |
12:51:28 | * | matthewprengerKo quit (Remote host closed the connection) |
12:53:06 | FromGitter | <krux02> @bung87 no in ``codes[i]`` the ``[i]`` is a byte index operation. |
12:54:14 | FromGitter | <krux02> but generally you found a good example, you can cast any pointer to ``ptr UncheckoudArray[byte]`` to interpret the content as bytes |
12:59:45 | * | halirc joined #nim |
13:01:40 | FromGitter | <bung87> @krux02 thanks! if I need define `[]` proc what’s the self type should be? |
13:02:43 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb760f2ae7be94016062c9d] |
13:03:04 | FromGitter | <bung87> currently I have. |
13:03:17 | FromGitter | <krux02> real? |
13:03:30 | FromGitter | <krux02> what do you mean by that? |
13:03:32 | FromGitter | <bung87> yeah `type ⏎ real* = cfloat` |
13:03:33 | FromGitter | <krux02> there is no real type in nim |
13:03:53 | FromGitter | <krux02> why don't you use float32/float64 |
13:04:46 | halirc | Hello. What is the nim way to check if an element is contained in a sequence? I could not find something like a contains/includes proc, do I just iterate through the sequence? |
13:04:53 | FromGitter | <krux02> I think the name ``real`` is very confusing, because it is a float, and there is not a single floating point number that isn't either a rational number or neither rational nor real |
13:05:00 | FromGitter | <bung87> well , wraped cpp source but I want port it to nim |
13:05:20 | FromGitter | <krux02> ok |
13:05:54 | FromGitter | <bung87> in the wraped version it can simplely conversation to cpp |
13:06:00 | FromGitter | <krux02> but still you shouldn't do that |
13:06:15 | FromGitter | <krux02> when real is just an alias for cfloat, you should not overload the [] operator for that type |
13:06:24 | FromGitter | <krux02> it can cause a lot of trouble |
13:06:26 | FromGitter | <bung87> basicly it just follow as the cpp lib as is. |
13:06:47 | FromGitter | <krux02> are you sure? |
13:06:53 | FromGitter | <krux02> can you show me the source? |
13:07:27 | FromGitter | <krux02> It really is a bad coding style to create an operator for such an obscure operation. |
13:07:36 | FromGitter | <krux02> it's better to give it a proper name |
13:07:41 | FromGitter | <bung87> https://github.com/facebookresearch/fastText/blob/master/src/real.h |
13:09:17 | FromGitter | <krux02> something like ``proc readByte*(self: float64, index:int):byte = castptr UncheckedArray[byte (self.unsafeAddr)`` |
13:09:35 | FromGitter | <krux02> and use unsafeAddr to get the addr of the argument |
13:09:59 | FromGitter | <krux02> only with ``unsafeAddr`` you get the addr of a non var argument. |
13:10:09 | FromGitter | <krux02> and the address is what you should cast |
13:10:25 | FromGitter | <krux02> never cast a floating point value to a pointer. |
13:11:10 | FromGitter | <krux02> yea, just ignore that it is called real. It's a bad name, and it's an optional alias anyway. |
13:11:20 | FromGitter | <krux02> a very bad naming convention. |
13:11:28 | FromGitter | <bung87> what if define `[]=` |
13:12:34 | FromGitter | <krux02> ``proc writeByte*(self: var float64, offset:int, value: byte): void = (castptr UncheckedArray[byte (self.addr))[offset] = value`` |
13:13:12 | FromGitter | <krux02> halirc: iterating is definitively what you can do, it makes it very visual that the operation has linear runtime |
13:13:25 | FromGitter | <krux02> otherwise check if sequtils has something for you. |
13:14:28 | FromGitter | <krux02> @bung87 calling a floating point value "real" is not just misleading, it is technically wrong. |
13:14:41 | FromGitter | <krux02> I know some programming languages do that |
13:15:32 | FromGitter | <bung87> good example,interesting codes. |
13:15:34 | FromGitter | <krux02> and aparently there are people who want that (wrong) naming convention in c++ as well. I see myself as a guard to prevent those naming conventions to leak into Nim :P |
13:16:15 | FromGitter | <mratsim> So you’re areal guardian? |
13:16:32 | FromGitter | <krux02> yea |
13:16:37 | FromGitter | <krux02> I am a real guardian :P |
13:17:04 | FromGitter | <bung87> hmmm, since I just want port a lib ,I dont want to judge the author’s codes. |
13:17:21 | FromGitter | <krux02> yea, but that part is really just an alias for a type |
13:17:30 | FromGitter | <krux02> there is no sematic to that type alias |
13:17:34 | FromGitter | <krux02> you can just ignore it. |
13:18:22 | FromGitter | <krux02> it's not like that type is in any way different from a float |
13:18:52 | FromGitter | <krux02> (when I say float, I don't mean float from C, I mean floating point number in general, including float32 and float64) |
13:19:08 | FromGitter | <krux02> (and float16 and float128) |
13:21:10 | FromGitter | <bung87> maybe after I fully port the lib ,I could change it float32 |
13:21:26 | FromGitter | <krux02> yea I just wanted to recommend it |
13:22:58 | FromGitter | <bung87> thanks, you make the codes no red underline in vscode:) |
13:25:06 | * | FlummiRJ joined #nim |
13:25:46 | shashlick | @bung87: are you not using the wrapper? |
13:26:23 | FromGitter | <bung87> no, I ‘m trying to port it to pure nim, almost 5 files now. |
13:29:12 | FromGitter | <bung87> the wrapper version I still can not implements the string representation of vector, have no idea about vector<T> and vector<const T> conversation |
13:30:27 | shashlick | Oh that's unfortunate |
13:31:02 | shashlick | Can you share what you did so far? I'll check later today |
13:31:39 | FromGitter | <bung87> wrapper version? pure nim version? |
13:31:50 | shashlick | Wrapper |
13:31:56 | * | FlummiRJ quit (Ping timeout: 272 seconds) |
13:32:57 | FromGitter | <bung87> https://github.com/bung87/cpp_nim_interop/blob/master/src/cpp_nim_interop/std/vector.nim |
13:34:55 | shashlick | Ok basically interop between seq and vector? |
13:35:01 | FromGitter | <malkomalko> I'm reading Nim in Action and noticed that I can now access the value from `json` by just using `[]` and not needing to add a `str` or `getStr`. Did that change in a recent version of Nim? |
13:35:01 | shashlick | I'll take a look later today |
13:35:12 | FromGitter | <bung87> currently It has memory leak,when you call `toSeq(a)` twice you will see. |
13:36:36 | FromGitter | <zacharycarter> @malkomalko probably |
13:36:37 | FromGitter | <bung87> yeah, when it get ready can simplely replace the fastest proc arg with these friendly types. |
13:36:57 | FromGitter | <zacharycarter> I think you could figure that out for sure - if you looked at the json module's history on github |
13:37:28 | FromGitter | <zacharycarter> @malkomalko - https://github.com/nim-lang/Nim/commits/devel/lib/pure/json.nim |
13:37:28 | FromGitter | <malkomalko> Good call, I'm going to go do that |
13:39:23 | halirc | krux02, thank you. This is what I came up with, does that seem ok to you? https://pastebin.com/xVvjDqhM |
13:40:12 | * | PMunch quit (Remote host closed the connection) |
13:40:23 | krux02 | that's perfect |
13:40:51 | * | TheLemonMan joined #nim |
13:41:09 | TheLemonMan | halirc, we have the `in` operator (or `contains()`) for that purpose |
13:41:51 | krux02 | http://ix.io/1ooM |
13:42:06 | krux02 | TheLemonMan, internally it does the same thing |
13:42:35 | TheLemonMan | yeah but it's much more compact |
13:42:57 | krux02 | it's beginners code |
13:42:58 | * | vlad1777d quit (Ping timeout: 245 seconds) |
13:43:03 | krux02 | it can be less compact |
13:44:06 | krux02 | in the beginning it's important to learn just a few concepts that can be applied very flexibly. Later then you can extend your vocabulary to non essential functions |
13:44:30 | krux02 | when you have a bigger project then you start compressing your code by using more expressive terms |
13:44:43 | krux02 | but for an addIfNotExists, the loop is perfectly fine |
13:46:36 | halirc | Ooh, in or contains was what I was looking for. The documentation did not really make it easy to find. I see now that for Sets it is mentioned as an operator in the tutorial but not for sequences specifically. |
13:47:28 | halirc | I thought it was strange one had to write this ;) |
13:47:34 | TheLemonMan | `if x notin y: y.add x` |
13:48:00 | halirc | nice |
13:48:07 | TheLemonMan | krux02, you're assuming someone that's just learning Nim doesnt know jack shit about programming in general |
14:01:01 | halirc | I do have some programming experience but I can see how my question and the simple example can lead to thinking otherwise. I'm new to nim though and not using it often. |
14:11:06 | * | couven92 quit (Quit: Client disconnecting) |
14:24:22 | * | Tortice joined #nim |
14:26:18 | * | endragor quit (Remote host closed the connection) |
14:26:46 | FromGitter | <arnetheduck> btw @Araq, if you find yourself in a refactoring mood, it would be nice if you could come up with something more structured for the type nesting resolution - `skipTypes` and friends - it's been the source of innumerable bugs in the compiler, as it's very easy to forget to peel away some special generic or indirected type, leading to issues when the system is stressed. this is something I've struggled with as well in |
14:26:46 | FromGitter | ... `nlvm` - it's hard to know exactly which types should be skipped in which situation, leading to time-consuming analysis every time - perhaps there's something type-based that could be done to limit the generality/flexibility in exchange for fewer ways to get it wrong |
14:35:59 | * | narimiran joined #nim |
14:42:30 | TheLemonMan | gah, the zip library ships with a copy of libzip 0.8 |
14:42:43 | TheLemonMan | that's...a 11 year old release |
14:44:51 | * | endragor joined #nim |
14:46:53 | * | endragor quit (Remote host closed the connection) |
14:47:29 | * | endragor joined #nim |
14:47:59 | krux02 | arnetheduck: Araq is on vacation |
14:48:28 | FromGitter | <arnetheduck> @krux02 oh bummer. thanks! |
14:48:37 | * | krav_Yu joined #nim |
14:48:44 | krux02 | but I am here to listen to your stories |
14:49:29 | FromGitter | <xmonader> In the httpclient how do i encode query string with request proc? |
14:49:37 | * | krav_Yu quit (K-Lined) |
14:50:47 | * | nsf quit (Quit: WeeChat 2.2) |
14:52:04 | * | floppydh quit (Quit: WeeChat 2.2) |
14:52:30 | * | rockcavera quit (Ping timeout: 252 seconds) |
14:54:16 | * | tribly quit (Ping timeout: 272 seconds) |
14:54:27 | halirc | I'm back with another sequence question. Now I'm looking for flatten, is there something like that? |
14:54:48 | * | tribly joined #nim |
14:55:29 | * | natrys joined #nim |
14:57:44 | krux02 | halirc, I would do it with a loop |
14:57:57 | krux02 | but there is an add proc that appends a collection to a colleciton |
14:58:02 | krux02 | so you don't need nesting. |
14:58:11 | krux02 | but first check the index |
14:58:53 | narimiran | halirc: https://narimiran.github.io/itertools/#chain.i,varargs[seq[T]] :) |
14:59:04 | krux02 | halirc, there is someone who implemented `flatten` for ``Option[Option[T]]`` not really what you were looking for |
14:59:12 | krux02 | that is the state of functional programming in Nim |
14:59:44 | TheLemonMan | narimiran, urlencode your urls please |
14:59:44 | krux02 | there were people contributing to Nim who wanted functional programming and all contributed their way to a different subset of the collecitons |
15:00:21 | narimiran | TheLemonMan: this is copy-paste from my browser, as it is. that is what nim-doc creates |
15:00:26 | krux02 | so I don't recommend to use any of the functional programming functions from the standard library, they are not thought through to the end. |
15:01:01 | FromDiscord_ | <demotomohiro> Nim 0.19.0 is available on this online compiler: |
15:01:02 | FromDiscord_ | <demotomohiro> https://wandbox.org/ |
15:01:55 | TheLemonMan | narimiran, it's what it used to create :) backport this ( https://github.com/nim-lang/Nim/commit/de8cb0a1cf06d091dbe586fed85fb1cf904a33ac#diff-302297dd1a064075c52c27153e5a6b3a ) and you're good to go |
15:02:38 | narimiran | so `choosenim update devel` should do the trick? |
15:02:43 | * | natrys quit (Quit: natrys) |
15:03:18 | TheLemonMan | I think so |
15:03:31 | narimiran | ok, let's see in couple of minutes.... |
15:04:27 | halirc | Ok,thanks. I'll go with a loop or see if I can avoid the flatten altogether. |
15:05:00 | * | endragor quit (Remote host closed the connection) |
15:05:32 | halirc | How do I make nim code run here in the chat? I saw that a while ago, something with eval. |
15:08:12 | Tortice | !eval echo "" |
15:08:14 | NimBot | <no output> |
15:09:15 | FromGitter | <brentp> is there a simple way that I'm missing to turn an `HSlice` into a `seq[int]` ? |
15:09:26 | halirc | !eval import sequtils; concat(@["TEST?"], @[@["a", "b"], @["c"]]) |
15:09:27 | NimBot | Compile failed: in.nim(1, 24) Error: expression 'concat(@[@["a", "b"], @["c"]])' is of type 'seq[string]' and has to be discarded |
15:10:09 | halirc | in nim 0.18 that works and I just get @["a", "b", "c"] |
15:10:48 | TheLemonMan | brentp, countup(slice.a, slice.b).toSeq ? |
15:11:07 | Tortice | !eval echo NimMinor |
15:11:10 | NimBot | 18 |
15:12:02 | TheLemonMan | !eval let x = 1..10; from sequtils import toSeq; echo countup(x.a, x.b).toSeq() |
15:12:04 | NimBot | Compile failed: in.nim(1, 56) Error: attempting to call undeclared routine: 'countup' |
15:12:27 | TheLemonMan | !eval let x = 1..10; from sequtils import toSeq; echo toSeq(countup(x.a, x.b)) |
15:12:30 | NimBot | @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] |
15:12:41 | TheLemonMan | bleh, UFCS my ass |
15:13:40 | TheLemonMan | mind you that the H in HSlice means Heterogeneous |
15:14:48 | FromGitter | <brentp> @TheLemonMan thanks! |
15:14:49 | narimiran | TheLemonMan: freshly updated devel again gives infinite loop when i try to create docs ;) |
15:15:09 | halirc | ah, I see the difference |
15:15:22 | halirc | !eval import sequtils; echo concat(@["why is this gone?"], @[@["a", "b"], @["c"]]) |
15:15:25 | NimBot | @["a", "b", "c"] |
15:15:31 | krux02 | TheLemonMan, technically toSeq is not a function, so UFCS does not apply :P |
15:15:34 | narimiran | (it says that it is nim v0.19.0, is that correct? shouldn't it be 0.19.1?) |
15:15:34 | TheLemonMan | narimiran, give me a minimal test case and I'll check it out for you |
15:15:48 | TheLemonMan | krux02, touché heh |
15:15:53 | halirc | thats what I did in my code and I didn't get why that happened |
15:16:09 | narimiran | krux02: well, `toSeq` fits so naturally to be behind its argument :'( |
15:16:25 | halirc | with the echo there is no error but I think I understand now |
15:16:50 | TheLemonMan | narimiran, how can I reproduce the infinite loop? |
15:17:13 | narimiran | TheLemonMan: first, do you see 0.19.1 when you're running devel? |
15:17:35 | TheLemonMan | yep |
15:17:46 | narimiran | then something is wrong on my end |
15:18:01 | TheLemonMan | oh, I meant no |
15:18:54 | narimiran | and to reproduce it, here is my file: https://raw.githubusercontent.com/narimiran/itertools/master/src/itertools.nim |
15:19:59 | narimiran | just run `nim doc thatfile.nim` and there is an infinite loop |
15:23:30 | TheLemonMan | works fine here |
15:26:05 | * | Lavos joined #nim |
15:28:31 | * | drewmuttff joined #nim |
15:28:48 | * | drewmuttff quit (K-Lined) |
15:28:58 | narimiran | god dammit :P |
15:30:27 | TheLemonMan | you're not trying hard enough! |
15:33:38 | narimiran | that is also true :D |
15:47:33 | * | flyx quit (Quit: ZNC - http://znc.in) |
15:48:08 | * | flyx joined #nim |
15:54:55 | * | rnrwashere joined #nim |
15:55:11 | TheLemonMan | hm, if RST code-blocks were runnable would the ongoing forum-fight settle down? |
15:56:23 | TheLemonMan | because getting `nim doc` to support the :test: annotation (like rst2html and rst2tex do) is trivial |
16:02:16 | narimiran | yeah, that might help |
16:02:48 | narimiran | btw, what about just putting `runnableExamples` inside of a ## block, so there is no highlighting? |
16:03:45 | narimiran | well, i guess if we would do that, we can also just replace "runnableExamples" with ".. code-block:: test" or whatever is the syntax |
16:04:02 | TheLemonMan | that won't work, runnableExamples is a normal `proc` |
16:06:36 | narimiran | but if you can make rst code-block to serve both as documentation and test, then we don't need runnableExamples and we can use "one true way" to write examples |
16:07:06 | * | Lavos quit (Quit: Leaving) |
16:07:18 | * | Cloudflarecb joined #nim |
16:08:47 | * | Tortice quit (Ping timeout: 268 seconds) |
16:10:53 | * | Cloudflarecb quit (Killed (Sigyn (Spam is off topic on freenode.))) |
16:15:13 | FromGitter | <arnetheduck> @TheLemonMan totally - and all the pieces needed for making code blocks runnable from documentation are there - it's possible to extract them from the comment, it's possible to run a compiler instance over them etc etc - it's not a question of technical feasibility - it's a matter of deciding what the most beautiful approach is |
16:16:42 | TheLemonMan | arnetheduck, no doubt that's the best one, runnableExamples sticks out like a sore thumb |
16:17:59 | FromGitter | <arnetheduck> well, arguably and clearly there is doubt - someone went ahead and implemented `runnableExamples` and there are proponents for it that would prefer to see it improved and spread out instead of axed |
16:20:39 | TheLemonMan | maybe because right now you can't run RST code blocks? if you don't have any other option `runnableExamples` is better than nothing |
16:21:52 | FromGitter | <arnetheduck> well, some are arguing that running them is not all - without fixing their editors, they want syntax highlighting and code completion when writing the examples, for example |
16:25:02 | TheLemonMan | you can also write your own examples somewhere else as .nim files and ask the RST parser to include them |
16:25:32 | TheLemonMan | it's not you don't have enough options |
16:25:32 | * | endragor joined #nim |
16:28:52 | FromGitter | <arnetheduck> well, there's a separate post as well where the love for rST itself seems limited - not sure how many of those advanced features of rst you want to rely on, nice as they might seem.. also, include files are complicated - out of sight, out of mind and all that |
16:29:57 | TheLemonMan | the RST ship has sailed a long ago, didn't it? |
16:30:16 | TheLemonMan | if your included files are regularly compiled they're out of sight/mind but working :) |
16:30:46 | FromGitter | <mratsim> we can build a markdown hoverboard |
16:31:58 | * | endragor quit (Remote host closed the connection) |
16:33:26 | TheLemonMan | fucking choosenim & travis, I had never seen a 525 error before |
16:33:53 | FromGitter | <arnetheduck> the nice thing about markdown is that it will degrade gracefully - even when parsing rst, the results will at least be legible.. also, it's not like nim has a large corpus of well-written source-code-level documentation. the manual, being fully rST, can be autoconverted. |
16:39:10 | * | narimiran quit (Quit: Konversation terminated!) |
16:40:02 | * | rnrwashere quit (Remote host closed the connection) |
16:40:51 | * | rnrwashere joined #nim |
16:41:23 | * | endragor joined #nim |
16:44:09 | * | rnrwashere quit (Read error: Connection reset by peer) |
16:44:24 | FromGitter | <xmonader> while having flu sounded interesting to create a wit.ai client https://github.com/xmonader/witai-nim |
16:45:44 | TheLemonMan | you've also committed the binary file :) |
16:47:04 | * | endragor quit (Remote host closed the connection) |
16:49:07 | * | rnrwashere joined #nim |
16:50:36 | * | rnrwashe_ joined #nim |
16:53:34 | * | rnrwashere quit (Ping timeout: 240 seconds) |
16:53:38 | FromGitter | <xmonader> i thought i ammended that should be removed now :) |
16:55:31 | * | Tortice joined #nim |
16:56:19 | * | endragor joined #nim |
17:05:41 | * | endragor quit (Remote host closed the connection) |
17:06:14 | * | rockcavera joined #nim |
17:08:20 | FromGitter | <7sDream> (https://files.gitter.im/nim-lang/Nim/WsrX/unknown.png) |
17:09:25 | TheLemonMan | I don't know what I'm staring at but looks nice |
17:09:26 | FromGitter | <7sDream> My new work thoose days, a danmaku client for douyu.com(live streaming website live twitch in China) |
17:09:29 | * | darithorn joined #nim |
17:10:11 | TheLemonMan | noice |
17:10:46 | FromGitter | <7sDream> Nim is so good at creating DSL, I really enjoy it 😄 |
17:13:00 | * | Tortice quit (Remote host closed the connection) |
17:13:08 | * | Tortice joined #nim |
17:13:42 | * | Tortice quit (Remote host closed the connection) |
17:14:17 | halirc | Sorry I have another beginner question. I would like to use something like join on a sequence of strings. Like @["a", "b", "c"].join(" ") and as a result get "a b c". |
17:15:54 | TheLemonMan | do it! |
17:16:38 | * | Trustable joined #nim |
17:17:03 | leorize | halirc: the `join()` proc in strutils should do what you need |
17:17:17 | leorize | !eval import strutils; echo @["a", "b", "c"].join(" ") |
17:17:19 | FromGitter | <arnetheduck> on DSL's and special languages, one of the nim devs at work posted this: https://erikbern.com/2018/08/30/i-dont-want-to-learn-your-garbage-query-language.html :) |
17:17:19 | NimBot | a b c |
17:18:03 | halirc | Haha yeah it works. My bad. I read the bit about sequence can be passed to an openarray parameter and I found strutils join but it turns out I forgot to import strutils. It just works now :) |
17:21:06 | * | rnrwashe_ quit (Remote host closed the connection) |
17:21:14 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
17:25:38 | * | rnrwashere joined #nim |
17:26:56 | * | rnrwashere quit (Remote host closed the connection) |
17:27:31 | * | rnrwashere joined #nim |
17:31:38 | * | tay_ joined #nim |
17:36:50 | FromGitter | <7sDream> Yes, DSL is always controversial, I just enjoy the process I create it! |
17:37:09 | * | ghost64 quit (Quit: See you!) |
17:37:19 | * | rnrwashe_ joined #nim |
17:37:39 | * | tay__ joined #nim |
17:38:49 | * | tay_ quit (Ping timeout: 244 seconds) |
17:39:35 | * | tay__ quit (Client Quit) |
17:40:35 | * | halirc quit (Quit: Leaving) |
17:40:37 | * | rnrwashere quit (Ping timeout: 250 seconds) |
17:43:03 | * | ghost64 joined #nim |
17:46:20 | * | xet7 joined #nim |
17:51:28 | * | shadowbane quit (Remote host closed the connection) |
17:52:32 | * | shadowbane joined #nim |
17:54:12 | * | zakora quit (Quit: WeeChat 2.2) |
17:54:28 | * | rockcavera quit (Read error: Connection reset by peer) |
17:55:06 | * | tdc quit (Ping timeout: 252 seconds) |
17:56:28 | FromDiscord_ | <demotomohiro> Maybe, making DSL similar to existing language is a good idea, but making completely new DSL is a bad idea |
17:57:50 | * | vivus joined #nim |
17:59:17 | vivus | what is the best way to compile my program for production use? |
18:01:10 | * | rockcavera joined #nim |
18:01:12 | * | Delta_558 joined #nim |
18:02:54 | leorize | nim c -d:release <program>.nim |
18:03:30 | * | Delta_558 quit (Remote host closed the connection) |
18:03:43 | * | rnrwashe_ quit (Remote host closed the connection) |
18:03:56 | krux02 | my two cents to the runable examples, I currently like the idea to have a template (for example in system) that expands to nothing. |
18:04:07 | krux02 | this template is called ``example`` |
18:04:38 | krux02 | then you can write your example in an ``example:`` block |
18:04:59 | FromGitter | <arnetheduck> @krux02: you mean like https://github.com/nim-lang/Nim/blob/269b957e2968345a4c9a5037ab97ab726135a921/lib/system.nim#L4206? that's the one I want to deprecate / remove :) |
18:05:00 | krux02 | you get syntax highlighting, code completion, etc |
18:05:28 | krux02 | what is the problem with it? I never used it. |
18:05:29 | vivus | this is off-topic, but for anybody using linux, how did you export your nim executable to make it run globally? |
18:05:45 | krux02 | vivus: put it on the path? |
18:05:56 | vivus | krux02: yeah, but how will that look? |
18:06:23 | leorize | export PATH="/path/to/folder/with/compiler:$PATH" |
18:06:23 | vivus | export PATH=/home/myuser/myapp/bin:$PATH ? |
18:06:43 | vivus | so the last folder must be where the executable is? |
18:06:47 | krux02 | vivus, there is ``nimble install`` and that puts the binary in ~/.nimble/bin I think |
18:06:52 | krux02 | put than on the path |
18:07:14 | krux02 | or do you mean the nim compiler? |
18:07:30 | krux02 | for the compiler I did it like leorize |
18:07:41 | vivus | that's what I was trying to replicate. I already have the ./.nimble/bin as a path in .profile . I wanted to add my custom program there also |
18:07:51 | leorize | copy your prog there :P |
18:08:04 | leorize | just make sure it's executable, and it's in PATH |
18:08:16 | krux02 | vivus, did you do ``nimble install`` in your program directory? |
18:08:22 | vivus | is it better to copy the program there or just put my own custom path? cause I am still editing the program but want it globally accessible |
18:08:38 | leorize | symlink also works |
18:08:41 | vivus | krux02: no, this program is not a nimble package |
18:08:48 | krux02 | vivus, is the binary in ~/.nimble/bin (not ./.nimble/bin as in your comment that is important) |
18:08:49 | leorize | just symlink it to a place in PATH |
18:09:20 | vivus | krux02: no, the binary is in: /ubuntu/myuser/myapp/myprogram |
18:09:31 | voice_ftp | Why there are both `gorge` and `staticExec` in standard library if they do the same thing? |
18:09:46 | leorize | vivus: ln -s /path/to/app /path/to/somewhere/in/path |
18:09:46 | krux02 | leorize, the better way really is to use ``nimble install`` and put the nimble bin directory on the path, then also all packages that distribute binary files work automatically |
18:10:02 | leorize | krux02: only when you're dealing with nimble package |
18:10:06 | * | Jesin quit (Ping timeout: 264 seconds) |
18:10:18 | leorize | vivus is dealing with their own app, which is not using nimble atm |
18:10:30 | * | tdc joined #nim |
18:10:32 | krux02 | vivus, that is a very non unix style path |
18:10:34 | krux02 | are you sure? |
18:11:04 | vivus | I plan on making it something like: ~/.myapp/ once I release it |
18:11:24 | vivus | so it installs on Linux like other software |
18:12:01 | leorize | voice_ftp: ask Araq |
18:12:11 | FromGitter | <arnetheduck> @krux02 https://forum.nim-lang.org/t/4279 |
18:12:21 | krux02 | vivus, I am sorry but this path "/ubuntu/myuser/myapp/myprogram" looks like there is a lot of stuff done in a very messy way, because this is a path convention I never ever heared about |
18:12:59 | vivus | krux02: this is just for local testing :) see my message above, the final path can be wherever the user wants it to be |
18:13:02 | krux02 | either use nimble, and then nimble install and put the nimble bin directory on the path, with is a sandard way, or build locally, and put the local directory on the path |
18:13:08 | krux02 | anything else you are on your own. |
18:13:40 | leorize | krux02: I'm pretty sure vivus know what they are doing |
18:14:00 | * | wildlander joined #nim |
18:16:27 | * | rockcavera quit (Ping timeout: 252 seconds) |
18:17:19 | krux02 | I am not so sure about that. Putting things on the path is annoying, but it is kind of a basic linux/unix thing to do |
18:18:07 | krux02 | vivus: but sorry for that comment |
18:18:43 | vivus | krux02: no need to apologize friend, helping me understand how to add a path was the end goal. educating me on the unix philosophy was a bonus :) |
18:20:00 | krux02 | vivus, I don't really understand what you are planning to do, but saying "the final path can be wherever the user wants it to be" is usually much worse than just putting it at right path with no configuaration possible. |
18:20:22 | * | tzui joined #nim |
18:20:50 | * | tzui left #nim (#nim) |
18:20:52 | * | rockcavera joined #nim |
18:20:52 | * | rockcavera quit (Changing host) |
18:20:52 | * | rockcavera joined #nim |
18:21:01 | vivus | yeah its a bit difficult to explain as its possible we are not on the same page concerning where the executable should reside |
18:22:23 | krux02 | I can understand if you don't like nimble, I don't like it either, I think it gets often more in the way than it actually solves a problem, but when it is about distributing a binary that is built with the Nim compiler, it is still the tool to go. |
18:22:36 | krux02 | I don't think there is any viable alternative. |
18:22:50 | krux02 | except maybe the package manager of the distribution. |
18:23:18 | vivus | krux02: but nim binaries don't need nimble? a lot of them can execute as self-contained programs |
18:23:53 | krux02 | vivus, well that is actually the only case nimble can handle reliably. |
18:24:21 | krux02 | nimble isn't very good at tracking dependencies. |
18:26:23 | krux02 | nimble can do the job of putting the binary in the right folder |
18:27:04 | krux02 | and people who want to have the binary in a custom folder, they know what they are doing, believe me, they can get the binary in that folder, you don't need a config option for that. |
18:27:19 | krux02 | the config is just confusing the less experienced |
18:27:30 | krux02 | or might get in the way differently |
18:30:03 | elrood | that's a fairly nice way of pronouncing the opinion hat people usually don't know what they're doing and shouldn't be given the opportunity to make choices ;) |
18:31:06 | elrood | when did we stop pretending everyone around us wasn't stupid? |
18:35:33 | * | rockcavera quit (Ping timeout: 268 seconds) |
18:41:46 | * | rockcavera joined #nim |
18:41:46 | * | rockcavera quit (Changing host) |
18:41:46 | * | rockcavera joined #nim |
18:42:53 | FromGitter | <alehander42> @arnetheduck i've also thought about query syntax (e.g. thought of making a linq-like dsl for nim), I kinda agree that having custom query syntaxes suck, but what's the alternative |
18:43:11 | * | rnrwashere joined #nim |
18:43:23 | FromGitter | <alehander42> sql-s also have a loot of dialects |
18:44:00 | FromGitter | <alehander42> and they are still database-specific, it doesn't make a lot of sense to use this syntax for different kind of storage |
18:45:00 | FromGitter | <alehander42> "There should be a 30 year moratorium on inventing new query languages." this sounds like communists talking about how evil the free market is :D |
18:45:24 | FromGitter | <alehander42> i've wanted to write about that metaphor for a long time, i have to sit down and do it |
18:48:42 | FromGitter | <arnetheduck> @alehander42 yeah, that post is a bit of a rant, and there are of course good DSL examples out there... I guess the problem with DSL's in general is that a lot of them get developed frivolously without any sound theoretical backing or holistic thinking behind them.. that makes them more specialized and thus less general purpose - the ROI for having to learn them is low because the knowledge isn't generally |
18:48:42 | FromGitter | ... applicable and you don't learn a useful model or abstraction from studying them, just have to drudge though the limited understanding some fellow in the closet came up with for their tiny special case |
18:54:22 | FromGitter | <alehander42> honestly you can say that about the design of a lot of the programming languages/mainstream API-s/protocols |
18:55:11 | FromGitter | <alehander42> I feel that most of the stuff just evolves slowly while it gets to a somehow mature (or must-be-backward-compatible) state |
18:55:19 | FromGitter | <alehander42> somewhat* |
18:57:22 | FromGitter | <alehander42> so usually in this case you have solutionA, solutionB, after a while somebody decides to fix the problems of those with solutionC, somebody else have different needs, so slightly incompatible solutionD, which is ported to a diff technology's solutionE |
18:58:25 | FromGitter | <alehander42> and after a while solutionX and solutionY are kinda good, as the "community" managed to analyze and generalize its previous mistakes and the problem domain |
19:00:52 | FromGitter | <arnetheduck> oh for sure - and what's good for open source developers is that no one is forcing them to use these shitty dsl's and they can die a natural death and perhaps provide some fertile ground for more exploration :) it's worse if you're stuck in a coercive setup where you *have* to use them. |
19:01:26 | FromGitter | <alehander42> but the problem is the fitness function "what is better" isn't actually well defined, you might prefer good abstractions, but a lot of people might use something that *feels* easier |
19:01:40 | FromGitter | <alehander42> in a very subjective sense |
19:01:58 | FromGitter | <alehander42> so the shitty dsl-s often keep being popular |
19:01:59 | FromGitter | <arnetheduck> point is, developing a good dsl takes a fair bit of work regardless of how that work happens (top-down, community, whatever) |
19:02:53 | FromGitter | <arnetheduck> no, it's like the somewhat elusive concept of "quality" - you inherently recognize when it's there and when it's not, but it's often hard to put a finger on what makes it so |
19:04:39 | FromGitter | <alehander42> I don't quite agree, sometimes a dsl can solve 80% of usecases in some hacky but *easier* way and get a lot of mindshare, based on the people that don't need to use it in advanced way (orm and CRUD are a good example) |
19:04:51 | * | Jesin joined #nim |
19:05:04 | FromGitter | <alehander42> which might not be cool, but the point is quality doesn't always survive |
19:06:36 | FromGitter | <alehander42> editors are another example, vim's (or kakoune) modal editing might be based on a beautiful abstraction model, but still most programmers use some editor-specific custom-shortcut hacks |
19:08:42 | FromGitter | <alehander42> it's always cost/benefit, people love to praise haskell/ocaml's type systems, but then 0.5% use them |
19:19:25 | FromGitter | <alehander42> (talking about https://news.ycombinator.com/item?id=18148749 ) |
19:19:33 | FromGitter | <alehander42> ops wrong chat |
19:26:36 | * | darithorn quit () |
19:35:33 | * | Vladar quit (Remote host closed the connection) |
19:37:03 | * | xet7 quit (Ping timeout: 252 seconds) |
19:50:32 | FromGitter | <arnetheduck> ah indeed, some of these fine abstract models need to be moderated with a health dose of pragmatism to make then truly useful, in a broader sense. should that be part of the criteria for `quality`? |
19:50:44 | * | xet7 joined #nim |
19:52:15 | * | Tortice joined #nim |
19:52:29 | * | vlad1777d joined #nim |
20:01:24 | * | rnrwashere quit (Remote host closed the connection) |
20:02:28 | krux02 | elrood: there is also this american way, creating fake choices just so the customer feels more like he has choice. |
20:02:47 | * | snooopyUl joined #nim |
20:03:30 | krux02 | the super market has 1000 choices, all of them are some form of processed GMO corn |
20:04:12 | * | snooopyUl quit (K-Lined) |
20:04:41 | krux02 | alehander42: if you want a query syntax, nim has all the tools so that you can develo a DSL with macros. |
20:08:12 | * | xace joined #nim |
20:08:12 | krux02 | alehander42: btw I tested both vim and emacs. it's not worth it. |
20:09:03 | krux02 | well maybe emacs a bit, because emacs lisp is kind of neat to get a few things done, but with vscode you just get a better default editor. |
20:13:56 | * | xace quit (Read error: Connection reset by peer) |
20:26:05 | * | jjido joined #nim |
20:26:54 | FromGitter | <arnetheduck> @alehander42 @krux02 speaking of dsl's (and linq), one thing we'd need from the language is a more agile syntax for lambda functions.. the current `proc` and `do` notations are just too clumsy with all the type noise |
20:28:17 | * | Tortice quit (Remote host closed the connection) |
20:28:50 | * | Tortice joined #nim |
20:31:45 | FromDiscord_ | <exelotl> arnetheduck: hey I mean this is a thing, or did you already know about it? https://nim-lang.org/docs/sugar.html |
20:35:54 | FromGitter | <arnetheduck> @exelotl ooh, nice! I missed that one, all the manual talks about is the full proc syntax |
20:36:57 | FromGitter | <arnetheduck> interesting sprawl on the functions in there |
20:45:15 | * | ropeney joined #nim |
20:49:25 | * | ropeney quit (Remote host closed the connection) |
20:51:33 | FromDiscord_ | <exelotl> looks like you can only have single expressions in the body though |
20:52:45 | * | tdc quit (Ping timeout: 252 seconds) |
20:54:05 | FromDiscord_ | <exelotl> so doThing(() => echo "hello") is fine but doThing(() => echo "hello"; echo "world") isn't |
20:58:38 | FromGitter | <arnetheduck> yeah well that's in line with lambdas mostly - in linq, you wanna use them for small conditions like filters, sorts and the like.. probably, something like linq should be smart enough to understand them a bit, so it can include its own "query optimizer" |
21:03:00 | * | stefanos82 quit (Quit: Quitting for now...) |
21:04:34 | * | zachk joined #nim |
21:38:59 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:48:15 | * | nsf joined #nim |
22:11:53 | shashlick | haah - all nimgen wrapper tests finally pass with 0.18.0, now to try 0.19.0 and see what falls off |
22:24:07 | * | zachk quit (Quit: Leaving) |
22:29:37 | * | Trustable quit (Remote host closed the connection) |
22:35:28 | * | Ven`` joined #nim |
22:36:50 | * | Ven`` quit (Client Quit) |
22:39:32 | krux02 | exelotl: you should be able to do this: ``doThing(() => (echo "hello"; echo "world"))`` |
23:08:00 | FromGitter | <DanielSokil> How can I filter files in `request.body` from `asynchttpserver`? |
23:09:22 | FromGitter | <DanielSokil> Currently when uploading an image with a HTML form I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb7ef226e5a401c2d2259dd] |
23:11:54 | * | Tortice quit (Read error: Connection reset by peer) |
23:11:55 | * | owner_ joined #nim |
23:12:18 | * | owner_ is now known as Guest29236 |
23:22:06 | * | elrood quit (Quit: Leaving) |
23:36:39 | * | btbytes quit (Ping timeout: 252 seconds) |
23:44:19 | * | btbytes joined #nim |
23:49:56 | FromGitter | <DanielSokil> I have found this library: `https://github.com/tulayang/httpform`, But it does not work as expected. |
23:55:57 | FromGitter | <kayabaNerve> It was last updated three years ago. |
23:56:11 | FromGitter | <bung87> guess it in another field of request |
23:56:21 | FromGitter | <kayabaNerve> I'd be surprised if it even compiles. |
23:56:24 | FromGitter | <bung87> like other frameworks does |
23:57:49 | FromGitter | <DanielSokil> I have tried it, doesn't compile. |
23:58:03 | FromGitter | <DanielSokil> > guess it in another field of request |
23:58:56 | FromGitter | <bung87> generally request.body is pain text of http body |