00:00:56 | leorize | thanks |
00:01:20 | dadada | what's with the [m] ? |
00:02:10 | FromGitter | <zetashift> specifies that the user is using Matrix I think |
00:02:24 | dadada | ah |
00:02:31 | * | dadada is now known as dadada[irssi] |
00:02:51 | dadada[irssi] | hereby I specified |
00:02:55 | * | dadada[irssi] is now known as dadada |
00:03:09 | dadada | :-) |
00:03:16 | FromGitter | <zetashift> vscode is so damn slow with the vim plugin damnit |
00:03:26 | dadada | zetashift: vim or nvim? |
00:03:28 | Cadey | welcome to why i use emacs |
00:03:45 | dadada | zetashift: there's a native neovim plugin for vscode, but I haven't tried it |
00:03:54 | FromGitter | <zetashift> @Cadey I love me some spacemacs but Nim support is the only thing stopping me :( |
00:04:04 | FromGitter | <zetashift> or well doom-emacs |
00:04:22 | FromGitter | <zetashift> dadada it's still kind of slow |
00:04:34 | * | dwdv quit (Ping timeout: 240 seconds) |
00:04:53 | dadada | love emacs for elisp, but vscode is not too shaby, considering how young the project is, will be exciting to see where it is in a few years |
00:05:08 | FromGitter | <zetashift> VSCode is nice and it runs a lot smoother without the vim plugin |
00:05:21 | FromGitter | <zetashift> But I can't go back to normal keybindings now D: |
00:05:50 | dadada | zetashift: me neither, I haven't noticed much of the slowness |
00:08:11 | * | MightyJoe joined #nim |
00:09:34 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
00:12:00 | * | videofile quit (Quit: Going offline, see ya! (www.adiirc.com)) |
00:12:28 | dadada | https://github.com/fox0430/moe |
00:12:39 | dadada | has anyone here used this? |
00:14:06 | dadada | the project has high activity |
00:17:03 | FromGitter | <zetashift> I have not for command line I usually use vi or nano |
00:17:28 | FromGitter | <zetashift> Nim does not have a flatten proc for collections? |
00:18:37 | * | cyraxjoe joined #nim |
00:20:37 | * | MightyJoe quit (Ping timeout: 264 seconds) |
00:35:48 | leorize | @zetashift: too bad neovim is unstable on windows :P |
00:38:03 | leorize | ave you tried that plugin that turns vscode into a neovim frontend? |
00:39:54 | FromDiscord | <Avatarfighter> I have a stupid question for you guys, what would be the equivalent to a cpp "define" in nim would it be const? |
00:41:10 | leorize | technically we don't have anything like that |
00:41:17 | leorize | but usually you'd mean `const` |
00:42:09 | FromGitter | <awr1> i use emacs but with nimsuggest disabled |
00:42:17 | FromDiscord | <Avatarfighter> I didn't think there was a direct equivalent so I've just been using "const" for the time being lol |
00:42:19 | FromGitter | <awr1> it's been broken for some time |
00:43:05 | leorize | @Avatarfighter: ah, template is pretty much the equivalent |
00:43:13 | leorize | actually templates are much much more powerful |
00:43:27 | leorize | but for your use case then `const` is what you want I think |
00:44:11 | FromGitter | <awr1> Templates are a smarter version of C macros |
00:44:36 | FromGitter | <awr1> e.g. they're hygenic by default (which you can disable with `{.dirty.}`) |
00:45:01 | FromDiscord | <Varriount> Hm, what is the most intuitive behavior for `split(<empty string>, <empty separator string>)`? |
00:45:09 | FromGitter | <awr1> and they are typechecked |
00:45:37 | FromGitter | <awr1> @Varriount return empty string |
00:45:40 | leorize | @Varriount: empty seq |
00:45:48 | FromGitter | <awr1> i mean empty seq yeah |
00:45:49 | leorize | or a seq with one empty string |
00:46:08 | leorize | yea seq with one empty string is better |
00:46:13 | FromDiscord | <Varriount> Because the implementation in strutils just returns an (infinite) stream of empty strings (it's an iterator) |
00:46:36 | FromDiscord | <Varriount> Which somewhat caught me off guard. |
00:46:47 | FromGitter | <awr1> sounds like a bug |
00:46:51 | leorize | now that's a bug |
00:47:20 | FromDiscord | <Varriount> And what do you think the behavior should be for `split(<a non-empty string>, <empty separator string>)`? |
00:47:37 | FromGitter | <awr1> one seq containing the whole strin |
00:47:37 | FromGitter | <awr1> g |
00:47:39 | leorize[m] | depends on who you ask |
00:47:48 | FromGitter | <awr1> *seq with one element containing just the original string |
00:48:16 | FromDiscord | <Varriount> Python and Java at least appear to raise an exception. Go splits the string into UTF-8 runes. I don't know what C# does. |
00:48:19 | leorize[m] | either that ^ or seq containing every character (this is a pcre thing) |
00:48:23 | leorize[m] | iirc we actually have an issue debating this |
00:49:30 | FromDiscord | <Varriount> Do you interpret `''` as "containing no matching separators", or "matching between every character"? |
00:49:46 | leorize | I interpret it as the former |
00:53:24 | FromDiscord | <Varriount> I somewhat favor the idea of raising an exception, because it's clearly ambiguous enough to cause discussions. |
00:54:26 | leorize[m] | you can PR it and we can discuss there |
00:58:10 | * | zacharycarter joined #nim |
00:59:04 | Prestige | Hm I think I agree with leorize[m] here |
00:59:36 | FromDiscord | <Varriount> leorize: It would break backwards compatibility, so I won't propose it. |
01:01:08 | * | MightyJoe joined #nim |
01:02:55 | * | cyraxjoe quit (Ping timeout: 258 seconds) |
01:03:28 | leorize[m] | with the `--useVersion` thing it's not too bad anymore |
01:05:58 | leorize[m] | though you should fix the infinite loop problem |
01:06:21 | * | cyraxjoe joined #nim |
01:07:51 | * | MightyJoe quit (Ping timeout: 250 seconds) |
01:08:29 | * | chemist69_ joined #nim |
01:11:19 | * | chemist69 quit (Ping timeout: 250 seconds) |
01:18:58 | shashlick | awr1: just pushed a fix for nimterop#172 |
01:22:06 | FromGitter | <zetashift> Anybody got some tips for me making this type definition less shitty: https://play.nim-lang.org/#ix=2hWT ? |
01:27:29 | * | krux02 quit (Remote host closed the connection) |
01:28:14 | * | lritter quit (Ping timeout: 240 seconds) |
01:29:01 | * | icebattle quit (Ping timeout: 264 seconds) |
01:29:10 | * | lritter joined #nim |
01:40:34 | * | rockcavera quit (Read error: Connection reset by peer) |
01:40:52 | * | rockcavera joined #nim |
01:40:52 | * | rockcavera quit (Changing host) |
01:40:52 | * | rockcavera joined #nim |
01:57:07 | * | Tlongir joined #nim |
01:57:47 | * | ftsf joined #nim |
01:58:38 | ftsf | hi, has anyone got an example of how to use htmlgen in a more complete way? the examples in https://nim-lang.org/docs/htmlgen.html are super minimal. |
02:02:58 | FromGitter | <zetashift> like the docs says aren't you better off using Karax then, it has more examples too? |
02:04:10 | ftsf | "Note: The Karax project (nimble install karax) has a better way to achieve the same, see https://github.com/pragmagic/karax/blob/master/tests/nativehtmlgen.nim for an example. |
02:04:11 | ftsf | " hmm seems to suggest it's a better way of importing some things, not how to use. I'm not sure what karax is, but if it obsoletes htmlgen it should probably say that. |
02:05:23 | ftsf | seems like karax is a lot bigger than htmlgen |
02:06:11 | FromGitter | <zetashift> @ftsf : https://forum.nim-lang.org/t/5851 see araq's response |
02:06:20 | FromGitter | <zetashift> oh fuck I hope I didn't ping him |
02:06:52 | * | zacharycarter quit (Ping timeout: 256 seconds) |
02:07:18 | ftsf | zetashift, thanks |
02:07:47 | FromGitter | <zetashift> yea karax is bigger but I don't think it'll hurt if you only focus on the htmlgen part |
02:08:32 | FromGitter | <zetashift> I don't know htmlgen so I'd still wait for a second opinion on using htmlgen |
02:09:06 | ftsf | ok, htmlgen seems more what i'm looking for, but i'm not really sure how to get started with it other than the examples given where it's pretty much a single tag in isolatin, |
02:11:02 | * | Guest85 quit (Quit: My Mac Pro has gone to sleep. ZZZzzz…) |
02:11:36 | * | zacharycarter joined #nim |
02:13:42 | FromGitter | <zetashift> I can't find the test suite for htmlgen |
02:16:40 | * | endragor joined #nim |
02:21:12 | FromDiscord | <Gary M> I'm pulling my hair out trying to figure out a way to interface with a large C++ library, or at least with a C API. |
02:21:48 | FromDiscord | <Gary M> and trying to do so with a dynamic linked library |
02:23:21 | * | MightyJoe joined #nim |
02:24:54 | * | cyraxjoe quit (Ping timeout: 240 seconds) |
02:25:26 | * | muffindrake quit (Ping timeout: 265 seconds) |
02:26:05 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:27:14 | * | muffindrake joined #nim |
02:43:19 | FromGitter | <zetashift> Who knew comparing floats would be this troublesome |
02:45:02 | * | audiofile joined #nim |
02:45:12 | FromDiscord | <Rika> are you trying to == them? |
02:47:42 | FromGitter | <zetashift> yep |
02:48:01 | FromGitter | <zetashift> ` (4, [20.0, 22.0, 50.0, 48.0, 44.0, 54.0, 114.0, 108.0, 40.0, 58.0, 110.0, 102.0, ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ 0, 108.0, 40.0, 58.0, 110.0, 102.0, 16.0, 26.0, 46.0, 42.0]) ` [https://gitter.im/nim-lang/Nim?at=5e952461c52b6a38abe4412d] |
02:48:30 | FromGitter | <zetashift> that errors out for me, but I have a separate test for equality ( == ) that runs fine |
02:49:16 | FromDiscord | <Rika> never do == for floats, you ofc need a ~= operator |
02:49:24 | FromDiscord | <Rika> well i assume you already do |
02:50:38 | FromGitter | <zetashift> I mean I have an operator `==` defined that calls a proc named `equal(a, b: float): bool` |
02:50:49 | FromGitter | <zetashift> I don't know if that counts I can rename ~= |
02:54:12 | leorize | @Gary M unless it's Qt, I'd say it's not too hard |
03:00:19 | * | Hexeratops quit (Read error: Connection reset by peer) |
03:15:36 | FromGitter | <zetashift> man it wasn't the floats I'm multiplying this array like an idiot |
03:16:59 | * | zacharycarter quit (Ping timeout: 250 seconds) |
03:22:02 | * | zacharycarter joined #nim |
03:28:42 | FromGitter | <zacharycarter> Gary M: as leorize said - shouldn't be that difficult. What are you pulling your hair out over? |
03:48:27 | * | nsf joined #nim |
04:02:50 | * | rockcavera quit (Remote host closed the connection) |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:07:08 | * | supakeen_ joined #nim |
04:32:36 | * | def-- joined #nim |
04:34:16 | * | federico3_ joined #nim |
04:38:56 | * | Araq_ joined #nim |
04:40:19 | * | federico3 quit (*.net *.split) |
04:40:20 | * | def- quit (*.net *.split) |
04:40:20 | * | Araq quit (*.net *.split) |
04:40:33 | * | def-- is now known as def- |
04:41:04 | * | zacharycarter quit (Ping timeout: 265 seconds) |
04:43:19 | FromDiscord | <Gary M> https://github.com/DiligentGraphics/DiligentEngine |
04:43:25 | FromDiscord | <Gary M> This is what I've been looking at. |
04:44:01 | * | Mister_Magister quit (Ping timeout: 264 seconds) |
04:44:47 | * | cyraxjoe joined #nim |
04:46:39 | * | MightyJoe quit (Ping timeout: 260 seconds) |
04:46:53 | FromDiscord | <Gary M> I've tried using c2nim and nimterop and nimline but I'm misunderstanding how any of this is done. |
04:47:07 | FromDiscord | <Gary M> I'd be happy with doing this manually, but even linking to a dll isn't working |
04:48:06 | * | narimiran joined #nim |
04:52:54 | * | Mister_Magister joined #nim |
04:53:20 | FromDiscord | <Gary M> I just have zero idea of what the proper workflow is for any of this and documentation/guides are very few and far between or outdated. |
04:54:10 | shashlick | That's a big repo, what specifically do you want to use |
04:58:28 | FromDiscord | <Gary M> https://github.com/DiligentGraphics/DiligentCore/blob/4c73f2d3fd5305b82d3413ebeab74cc566b57f33/Graphics/GraphicsEngineVulkan/interface/EngineFactoryVk.h |
04:58:38 | FromDiscord | <Gary M> here's the Vulkan interface |
04:59:56 | FromDiscord | <Gary M> so there's part of the C interface exposed under DILIGENT_C_INTERFACE |
05:06:41 | FromDiscord | <Gary M> but it seems like there's a fair number of things I'd have to wrap just to reproduce one of the samples in the samples repo |
05:06:49 | shashlick | Nimterop might be able to pull it off, have to bed though |
05:07:12 | FromDiscord | <Gary M> I did try nimterop but got an error for a missing bash executable |
05:07:16 | shashlick | You can nimble install nimterop and then use toast to wrap it - command line is documented online |
05:07:37 | FromDiscord | <Gary M> I have bash with git but it's not seeing that |
05:07:41 | shashlick | You on windows? |
05:07:44 | FromDiscord | <Gary M> yes |
05:07:57 | shashlick | If project supports cmake, just install cmake instead |
05:08:11 | shashlick | Else make sure git bash is in the path |
05:08:33 | shashlick | Git ships with bash.exe |
05:08:37 | FromDiscord | <Gary M> Yeah, I made sure it's in the path. It's just not seeing it. |
05:08:50 | shashlick | findExe needs to find it |
05:09:22 | FromDiscord | <Gary M> the path to Git\bin is in my User Path |
05:12:35 | * | audiofile quit (Quit: Going offline, see ya! (www.adiirc.com)) |
05:48:13 | Prestige | Is there a standard way to document procs? |
05:49:11 | Zevv | Use double ## after the proc opening |
05:49:37 | Prestige | But the rest doesn't really matter? |
05:49:59 | Prestige | Also, same question for wrappers |
05:50:24 | Zevv | for the rest there's no formal rules. There's nothing like javadoc with explicit description of all arguments, for example |
05:51:05 | Zevv | but it all depends on your context. Nim stdlib encourages runnableExample blocks in the docs, for example |
05:51:37 | Prestige | I'm mostly looking at documenting the x11 wrapper |
05:53:25 | Zevv | For pure wrappers often it does not make too much sense to document everything at the proc level, since these are just FFI calls into the originals. It might make sense to just point to the original docs instead. |
05:54:41 | Zevv | if I want to call XChangeDeviceKeyMapping from nim x11, I can jus lookup the XChangeDeviceKeyMapping man page, right |
05:54:52 | Prestige | I'm just used to having docs in the editor so I was going to copy the docs over and maybe rename the parameters |
05:55:16 | Zevv | The X11 API is *huge* |
05:55:28 | Prestige | ah I didn't know there were man pages, that's handy |
05:55:48 | Zevv | sure, for X11 the man pages are the go-to docs |
05:56:06 | Zevv | and my editor knows about that. I can just hit a key when the cursor is over a function and it finds the man page for me |
06:08:48 | * | supakeen_ is now known as supakeen |
06:09:08 | * | supakeen quit (Changing host) |
06:09:08 | * | supakeen joined #nim |
06:09:18 | * | supakeen quit (Quit: WeeChat 1.9.1) |
06:09:41 | * | supakeen joined #nim |
06:12:42 | * | PMunch joined #nim |
06:15:06 | * | solitudesf joined #nim |
06:15:08 | FromGitter | <jfilby> I have a problem with nimble terminating with a SIGILL on Mac: https://github.com/nim-lang/nimble/issues/792 |
06:15:35 | FromGitter | <jfilby> can anyone advise what to do? it looks like it dies on trying to call an OpenSSL function |
06:17:28 | leorize[m] | you need to replace your openssl, maybe |
06:19:02 | FromGitter | <jfilby> I have openssl 1.1 which was installed by brew |
06:19:17 | FromGitter | <jfilby> so I can look into it, but it should work |
06:20:19 | * | silvernode joined #nim |
06:27:49 | * | lbart quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
06:28:09 | * | lbart joined #nim |
06:39:05 | * | silvernode quit (Ping timeout: 256 seconds) |
06:46:19 | * | filcuc joined #nim |
06:49:43 | * | leorize quit (Ping timeout: 240 seconds) |
06:58:04 | * | couven92 joined #nim |
06:58:12 | * | filcuc quit (Ping timeout: 256 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:11 | * | leorize joined #nim |
07:04:44 | * | gmpreussner joined #nim |
07:09:41 | * | dddddd quit (Ping timeout: 256 seconds) |
07:09:55 | Prestige | Found the proc for bitor, but is there a way to do this to many values (built in)? |
07:11:05 | Prestige | Like if I wanted to or 3 ints, would I just have to invoke bitor multiple times? |
07:11:17 | Araq_ | a or b or c |
07:11:27 | Prestige | ah didn't know about `or`, thanks |
07:13:01 | Araq_ | 'bitor' is the future though :-) and should have/get varargs support |
07:13:59 | Prestige | very neat - I'm really liking this language, have a lot to learn |
07:22:53 | * | NimBot joined #nim |
07:32:01 | FromGitter | <awr1> wasn't aware `bitor` got added |
07:37:45 | * | arecaceae quit (Remote host closed the connection) |
07:39:38 | * | arecaceae joined #nim |
07:40:35 | FromGitter | <jfilby> fixed my issue... had to specify OpenSSL v1.1 when compiling nimble |
07:47:52 | Prestige | Can you use logic/code blocks to define a variable at run time? e.g. if you had an array of ints you wanted to add together and assign to a variable |
07:53:13 | Prestige | Oh you can use a block to do it, that's so cool |
07:56:00 | * | natrys joined #nim |
07:58:47 | * | jjido joined #nim |
08:04:44 | FromGitter | <alehander92> morning. |
08:04:49 | FromGitter | <alehander92> how are you guuyys |
08:05:13 | FromGitter | <alehander92> ftsf karax can be used to generate it |
08:05:18 | FromGitter | <alehander92> using `$` on a vnode |
08:06:00 | FromGitter | <alehander92> e.g. something like `$(buildHtml(tdiv()))` |
08:06:04 | FromGitter | <alehander92> i guess? |
08:07:45 | PMunch | Prestige, some more fun with using code in assignments: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html |
08:08:04 | Prestige | Thanks :) |
08:08:55 | Prestige | I'm looking for a blog post I was reading yesterday, I think about macros.. being able to use something -> "foo" |
08:09:01 | Prestige | Can't remember where I saw it |
08:09:15 | PMunch | something -> "foo"? |
08:10:58 | Prestige | Yeah, maybe I'll run into it later. Was calling a proc to perform something with "foo" as a param |
08:11:43 | * | silvernode joined #nim |
08:12:35 | PMunch | Like this? https://play.nim-lang.org/#ix=2hY8 |
08:13:12 | narimiran | https://nim-lang.github.io/Nim/sugar.html#->.m%2Cuntyped%2Cuntyped ? |
08:13:21 | Prestige | Yeah, exactly |
08:14:41 | PMunch | Oooh, that syntax :P |
08:15:03 | PMunch | That's to define a proc return type |
08:15:09 | FromGitter | <alehander92> nicee |
08:15:25 | PMunch | And => can be used to create anonymous procedures |
08:15:39 | FromGitter | <alehander92> hm, can one pass iterators actually |
08:15:58 | PMunch | Huh? |
08:16:04 | FromGitter | <alehander92> like, to a function |
08:16:12 | PMunch | You can pass closure iterators |
08:16:21 | FromGitter | <alehander92> e.g. `toList[T, U](a: iterator[T]: U)` |
08:16:33 | FromGitter | <alehander92> `iterator(t: T): U` probably |
08:16:45 | FromGitter | <alehander92> hm, makes sense |
08:17:20 | FromGitter | <alehander92> maybe if `toList` was a template it would make sense to pass inline ones |
08:19:49 | PMunch | As in, you can do this: https://play.nim-lang.org/#ix=2hYa |
08:20:42 | PMunch | I mean, this also works: https://play.nim-lang.org/#ix=2hYb |
08:20:54 | PMunch | Nim automatically creates closure iterators in that scenario |
08:21:14 | PMunch | (This is how async is implemented by the way) |
08:21:35 | Prestige | Interesting, the example of closure iterators I saw was an iterator that returned another - but just using the closure pragma does that for you? |
08:21:48 | PMunch | Yes |
08:21:54 | Prestige | Dang that's cool |
08:22:09 | PMunch | Wait, an iterator that returned an iterator? |
08:22:27 | PMunch | You can make a procedure that returns an iterator to create a closure iterator |
08:22:38 | Prestige | Ah maybe that was what I saw |
08:23:19 | Prestige | I'll have to dig through the tutorial again |
08:23:23 | PMunch | (just by the same logic that the inline iterator I used there is automatically converted to a closure iterator an iterator created within a procedure will also be a closure iterator) |
08:25:10 | FromGitter | <alehander92> huhh |
08:25:12 | FromGitter | <alehander92> interesting |
08:25:19 | FromGitter | <alehander92> so there is a `finished()` function ! |
08:25:38 | PMunch | Yes, it checks if closure iterators are done |
08:25:49 | PMunch | Calling the iterator after that will just return the last value |
08:25:54 | FromGitter | <alehander92> ah so yeah it turns it to it |
08:26:05 | FromGitter | <alehander92> have you used channels btw |
08:26:21 | FromGitter | <alehander92> i wonder about one debugging feature for things like them in my job |
08:26:35 | FromGitter | <alehander92> and wondered how do people usually use them |
08:26:46 | PMunch | Yes I have |
08:27:54 | ftsf | will give a karax a try =) |
08:27:56 | PMunch | What do you mean how people usually use them? |
08:27:59 | FromGitter | <alehander92> do people always do `send` `recv` `send` |
08:28:10 | FromGitter | <alehander92> or do they like batch many things with several `sends` |
08:28:20 | FromGitter | <alehander92> i am not entirely sure how are they idiomatically used |
08:28:34 | PMunch | Depends on your usage |
08:28:35 | FromGitter | <mytxd> @alehander92 you mean network programming? |
08:29:04 | FromGitter | <alehander92> and do people usually know `X channel sends from this line in the code and receives on this line of the code` or do they often get selected/received in many locations (similar to calls) |
08:29:16 | FromGitter | <alehander92> @mytxd more like language-level channel primitives |
08:29:22 | FromGitter | <alehander92> e.g. something like nim / go channels |
08:29:26 | PMunch | Well it really depends on what you use them for |
08:29:30 | FromGitter | <mytxd> @alehander92 I get it |
08:29:44 | FromGitter | <mytxd> @alehander92 you can impl it by yourself |
08:29:54 | FromGitter | <alehander92> yeah but i dont want to |
08:30:14 | FromGitter | <alehander92> i don't need them in my code |
08:30:19 | PMunch | If you're doing a producer/consumer pattern where some threads create work and others perform it I would say it's fairly normal to have a single place in either thread where you recv/send |
08:30:21 | FromGitter | <alehander92> (maybe) |
08:30:34 | FromGitter | <alehander92> ok, great |
08:30:51 | FromGitter | <alehander92> (actually i maybe use some, but not the reason for my question :)) |
08:31:19 | FromGitter | <alehander92> and how do people synchronize stuff without "awaiting" |
08:32:09 | PMunch | Another is of course something like a tree traversal thing where all workers can create more work, then it might be multiple paths to `send` but typically only one `recv` at the start |
08:32:36 | PMunch | What do you mean? Channels are used with threads, so you don't have await.. |
08:35:11 | * | krux02 joined #nim |
08:39:11 | * | unclechu quit (Quit: killed) |
08:39:11 | * | BitPuffin quit (Quit: killed) |
08:39:11 | * | Demos[m] quit (Quit: killed) |
08:39:11 | * | watzon quit (Quit: killed) |
08:39:12 | * | GitterIntegratio quit (Quit: killed) |
08:39:13 | * | khanate[m]0 quit (Quit: killed) |
08:39:14 | * | k0mpjut0r quit (Quit: killed) |
08:39:14 | * | planetis[m] quit (Quit: killed) |
08:39:15 | * | tml[m] quit (Quit: killed) |
08:39:35 | * | vycb[m] quit (Quit: killed) |
08:39:36 | * | sirikon quit (Quit: killed) |
08:39:36 | * | dzamo[m] quit (Quit: killed) |
08:39:36 | * | reversem3 quit (Quit: killed) |
08:39:37 | * | skrylar[m] quit (Quit: killed) |
08:39:38 | * | lqdev[m] quit (Quit: killed) |
08:40:14 | * | silvernode quit (Ping timeout: 240 seconds) |
08:42:42 | FromGitter | <alehander92> ok, so |
08:43:12 | FromGitter | <alehander92> yeah, you just wait and let the `os` schedule everything |
08:43:41 | PMunch | Pretty much |
08:43:46 | FromGitter | <alehander92> and with fibers |
08:43:53 | FromGitter | <alehander92> you just wait for your own language runtime to do so |
08:44:13 | PMunch | Yeah |
08:44:13 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:44:17 | Araq_ | PMunch, if you think it helps nimlsp, we can add it to Nim like we integrate Z3 |
08:44:46 | PMunch | Sure, as long as I can still push to it |
08:47:56 | Zevv | leorize[m]: Yeah, sorry. I think I asked this before but not sure: would it be possbile to '*' and '#' to the next occurence of an identifier, properly handling style-insensitiveness? |
08:48:02 | * | Araq_ is now known as Araq |
08:48:23 | Zevv | I find I use that a lot, but when navigating code that is not strict that misses occurences |
08:53:07 | * | Demos[m] joined #nim |
08:56:04 | PMunch | By the way alehander92, fibers/coroutines cooperatively scheduled like async |
09:00:18 | FromGitter | <alehander92> yes indeed |
09:02:59 | FromGitter | <alehander92> so how do people synchrronize fibers? |
09:03:24 | PMunch | Pretty much the same way you do with async |
09:04:12 | FromGitter | <alehander92> so you can "wait" for them? |
09:04:25 | FromGitter | <alehander92> that's what tips me off |
09:04:43 | PMunch | Yes |
09:05:07 | PMunch | See for example Go's WaitGroup |
09:05:21 | PMunch | That allows you to wait for multiple goroutines to finish |
09:06:25 | * | liblq-dev joined #nim |
09:13:20 | PMunch | Hmm, would be nice to have something like Go's select in Nim |
09:13:55 | dom96 | definitely, someone "just" needs to implement it :) |
09:14:00 | PMunch | Haha |
09:15:12 | * | dwdv joined #nim |
09:21:21 | Yardanico | is it better to use `.add` or `&=` when adding stuff to a string variable? |
09:21:32 | Yardanico | I almost always used &= but maybe that's wrong 🤔 |
09:21:34 | dom96 | .add |
09:22:37 | Yardanico | I guess because &= will create a new string and concat two of my strings, and .add will add a string to an existing one so less allocations? |
09:22:55 | dom96 | no, both are the same |
09:23:04 | dom96 | it's just that .add has been around for longer and so I consider it more idiomatic |
09:23:15 | Yardanico | ah ok |
09:25:14 | FromGitter | <alehander92> and its more "generic" |
09:25:31 | FromGitter | <alehander92> as you use `add` for e.g. seq |
09:26:13 | Yardanico | time to replace &= with .add in all code I have :P |
09:27:06 | * | Trustable joined #nim |
09:27:09 | PMunch | dom96, got any better way of doing it than this? http://ix.io/2hYA |
09:29:44 | Araq | &= is more flexible as it also supports files and sockets too iirc |
09:30:29 | dom96 | lol, I remember arguing against allowing that, and I still hold that view |
09:30:35 | zedeus | maybe a silly rule but personally I use &= for strings and .add for seqs, feels natural to me |
09:30:37 | dom96 | PMunch, hrm, not sure |
09:30:56 | Yardanico | never knew there's &= for sockets :D |
09:31:05 | dom96 | just use `send` please |
09:31:18 | PMunch | So it would look something like this: https://play.nim-lang.org/#ix=2hYG |
09:32:24 | PMunch | zedeus, I follow the same "rule" |
09:32:40 | PMunch | dom96, that link was for you |
09:33:30 | PMunch | I'm not too stoked about having the completed sequence, but deleting things from a sequence is tricky.. |
09:33:49 | PMunch | I guess I could have a set of indexes for the completed futures.. |
09:34:36 | liblq-dev | dom96: agreed, operators look weird |
09:34:41 | liblq-dev | for IO |
09:34:41 | * | jjido joined #nim |
09:35:12 | FromGitter | <awr1> I prefer `&=` |
09:35:24 | FromGitter | <alehander92> you just reassign |
09:35:33 | FromGitter | <alehander92> futures to futures[1..^1] should be quick and safe imo |
09:35:55 | FromGitter | <alehander92> ah nvm sorry |
09:36:05 | FromGitter | <alehander92> i didnt see you delete those on each cycle anyway |
09:36:44 | FromGitter | <awr1> idk how to put it but denoting such a common operation with an operator sigil helps for readability |
09:36:58 | PMunch | There dom96, I like this solution better: https://play.nim-lang.org/#ix=2hYP |
09:37:29 | PMunch | Although it will go through all the futures even though they are completed.. |
09:37:42 | * | BitPuffin joined #nim |
09:37:42 | * | khanate[m]0 joined #nim |
09:37:42 | * | GitterIntegratio joined #nim |
09:37:42 | * | lqdev[m] joined #nim |
09:37:42 | * | k0mpjut0r joined #nim |
09:37:42 | * | reversem3 joined #nim |
09:37:42 | * | tml[m] joined #nim |
09:37:42 | * | unclechu joined #nim |
09:37:42 | * | watzon joined #nim |
09:37:48 | * | sirikon joined #nim |
09:37:48 | * | vycb[m] joined #nim |
09:37:48 | * | planetis[m] joined #nim |
09:37:48 | * | dzamo[m] joined #nim |
09:37:49 | * | skrylar[m] joined #nim |
09:37:56 | liblq-dev | holy moly |
09:38:14 | liblq-dev | Welcome to Matrix™, I guess |
09:38:17 | dom96 | PMunch, shouldn't this `select` work inside async procs not outside them? |
09:38:32 | dom96 | liblq-dev, why I don't use matrix :P |
09:38:47 | PMunch | Hmm, I guess.. |
09:38:57 | liblq-dev | dom96: I stopped using matrix because of its horribly high latency (at least on the official homeserver) |
09:39:05 | liblq-dev | IRC feels sooooo snappy |
09:39:07 | PMunch | What I'm doing should be called something like waitSelect |
09:39:20 | Yardanico | liblq-dev: well matrix bridge on freenode is written in nodejs :P |
09:39:21 | FromGitter | <Clyybber> @timotheecour Damn good job on https://github.com/nim-lang/Nim/pull/13976 ! |
09:39:46 | Yardanico | https://github.com/matrix-org/matrix-appservice-irc |
09:39:47 | liblq-dev | Yardanico: that's why it's so horrible. |
09:39:57 | FromGitter | <Clyybber> I wanted to fix that bug too, but I was under the assumption that sigmatch relies on this mutation to work |
09:40:02 | liblq-dev | rewrite it in Nim, problem's gone. |
09:40:04 | FromGitter | <Clyybber> Good to see thats not actually the case |
09:40:22 | FromGitter | <alehander92> PMunch love it |
09:40:40 | FromGitter | <alehander92> can i use something like this example to test my async stepping |
09:41:48 | FromGitter | <Clyybber> @timotheecour It should fix https://github.com/nim-lang/Nim/issues/12713 too afaict |
09:42:17 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:42:33 | PMunch | alehander92, yeah, that's what I wanted it for :P |
09:43:50 | PMunch | Hmm.. |
09:43:56 | PMunch | Can I inject a block label? |
09:44:50 | PMunch | I want to be able to break out of the select statement before all the futures complete |
09:50:25 | FromGitter | <alehander92> hm, are you modelling it after the go select: i also looked at go/crystal goroutine/fibers |
09:50:35 | FromGitter | <alehander92> thanks for the explanations PMunch |
09:50:47 | PMunch | Kinda |
09:51:13 | PMunch | The go select has a case statement kind of syntax |
09:51:25 | PMunch | Hmm, I guess I should do that instead.. |
09:52:25 | FromGitter | <alehander92> but do you need to do `of fut1:` |
09:53:48 | PMunch | Yeah that would be how it would work |
09:53:58 | FromGitter | <alehander92> how would you make it fast |
09:54:06 | PMunch | What do you mean? |
09:57:17 | PMunch | Hmm, can't you make a template that uses await? |
09:58:17 | * | ryan_ joined #nim |
09:59:07 | Yardanico | PMunch: you mean with current async implementation? |
09:59:15 | PMunch | Yes |
09:59:21 | Yardanico | https://github.com/nim-lang/Nim/pull/12085 |
10:00:10 | FromDiscord | <kodkuce> am i retarded cuz i cant get simple sort to work |
10:00:11 | FromDiscord | <kodkuce> https://play.nim-lang.org/#ix=2hZ3 |
10:00:40 | Yardanico | @kodkuce .sort is in-place |
10:00:40 | * | Tlongir quit (Ping timeout: 256 seconds) |
10:00:49 | Yardanico | it modified the original variable and doesn't return anything |
10:00:49 | PMunch | Ah.. |
10:01:03 | FromDiscord | <kodkuce> oh |
10:01:04 | Yardanico | if you want it to return instead, use "sorted" instead |
10:02:09 | PMunch | I really dislike the pattern of rewriting idents in a macro.. Good that async will (hopefully) get this fix soon. |
10:02:19 | FromDiscord | <kodkuce> yep that kinda solved it, tought error "ambiguous" i was thinking i am pasing wrong args whole time |
10:03:18 | Yardanico | well it says "no type" |
10:03:44 | Yardanico | so you're trying to assign something which has no type (because sort procedure doesn't return anything) to a variable |
10:06:36 | Yardanico | also it helps when you know a lot of stdlib :P |
10:08:29 | * | neceve joined #nim |
10:14:34 | PMunch | Hmm, why do callbacks to async procedures need to be gcsafe? |
10:20:01 | FromGitter | <alehander92> PMunch yes, i can fix this tomorrow |
10:20:13 | FromGitter | <alehander92> i am using a version of it from a long time in our codebase |
10:21:14 | FromGitter | <alehander92> good thing is one can add "no waitFor in async" after that |
10:21:20 | FromGitter | <alehander92> maybe |
10:23:15 | PMunch | dom96, not quite as pretty, but was it something like this you had in mind? https://play.nim-lang.org/#ix=2hZe |
10:23:49 | dom96 | I suppose |
10:24:07 | PMunch | alehander92, why would you disallow that? |
10:24:12 | dom96 | tbh I don't really see what I would use `select` for :) |
10:24:34 | Yardanico | I wonder if we'll be able to use threads GC'd memory with async with --gc:ard |
10:24:37 | Yardanico | *arc |
10:24:51 | PMunch | Read multiple files and start processing them as soon as any of them are read? |
10:24:53 | Yardanico | I mean using global GC variables with threads and async or something like that with arc |
10:25:16 | PMunch | I guess adding callbacks to them would work as well |
10:25:20 | PMunch | But eh.. |
10:27:11 | * | lritter quit (Ping timeout: 258 seconds) |
10:27:14 | PMunch | It's a bit annoying that `of` can't be used without a case. Would be cool for macros |
10:29:19 | * | abm joined #nim |
10:29:25 | FromGitter | <alehander92> PMunch because .. its a bad idea? |
10:29:28 | FromGitter | <alehander92> async shouldn't block |
10:29:53 | FromGitter | <alehander92> https://github.com/nim-lang/Nim/issues/11911 |
10:30:10 | PMunch | Well, just because it's a bad idea doesn't mean it doesn't have some use-case.. |
10:30:27 | PMunch | A warning sure, but just making it an error seems a bit too much |
10:30:29 | FromGitter | <alehander92> i think we argued about that before :P but i might misremember |
10:30:52 | PMunch | Haha, yes this does ring a bell |
10:31:06 | FromGitter | <alehander92> also https://forum.nim-lang.org/t/3920 |
10:31:18 | FromGitter | <alehander92> i dont know, people ignore warnings easily |
10:31:40 | FromGitter | <alehander92> they have their place, but sometimes i enjoy go's idea of "no warnings only errors" |
10:32:57 | FromGitter | <alehander92> i'd say an error for waitFor and if really needed an escape hatch which always produces a warning might be nice |
10:34:03 | PMunch | Yeah that would be fine |
10:34:24 | PMunch | I just feel like if it isn't something that would break anything it should be possible to do |
10:35:28 | FromGitter | <alehander92> it breaks a basic assumption of how async is used |
10:36:52 | PMunch | Well yes, but it doesn't break the code |
10:37:01 | FromGitter | <alehander92> but it can break code |
10:37:14 | FromGitter | <alehander92> it can lead to hard to diagnose weird behaviors |
10:37:19 | PMunch | Oh, for sure |
10:37:38 | PMunch | But it won't cause asyncdispatch to crash for example |
10:37:39 | FromDiscord | <Rika> You can say that for many things can't you |
10:37:54 | FromGitter | <alehander92> iirc i had some of those problems exactly because i thought waitFor is a good workaround |
10:37:59 | PMunch | Maybe my use-case requires some weird behaviour |
10:38:18 | FromGitter | <alehander92> and finally i managed to use await: it took some pain, but i am happy about it now |
10:38:39 | FromGitter | <alehander92> do you have a usecase where you can only use waitFor ? very interested in any such case |
10:38:54 | PMunch | Can't think of anything off the top of my head |
10:42:16 | FromGitter | <alehander92> i have to admit i cant think of an obvious example of waitFor breaking code |
10:42:21 | FromGitter | <alehander92> but i'll try these days :PO |
10:42:33 | FromGitter | <alehander92> breaking expectations maybe8 |
10:43:16 | dom96 | alehander92: agree with you 100% |
10:43:24 | dom96 | we need to disallow waitFor in async contexts |
10:44:13 | Yardanico | wait why people use waitFor in async anyway? |
10:45:29 | * | xet7 quit (Read error: Connection reset by peer) |
10:46:05 | * | xet7 joined #nim |
10:51:38 | * | Vladar joined #nim |
10:55:47 | * | xet7 quit (Ping timeout: 260 seconds) |
11:00:14 | * | xet7 joined #nim |
11:03:12 | * | waleee-cl joined #nim |
11:03:44 | stefantalpalaru | To run the event loop until a certain future is finished: https://github.com/nim-lang/Nim/blob/1e3bdf04d8db35f4ec6c697f0bb812d9903d1368/lib/pure/asyncdispatch.nim#L1883 |
11:07:54 | dom96 | Sure, but why would you want to run the event loop from inside the event loop? |
11:16:03 | FromGitter | <faulander> howdy ho guys. anybody know what a benc list is? From an RPC Documents: qa JSON array is equivalent to a benc list, a JSON object is equivalent to a benc dictionary, and a JSON object's keys are the dictionary's string keys.q |
11:16:56 | Yardanico | where is that from? |
11:16:59 | Yardanico | seems to be context-dependent |
11:17:05 | Yardanico | maybe byte-encoded? just a wild guess |
11:17:26 | FromGitter | <faulander> "The JSON terminology in RFC 4627 is used." |
11:17:43 | Yardanico | that RFC doesn't mention benc |
11:18:16 | Yardanico | Erlang BEncode ? |
11:18:19 | Yardanico | seems so |
11:18:23 | FromGitter | <faulander> it's here: https://github.com/transmission/transmission/blob/master/extras/rpc-spec.txt |
11:18:27 | Yardanico | yeah I found that |
11:18:30 | FromDiscord | <Recruit_main707> leorize, you told me i could create a static sequence of strings, how would i do it? |
11:18:31 | Yardanico | it's BEncode |
11:18:32 | FromGitter | <faulander> in 1.1 |
11:18:38 | Yardanico | https://github.com/jlouis/benc |
11:18:42 | Yardanico | https://github.com/notpeter/benc |
11:19:41 | FromGitter | <faulander> so i have to write a bencoder/decoder in nim aswell ... i thought my nim-transmission library would be easy to do :) |
11:19:58 | * | hipoint-yc9 quit (Killed (Sigyn (Stay safe off irc))) |
11:20:05 | FromGitter | <alehander92> huh i have written bencode libs |
11:20:22 | FromGitter | <alehander92> in elixir |
11:20:41 | FromGitter | <alehander92> it seems as a common thing to do there, i had bad reasons tho :( |
11:22:32 | FromGitter | <faulander> @alehander92 so you want to convert it to nim? :) |
11:23:19 | FromGitter | <alehander92> no, i dont like torrent tech anymore |
11:25:05 | FromGitter | <faulander> the rpc specs say: " JSON is fairly common now, but for the benefit of ⏎ torrent developers familiar with benc: ⏎ a JSON array is equivalent to a benc list, ⏎ a JSON object is equivalent to a benc dictionary, ⏎ and a JSON object's keys are the dictionary's string keys." ... [https://gitter.im/nim-lang/Nim?at=5e959d91e24b4d6c4408fe38] |
11:26:17 | * | xcm quit (Killed (livingstone.freenode.net (Nickname regained by services))) |
11:26:31 | FromGitter | <Yardanico> no, it doesn't say so |
11:27:00 | Yardanico | it just means that benc is fairly similar to JSON in usage |
11:28:07 | * | xcm joined #nim |
11:28:19 | FromGitter | <faulander> ok, thats a language issue. my english is pretty good, but sometimes i am not sure. |
11:28:41 | FromDiscord | <Recruit_main707> can i cast an string into an static strning?? |
11:28:56 | Yardanico | uhh |
11:29:02 | Yardanico | is that an "x y" problem? |
11:29:05 | Yardanico | why do you want to do that? |
11:29:25 | Yardanico | a static string is a string known at compiletime and you specify that type if you want to ensure that a proc/macro/etc gets a string which is known at compile-time |
11:29:29 | FromDiscord | <Recruit_main707> cImport wants an static string, and i want to automate it a bit |
11:31:14 | Yardanico | cImport is a macro |
11:31:25 | FromDiscord | <Recruit_main707> yep |
11:31:29 | Yardanico | and it needs that string at compile-time |
11:31:30 | Yardanico | not runtime |
11:31:35 | FromGitter | <alehander92> @dom96 stefantalpalaru PMunch is right |
11:31:54 | FromDiscord | <Recruit_main707> Yaradinco: cant i do it then? |
11:32:14 | FromDiscord | <Recruit_main707> creating a const array? |
11:32:22 | Yardanico | idk, try |
11:32:30 | Yardanico | but is it worth the effort? |
11:33:03 | FromDiscord | <Recruit_main707> not at all probably :P my lazyness is what makes me work for some reason |
11:36:13 | FromGitter | <alehander92> @dom96 stefantalpalaru PMunch we do need an example of valid usecase waitFor |
11:36:19 | FromGitter | <alehander92> before going with that error |
11:36:32 | FromGitter | <alehander92> i think i remember discussing with someone (zah?) if we need waitFor at all |
11:36:47 | FromGitter | <alehander92> if you think about it, with the proposed error, one would use waitFor asyncCall only in sync mode |
11:36:53 | FromGitter | <alehander92> and await asyncCall only in async mode |
11:37:04 | FromGitter | <alehander92> then why not just use the same name |
11:37:15 | PMunch | My point is that we don't need a valid usecase, but that we shouldn't explicitly disallow things just because we can't think of a usecase for them.. |
11:37:19 | FromGitter | <alehander92> `await asyncCall` everywhere and do the corresponding thing |
11:38:27 | FromGitter | <alehander92> PMunch that's not true, at the very least having un-useful choice is a bad thing |
11:38:38 | PMunch | That would definitely lead to errors with the current implementation.. |
11:38:40 | FromGitter | <alehander92> why does one need to choose between waitFor, await, discard, asyncCheck |
11:38:58 | FromGitter | <alehander92> it doesnt make sense to offer so many "keywords" for only 2 possible cases |
11:39:02 | PMunch | The async as template PR must be merged for that |
11:39:10 | FromGitter | <alehander92> you either wait or you start it in the background |
11:39:43 | FromGitter | <alehander92> you can combine waitFor and await into just `await` overloaded differently in sync and in async |
11:39:46 | PMunch | So you want to default have the asyncCheck callback, and then overwrite it if you await it? |
11:40:05 | FromGitter | <alehander92> and discard future/asyncCheck future to just asyncCheck |
11:40:27 | FromGitter | <alehander92> no, i want to also disable `discard future` inside `async` |
11:41:26 | FromGitter | <alehander92> so e.g. your programs just do ⏎ proc run {.async.} = await stuff(); # toplevel => ; await run() |
11:41:30 | stefantalpalaru | alehander92: https://github.com/status-im/nim-beacon-chain/search?q=waitfor&unscoped_q=waitfor |
11:42:02 | FromGitter | <alehander92> stefantalpalaru i am talking about waitFor inside `async` |
11:43:18 | FromGitter | <alehander92> basically the point is that the existence of both `waitFor` and `await` keywords is a problem as it creates the artificial "what if i use waitFor inside `{.async.}` situation |
11:44:14 | FromGitter | <alehander92> and they could just be the same keyword with different overloads in both contexts |
11:44:37 | FromGitter | <faulander> i have found a c implementation of bencode here: https://github.com/transmission-remote-gtk/transmission-remote-gtk/blob/master/src/bencode.c ⏎ how would i include that in my program? |
11:44:56 | FromGitter | <alehander92> (but i guess then this would be confusing because people expect `await` only in async .) |
11:45:44 | FromGitter | <faulander> sorry, but i am a complete newbie when it comes to compiling and dealing with c code. |
11:57:06 | FromDiscord | <Rika> im up for a warning for waitFor, but not an error |
11:58:02 | FromDiscord | <Rika> an error sounds too extreme, and if people wanted it to error, they'd set the warning into error anyway |
11:58:41 | FromGitter | <alehander92> sorry, but you can have a warning for 1 & @[2] using that logic |
11:59:35 | FromGitter | <alehander92> the default for many things should be an error, and if there is an escape hatch, users should opt-in to use that/to turn the error into warning |
12:00:42 | FromGitter | <alehander92> turning X into Y requires work and time and its basically a roadblock |
12:01:11 | FromGitter | <alehander92> you should put roadblocks for people when they try to escape errors, not when they try to get those |
12:01:39 | FromGitter | <alehander92> (of course backward compat changes everything :D ) |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:45 | * | supakeen joined #nim |
12:08:15 | * | zyklon quit (Ping timeout: 250 seconds) |
12:11:30 | * | dadada quit (Ping timeout: 256 seconds) |
12:11:31 | * | liblq-dev quit (Read error: Connection reset by peer) |
12:13:08 | * | dadada joined #nim |
12:13:30 | * | dadada is now known as Guest15541 |
12:14:38 | * | bra-ket joined #nim |
12:17:33 | * | hipoint-yc9 joined #nim |
12:18:18 | dom96 | alehander92: yeah, to be honest it's good that this is called out: that you cannot use await outside {.async.} because then it would be more confusing |
12:18:46 | dom96 | and yeah, `waitFor` inside async should be an error |
12:18:55 | dom96 | not a warning |
12:19:05 | dom96 | You should never block inside an async proc |
12:20:15 | * | Guest15541 is now known as dadada |
12:20:22 | dadada | hey |
12:20:32 | Yardanico | hallo |
12:21:04 | FromGitter | <alehander92> @dom96 yeah |
12:21:35 | FromGitter | <alehander92> i also want to find a way to detect stuff like blocking syscalls inside async |
12:21:49 | dadada | why do unittest unittests default to success? Isn't that illogical? An empty test being successful? Shouldn't there always be a check() or something to that liking be required be successful before a test as a whole can be? |
12:21:51 | FromGitter | <alehander92> it almost seems to be workable with tags |
12:22:05 | dadada | s/be/to be |
12:22:55 | FromGitter | <alehander92> well, maybe its a bit like a `SKIP` test |
12:23:05 | FromDiscord | <Rika> `You should never block inside an async proc` (disclaimer: im kidding) so are we banning all non-async procs in async procs too now? |
12:24:14 | dom96 | Rika: not all non-async procs block |
12:24:26 | dom96 | if we could annotate the ones that do then yes, banning them would be ideal |
12:24:41 | dom96 | (and I have considered doing this using the effect system, it's just a lot of effort) |
12:24:46 | * | dddddd joined #nim |
12:25:15 | dom96 | regarding `asyncCheck` too, we should get rid of it, I also considered what alehander92 suggested: to make it implicit. IIRC there were some blockers for that |
12:26:44 | FromGitter | <alehander92> @dom96 yeah exactly, but we can add a bit to the tags system, so it becomes quite easy |
12:27:03 | FromGitter | <alehander92> to annotate something like `{.tags: [not Blocking].}` |
12:27:16 | Yardanico | yeah, we already have IO tags |
12:27:26 | FromGitter | <alehander92> the problem is different imo |
12:27:36 | FromGitter | <alehander92> we need to be able to check for the absense of tags |
12:27:43 | FromGitter | <alehander92> not to have to write down all found ones |
12:27:50 | FromGitter | <alehander92> in all cases |
12:28:04 | FromGitter | <alehander92> iirc Araq thought `not tag` might be ok to add |
12:28:13 | dom96 | if you do that then you'll end up needing to annotate a lot of procs which are just doing CPU work |
12:28:22 | dom96 | indeed, what Yardanico said, we may be able to reuse IO tags |
12:28:30 | FromGitter | <alehander92> but we still need `not` |
12:28:40 | FromGitter | <alehander92> because otherwise you need to annotate all other effects |
12:28:43 | dadada | uh, are tags a new Nim feature? :-) |
12:28:44 | dom96 | yeah, the effects/exception tracking system always needed this expansion |
12:28:45 | FromGitter | <alehander92> which often people dont care about |
12:28:55 | FromGitter | <alehander92> in their own code |
12:29:06 | dom96 | I've always wanted to be able to state "raises anything but MyExceptionType" |
12:30:14 | FromGitter | <alehander92> about the cpu work: that's very true, and it would be perfect if was possible to somehow annotate on base of some kind of limit (e.g. this function call costs "X", i want my async-s to call only up to Y) |
12:30:18 | FromDiscord | <Rika> `if we could annotate the ones that do then yes, banning them would be ideal` if only the halting problem were solvable 😛 |
12:30:27 | FromGitter | <alehander92> but this is very very far for now |
12:30:46 | dadada | if Nim didn't use # for comments, given that this symbol is known as hashtag all around and generally used for tagging things, we could #notblocking , which would be a lot of shorter (and IMO better looking) |
12:30:51 | dom96 | Rika: we're talking about IO here, not CPU taking forever |
12:31:00 | FromDiscord | <Rika> hey, im still joking |
12:31:25 | dom96 | dadada, let's not derail into a syntax discussion :) |
12:31:42 | FromGitter | <alehander92> at least the cpu taking forever ones are probably easy to detect/debug |
12:32:32 | FromGitter | <alehander92> and indeed one can move that to profile-like tools: "report all sync calls taking >x ms in async functions" |
12:32:54 | FromDiscord | <Skaruts> is there not a proc to empty a sequence? |
12:33:04 | dadada | dom96: I'm sorry, for derailing |
12:33:27 | FromGitter | <alehander92> and finally one can always add a `Blocking` or `CPUHeavy` tag for his own function that does a lot of calculations etc |
12:33:39 | FromGitter | <alehander92> if e.g. he wants it to be forced in another thread |
12:33:44 | FromDiscord | <Skaruts> or maybe simply doing `a = newSeq[T]()` will be enough? |
12:34:07 | dadada | s/of shorter/sharter |
12:34:11 | dom96 | Skaruts: you can setLen(0) on the seq or just assign @[] to it |
12:34:12 | dadada | shoter |
12:34:13 | FromGitter | <alehander92> @dom96 hm the `raises but` seems interesting |
12:34:17 | FromDiscord | <Rika> setlen is better |
12:34:20 | dadada | shorter .. what's up with my typing skills |
12:34:25 | FromDiscord | <Skaruts> ah thanks |
12:34:31 | FromDiscord | <Skaruts> didn't think of that |
12:34:49 | FromDiscord | <Skaruts> (didn't know about setLength either) |
12:34:49 | dom96 | alehander92: let's lobby Araq to make it happen :) |
12:35:52 | FromGitter | <alehander92> @dom96 i am ok with that, (i have to admit i start to like result types more and more tho :P) |
12:36:02 | FromGitter | <alehander92> but we push for `not tag` as well :P |
12:39:02 | FromDiscord | <Recruit_main707> shashlick: i have an issue with nimterop, i wrote it in gitter |
12:39:23 | Araq | IMHO we should use the type system to encourage correctness and profilers to encourage efficiency |
12:39:45 | dom96 | tags are part of the type system :) |
12:40:34 | Araq | and in my code a[i] can be "blocking" and yet I don't want to write 'await a[i]', go figure |
12:42:40 | dom96 | the purpose of this is to know that something is blocking |
12:43:04 | dom96 | it would be a very useful feature and of course we can make it possible to disable it if you just don't care |
12:44:58 | Yardanico | just fyi (I don't feel this is a better approach, but still) - zig chose to enable/disable async "globally" |
12:45:17 | Yardanico | if you enable async in your app everything in stdlib (where possible) will be used in async mode |
12:46:20 | Yardanico | but of course async in zig is implemented in the compiler :) |
12:46:56 | FromGitter | <alehander92> Araq well we wouldn't annotate stuff like `a[i]` as blocking |
12:47:16 | * | tane joined #nim |
12:47:35 | FromGitter | <alehander92> its more about a limited set of known calls+codebase-specific calls which every user can decide on himself |
12:49:25 | dom96 | It's about annotating things like Socket.send as blocking |
12:49:26 | * | Vladar quit (Quit: Leaving) |
12:49:34 | FromGitter | <alehander92> and it is about correctness Araq |
12:49:37 | dom96 | the compiler can the infer anything that calls into that proc as blocking |
12:49:50 | dom96 | that may in fact be a `[]` proc which for some reason calls `send` |
12:50:12 | FromGitter | <alehander92> i did have an actual bug once where i didnt realize a future running in the background cant be woken up because of a long syscall somewhere |
12:54:28 | * | rockcavera joined #nim |
12:58:09 | * | Vladar joined #nim |
13:01:00 | * | inv2004 joined #nim |
13:01:02 | Araq | alehander92: interesting |
13:04:35 | * | zacharycarter joined #nim |
13:16:54 | * | hipoint-yc9 quit (Quit: FREENODE IS FUCKING GAY) |
13:16:59 | Yardanico | lol |
13:17:16 | * | hpyc9 joined #nim |
13:39:45 | FromGitter | <sealmove> that's weird, I get "Error: type mismatch: got <int literal(0), uint32>" when doing `a > b` |
13:40:06 | FromGitter | <sealmove> `a > 0` actually, and `a` is a `uint32` |
13:40:10 | Yardanico | huh |
13:40:39 | narimiran | do `a > 0'u32` |
13:40:58 | * | krux02 quit (Remote host closed the connection) |
13:40:58 | Yardanico | well yeah that's understandable |
13:41:12 | Yardanico | but people might expect a > 0 to work :P |
13:41:21 | FromGitter | <sealmove> why doesn't it work? |
13:42:15 | Yardanico | because by default number literals are assumed to be of type "int: |
13:42:16 | Yardanico | " |
13:42:55 | dom96 | `import lenientops` may help you out here |
13:43:00 | * | xcm quit (Remote host closed the connection) |
13:43:21 | FromGitter | <sealmove> so `<` is not defined for `(x: SomeUnsignedInt, y: SomeSignedInt)` |
13:43:34 | Yardanico | !eval import lenientops; let a: uint32 = 5; echo a > 0 |
13:43:37 | NimBot | true |
13:43:42 | dom96 | yay |
13:44:04 | FromGitter | <sealmove> wow! I didn't know about lenientops, this looks like exactly what I need, thanks! <3 |
13:44:54 | * | xcm joined #nim |
13:46:38 | * | salotz[m] joined #nim |
13:46:52 | Yardanico | yeah, some modules get less attention sadly |
13:47:00 | Yardanico | like strscans, parseutils, etc |
13:47:25 | dom96 | What would be cool is if the compiler could suggest imports based on type mismatches |
13:47:42 | dom96 | or at least have it hard coded to suggest lenientops for these kinds of situations |
13:48:02 | Araq | I thought about an error message filter |
13:48:21 | Araq | it would translate error messages into helpful URLs/wiki pages |
13:48:39 | Araq | could be an external tool even |
13:48:53 | dom96 | that would be cool too |
13:49:11 | dom96 | that way we could improve the compiler's error messages without new Nim releases |
13:49:28 | dom96 | the tough part would be ensuring the URLs stay the same between Nim versions |
13:49:32 | dom96 | but I love this idea |
13:50:02 | Araq | hmm I need a persistent data structure |
13:50:20 | FromDiscord | <Rika> strscans, parseutils, strtabs, lexbase, a lot of stdlib modules pretty much unknown to anyone |
13:50:28 | Araq | any experience here about these? |
13:50:50 | Araq | I usually use a 'seq' with another seq stack |
13:51:07 | Yardanico | @Rika parseutils are actually very cool |
13:51:13 | Yardanico | when you need to parse things :P |
13:53:10 | FromDiscord | <skyhawk172> hello, can someone help with re-sending email confirmation email for the nim forum? |
13:54:14 | Yardanico | dom96: ^ |
13:54:54 | Araq | PMunch, didn't you implement a "persistent" lookup table once? |
13:55:06 | Yardanico | @skyhawk172 what's your forum nickname? |
13:55:15 | FromDiscord | <skyhawk172> martinc |
13:55:41 | FromDiscord | <skyhawk172> the original email never came and I can't find any way to re-send it myself 😦 |
13:55:53 | companion_cube | Araq: give a try to the "HAMT" structure maybe? |
13:56:08 | companion_cube | (and if you have access to the refcount internally and it's 1, you can mutate) |
13:57:37 | companion_cube | (if you want a persistent map) |
13:58:10 | * | endragor quit (Remote host closed the connection) |
14:06:41 | FromDiscord | <Krey> Are different versions of the compiler gcc/clang a concern for nim runtime? |
14:06:41 | FromDiscord | <Krey> |
14:06:41 | FromDiscord | <Krey> ``` |
14:06:41 | FromDiscord | <Krey> choosenim-init: Downloading choosenim-0.6.0_linux_amd64 |
14:06:41 | FromDiscord | <Krey> Prompt: Can choosenim record and send anonymised telemetry data? [y/n] |
14:06:42 | FromDiscord | <Krey> ... Anonymous aggregate user analytics allow us to prioritise |
14:06:44 | FromDiscord | <Krey> ... fixes and features based on how, where and when people use Nim. |
14:06:46 | FromDiscord | <Krey> ... For more details see: https://goo.gl/NzUEPf. |
14:06:47 | FromDiscord | <Krey> Answer: Forced Yes |
14:06:49 | FromDiscord | <Krey> Tip: 1 messages have been suppressed, use --verbose to show them. |
14:06:51 | FromDiscord | <Krey> Error: No C compiler found. Nim compiler requires a C compiler. |
14:06:53 | FromDiscord | <Krey> ... Install clang or gcc using your favourite package manager. |
14:06:54 | FromDiscord | <Krey> ##[error]Process completed with exit code 1. |
14:06:54 | FromDiscord | <Krey> ``` |
14:06:56 | FromDiscord | <Krey> *me is processing https://github.com/RXT0112/Zernit/pull/101* |
14:06:58 | Yardanico | pls don't paste in irc |
14:07:07 | Yardanico | I mean don't paste in discord |
14:07:10 | Yardanico | in irc it's split in messages |
14:07:16 | FromDiscord | <Krey> Yardanico: Sorry didn't know it's bridged on IRC |
14:07:50 | FromDiscord | <Krey> Yardanico: paste: http://dpaste.com/3ZSKAVT |
14:08:21 | FromDiscord | <Rika> Yardanico: do you use lexbase too? |
14:09:29 | Yardanico | not yet, might try late r:P |
14:11:10 | FromDiscord | <Yardanico> @Krey I don't know how your package manager handles dependencies, but nim needs a C compiler to be available |
14:11:21 | FromDiscord | <Yardanico> either clang or gcc (well, a lot of others are supported but these are the main ones) |
14:11:32 | FromDiscord | <Krey> @Yardanico this is CI running on debian:stable docker |
14:11:45 | FromDiscord | <Yardanico> does it have a C compiler though? |
14:11:53 | FromDiscord | <Krey> i figured as much but are different versions of gcc/clang a concern for nim runtime? |
14:11:58 | FromDiscord | <Krey> if so -> i need to implement CI for it |
14:12:03 | euantor | Try installing `build-essential`: `apt-get install -y build-essential` |
14:12:07 | FromDiscord | <Yardanico> not really, nim supports most GCC versions |
14:12:09 | FromDiscord | <Yardanico> and clang |
14:12:11 | FromDiscord | <Krey> @Yardanico It doesn't have anything by default |
14:12:22 | FromDiscord | <Yardanico> if it's newer than 3.x |
14:12:49 | FromDiscord | <Krey> @Yardanico Noted version >=3.X |
14:12:57 | FromDiscord | <Yardanico> well, not equal, just > 3.x |
14:13:03 | FromDiscord | <Krey> can you elaborate on other compilers? |
14:13:05 | FromDiscord | <Krey> noted |
14:14:21 | FromDiscord | <Rika> Yardanico, which is more recommended to use or smth, parseutils or npeg? |
14:14:24 | FromDiscord | <Yardanico> full list of compilers can be found there https://github.com/nim-lang/Nim/blob/devel/compiler/extccomp.nim#L66 |
14:14:49 | FromDiscord | <Yardanico> gcc, clang, tcc, icc, vcc (visual studio c compiler), etc |
14:14:55 | FromDiscord | <Yardanico> @Rika depends on your usecase |
14:15:10 | FromDiscord | <Rika> what do you mean? |
14:15:19 | FromDiscord | <Rika> what factors would it depend on |
14:15:55 | FromDiscord | <Yardanico> on what do you need it for? why would you use npeg if you, say, want to parse a simple string of 4 ints separates by a comma fast |
14:16:38 | Araq | companion_cube, thanks, for now I'm trying my hacky solution which is likely to be fast enough anyway |
14:17:03 | FromDiscord | <Yardanico> my mathexpr lib uses parseFloat and parseIndent from parseutils |
14:18:18 | FromDiscord | <kodkuce> can i concant string whit terary in it |
14:18:20 | FromDiscord | <kodkuce> echo "Running on " & $pnumber & " uploading:" & if uAllowed: "enabled" else: "disabled" |
14:18:28 | FromDiscord | <kodkuce> it crys error |
14:18:32 | FromDiscord | <Yardanico> yes you can |
14:18:58 | FromDiscord | <Yardanico> just put if expression into parens |
14:19:05 | FromDiscord | <Yardanico> echo "Running on " & $pnumber & " uploading:" & (if uAllowed: "enabled" else: "disabled") |
14:19:05 | FromDiscord | <kodkuce> oh |
14:19:21 | FromDiscord | <Yardanico> also check out strformat for string formatting 🙂 |
14:19:22 | FromDiscord | <Recruit_main707> why is this not printing all the subfolders and only the first one? https://play.nim-lang.org/#ix=2i0T |
14:19:42 | FromDiscord | <Yardanico> @Recruit_main707 you need walkDirRec |
14:19:48 | FromDiscord | <Yardanico> walkDir is not recursive |
14:20:03 | FromDiscord | <Recruit_main707> ok |
14:20:28 | FromDiscord | <Yardanico> also check out splitPath if you want to check extension 🙂 |
14:20:44 | FromDiscord | <Yardanico> ah sorry splitFile |
14:20:55 | FromDiscord | <Recruit_main707> ok, thank you |
14:21:13 | FromDiscord | <kodkuce> ty |
14:21:33 | FromDiscord | <Rika> i guess npeg is for more complicated structured formats |
14:22:34 | Yardanico | well I can rewrite my whole mathexpr using npeg probably, but idk if I need that |
14:23:09 | Yardanico | right now lexer and evaluator are glued together in mathexpr :) I remember I did a version with AST and then evaluation of that AST later but there was a lot of code duplication |
14:24:16 | FromDiscord | <Yardanico> maybe I should just write an interpreter for my own language to learn how to properly do AST stuff |
14:24:24 | FromDiscord | <Yardanico> seems simple enough |
14:24:26 | FromDiscord | <Yardanico> xd |
14:25:31 | Yardanico | https://github.com/search?q=language%3Anim+interpreter |
14:25:54 | * | jjido joined #nim |
14:27:10 | FromDiscord | <Rika> got any tutorials or books on parsing and lexing? i got no fuckin clue where to start |
14:27:21 | Yardanico | maybe you want to build a compiler instead? :DD |
14:28:08 | FromDiscord | <Rika> nah i just wanna parse files into data (see: the osu library) i wanna move it from some hacky shit to something more "professional" or something |
14:28:32 | FromGitter | <zetashift> @Rika http://craftinginterpreters.com/ and https://interpreterbook.com/ |
14:29:01 | FromGitter | <zetashift> A long time ago I also read a tutorial where they used OCaml to make a parser combinator but I can't seem to find it :/ |
14:29:17 | FromDiscord | <Yardanico> Well you don't always need to use stuff like npeg. People do manual lexers (so you do all parsing manually) for performance or sometimes to understand better |
14:29:29 | FromDiscord | <Krey> @Yardanico Thanks |
14:29:38 | FromDiscord | <Yardanico> If I'm not mistaken Nim compiler uses manual lexing too |
14:29:41 | FromDiscord | <Krey> How is nim on security? Do i need to implement valgrind or something? |
14:30:24 | FromDiscord | <Recruit_main707> as safe as you want it to be (almost sure) |
14:31:03 | FromDiscord | <Krey> As safe as i want it to be does not seem very comforming for the end-users.. |
14:31:29 | * | Guest85 joined #nim |
14:31:49 | FromDiscord | <Yardanico> Well you can use valgrind with Nim, yes. Usually Nim is safe unless you do FFI or low level stuff like raw pointers and manual memory allocation |
14:32:01 | FromDiscord | <Yardanico> There's no null safety by default though |
14:32:18 | FromDiscord | <Recruit_main707> essentially, if you dont want to mess with very low level stuff, safe, thats what i meant |
14:33:34 | FromDiscord | <Yardanico> Well it all depends on what you mean by "safe" |
14:34:57 | FromDiscord | <Recruit_main707> id say, based on the meaning ive been hearing Nim is very safe (and also allows you to not be safe if you really want to) but you wont get something pointing to null if you dont want to |
14:35:13 | FromDiscord | <Krey> @Yardanico Not leaking any memory and doesn't do anything unexpected in such a way that can't be influenced by random 3rd parties |
14:36:30 | FromDiscord | <Recruit_main707> The default garbage collector doesnt have any known memory leaks, arc only leaks when used with async, about the random libraries, i dont even know how that works |
14:37:41 | FromDiscord | <Krey> > The default garbage collector doesnt have any known memory leaks, |
14:37:41 | FromDiscord | <Krey> |
14:37:41 | FromDiscord | <Krey> Is there any tracking for known bugs? i.e Vlang implemented this for me: https://github.com/vlang/v/issues/3972 |
14:37:45 | FromGitter | <alehander92> Yardanico you can really do it easily |
14:38:00 | FromDiscord | <Yardanico> I know |
14:38:06 | FromDiscord | <Yardanico> @Krey well kinda |
14:38:07 | FromGitter | <alehander92> what i mean is that |
14:38:12 | FromGitter | <alehander92> there are many places to start |
14:38:16 | FromGitter | <alehander92> e.g. you can start from existing AST |
14:38:25 | FromGitter | <alehander92> like importing the nim parser module |
14:38:26 | FromDiscord | <Yardanico> https://github.com/nim-lang/RFCs/issues/4 |
14:38:32 | FromDiscord | <Krey> @Yardanico Ideally i would like to implement a logic in a software that warns the end-users about known issues |
14:38:47 | FromDiscord | <Yardanico> ? What does that mean |
14:39:34 | FromDiscord | <Krey> @Yardanico i.e using Github API to fetch issues with specific label and if any is fetched -> Output huge security message for the end-user every time they use the software |
14:39:50 | FromDiscord | <Krey> prompting to update or providing logic to hotfix |
14:40:16 | FromDiscord | <Yardanico> What's the point then? |
14:40:29 | FromDiscord | <Yardanico> I'm not sure how that can be useful |
14:40:38 | FromDiscord | <Krey> if there is anything done on nim that can be used this way in software logic |
14:43:00 | FromDiscord | <Krey> Assuming that provided software is beeing rewritten in all other languages to provide options in case major security issue is discovered |
14:45:07 | * | moerm joined #nim |
14:45:19 | moerm | Hello everybody |
14:47:07 | FromGitter | <zetashift> hiya |
14:48:58 | FromGitter | <zetashift> @Krey you might be looking for Ada and not Nim, though I don't see any 'security risks' using Nim and it's current GC |
14:49:35 | FromDiscord | <Krey> How do i make `nim check` to die on code-quality issues? (https://github.com/RXT0112/Zernit/pull/101/checks?check_run_id=586025506#step:7:23) -- It returns 0 on failure.. |
14:49:39 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:50:05 | FromDiscord | <Krey> @FromGItter what do you mean by Ada? |
14:50:14 | * | icebattle joined #nim |
14:50:14 | * | jjido joined #nim |
14:50:30 | FromGitter | <zetashift> @Krey https://www.adacore.com/about-spark this is what I ment |
14:50:50 | moerm | Krey wait a little (weeks rather than months) and you'll find nim having a static analyser akin to SPARK for Ada |
14:51:17 | FromDiscord | <Krey> zetashift: All languages are expected to be supported by Zernit project so Ada is irelevant for the implementation of Nim atm |
14:51:21 | companion_cube | this kind of thing takes a long time to mature, though |
14:51:26 | companion_cube | static analysis is hard |
14:51:40 | FromGitter | <zetashift> ah okay then I misunderstood |
14:52:19 | moerm | Key Expected by *whom*? |
14:53:21 | moerm | And btw, do have a link "Zernit project"? |
14:53:30 | moerm | -Key +Krey |
14:53:47 | FromGitter | <zetashift> @moerm he posted it a bit ago I think: https://github.com/RXT0112/Zernit |
14:53:58 | FromDiscord | <Krey> Relevant https://github.com/RXT0112/Zernit/pull/101 |
14:54:11 | moerm | Thx |
14:54:34 | FromDiscord | <Krey> How can i make nim to use different compiler? |
14:54:42 | FromDiscord | <Krey> *me wants to force it to use different compiler for tests* |
14:55:11 | Yardanico | --cc:clang |
14:55:14 | dom96 | @skyhawk172 activated it for you |
14:55:18 | Yardanico | --cc:zig |
14:55:29 | dom96 | Yardanico, also, note I'm not the only one that can do that ^ Araq can too :P |
14:55:40 | Yardanico | lol |
14:56:05 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:56:36 | FromDiscord | <Krey> @Yardanico `nim --cc:clang path/to/file` ? |
14:56:43 | Yardanico | yes, if you have clang installed |
14:56:47 | FromDiscord | <Krey> thanks |
14:56:49 | Yardanico | nim c --cc:Clang |
14:56:54 | FromDiscord | <Recruit_main707> ^ |
14:56:54 | Yardanico | nim c --cc:clang path/to/file * |
14:57:04 | Yardanico | also nim has c++, objective c and JS backends |
14:57:12 | Yardanico | the C backend being the main one |
14:57:31 | FromDiscord | <Krey> Can `nim check` with different compiler output different results ? |
14:57:47 | Yardanico | uhh, nim check doesn't compile your code |
14:57:49 | * | icebattl1 joined #nim |
14:57:57 | FromDiscord | <Krey> it checks the code afaik |
14:58:20 | FromDiscord | <Krey> i meant if it can find different problems depending on compiler user |
14:58:21 | FromDiscord | <Krey> i meant if it can find different problems depending on compiler used |
14:58:34 | FromGitter | <zetashift> No it shouldn't |
14:58:40 | * | hax-scramper quit (Ping timeout: 256 seconds) |
14:58:51 | FromDiscord | <Krey> > shoudn't ? -> Implement CI just to be sure? |
14:58:52 | FromDiscord | <Recruit_main707> syntax will be the same despite the backend (except backned exclusive things obv) |
14:59:13 | FromDiscord | <skyhawk172> @dom96 it works now, thank you! 🙂 |
14:59:41 | * | hax-scramper joined #nim |
15:00:10 | FromGitter | <zetashift> the code you feed to the C compiler will first be nim `check`'d so the output will always be the same and then it will be fed to a compiler so it's a separation |
15:00:36 | * | icebattle quit (Ping timeout: 256 seconds) |
15:01:09 | FromDiscord | <Recruit_main707> being c the chosen backend i guess right? |
15:01:57 | FromGitter | <zetashift> yea if you have JS as a backend it'll still nim check but since the output are just js files it doesn't really matter |
15:02:00 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
15:02:25 | * | kitech1 joined #nim |
15:02:45 | FromGitter | <zetashift> So it cannot find different problems depending on (C) compiler used, ofcourse the C compiler might output some different stuff |
15:03:25 | FromGitter | <zetashift> AFAIK there is a clear separation between `nim check` and `nim c/js` |
15:04:54 | * | hax-scramper quit (Read error: Connection reset by peer) |
15:05:08 | * | hax-scramper joined #nim |
15:05:19 | Yardanico | @zetashift thanks for http://www.craftinginterpreters.com/ , I guess I'm gonna disappear from the real world for some time XDD |
15:06:16 | FromGitter | <zetashift> haha I've been following it using Scala it's an absolute delight |
15:06:32 | FromGitter | <alehander92> awesome |
15:06:59 | FromGitter | <alehander92> yardanico better come more often to share with us your progress :P |
15:07:23 | Yardanico | I wonder if there's pdf for that book |
15:07:36 | Yardanico | or epub |
15:07:43 | PMunch | Araq, sorry I was at the store. I did make persistent vectors, but not lookup tables |
15:08:15 | moerm | Araq is here and actually present? |
15:08:19 | FromDiscord | <Rika> i kinda only wanted parsing and lexing, im not looking into creating a programming language |
15:08:29 | Yardanico | moerm: unbelievable right? |
15:08:31 | Yardanico | xD |
15:08:34 | FromDiscord | <Rika> i'll look into some other resources |
15:08:47 | Yardanico | moerm: without joking 4raq is almost always in IRC |
15:09:56 | FromGitter | <zetashift> @Yardanico from the books github issue the author states "Hi, I plan to create and sell a PDF version once the book is complete, like I did with my previous book. :)" |
15:10:27 | FromGitter | <zetashift> @Rika I mean you can just read the chapters about parsing and lexing? |
15:10:46 | PMunch | I was meaning to do the trees as well, but never got around to it |
15:10:47 | moerm | Yardanico No, that's not my point but rather why I can't see anythin from him |
15:10:55 | Yardanico | well he's busy you know :D |
15:11:13 | moerm | So he's here but not present? |
15:11:23 | Yardanico | well if you ping him he'll probably reply |
15:11:37 | * | chemist69_ quit (Ping timeout: 260 seconds) |
15:12:07 | FromGitter | <zetashift> he watches over us like Batman |
15:12:13 | Yardanico | the overlord |
15:12:29 | moerm | Yardanico Nuh, I don't want to disturb him |
15:12:53 | moerm | Btw is there some trick to avoiding to have to type the Names in IRC? |
15:12:58 | Yardanico | ?? wdym |
15:13:09 | Yardanico | if you want to ping someone you have to write their name, since pinging is client-side, not server-side |
15:13:31 | * | chemist69 joined #nim |
15:13:34 | Yardanico | the IRC client checks all messages and makes a notification if it matches your nicknames or whatever lines you might add in your config |
15:14:22 | moerm | Thx |
15:15:38 | PMunch | moerm, if you want to avoid having to type the name your client might support tab completion (at least HexChat does) |
15:16:17 | supakeen | Also in general people leave their clients open just so they can read backlogs when they get back to a computer and/or any mentions of their name they have missed. |
15:16:42 | PMunch | irclogs.nim-lang.org can help you there for this specific channel though |
15:16:53 | Yardanico | supakeen: I use Quassel so yeah :P |
15:16:57 | Yardanico | I'm *always* online |
15:18:16 | moerm | PMunch, A big Thx! I happen to use Hexchat and that was exactly what I was looking for. Nice. |
15:18:20 | * | federico3_ is now known as federico3 |
15:18:33 | PMunch | No problem :) It's a great feature |
15:19:39 | Yardanico | damn, just from the start of this book "was enough to convince me language hackers were a different breed of human. Some sort of wizards granted privileged access to arcane arts." I feel the same really :P |
15:20:02 | moerm | As for reading backlogs etc. I know that, but as for myself I feel it to be impolite to seem to be present but not really be. That is no criticism of anyone, just my personal and possibly too oldschool view |
15:20:17 | Yardanico | moerm: IRC has Away status |
15:20:43 | moerm | Yardanico, Ho can I activate that? |
15:20:53 | moerm | or toggle |
15:21:20 | Yardanico | moerm: it's not a toggle, it's a status in IRC |
15:21:25 | Yardanico | you can check it by whois |
15:21:29 | Yardanico | like /whois nickname |
15:21:52 | Yardanico | or maybe i'm wrong |
15:22:13 | moerm | Yardanico, Yes, but how can I set it for myself? |
15:22:19 | PMunch | Alt+A to toggle it in HexChat |
15:22:19 | FromDiscord | <Rika> so the wiki article on lexing and parsing is what actually helped me the most lmao |
15:22:21 | Yardanico | moerm: /away i'm gone |
15:22:25 | FromDiscord | <Rika> pretty funny stuff |
15:22:43 | Yardanico | or there are some automatic tools like I just enabled in my Quassel client that I'll have away status once all quassel clients close |
15:22:53 | Yardanico | i'm back |
15:23:03 | PMunch | I think you then get a message as well when being pinged? Try now |
15:23:06 | moerm | Yardanico, Uh, OK, thx. |
15:23:22 | moerm | PMunch, Thx again |
15:23:30 | PMunch | No problem |
15:23:40 | PMunch | As soon as you type something you will be marked as active |
15:23:48 | Yardanico | or sometimes you have to type /away again without any reason |
15:23:54 | Yardanico | (I mean without any arguments) |
15:24:01 | Yardanico | https://bisqwit.iki.fi/jutut/away.html |
15:24:14 | PMunch | You can set your away message in Chatting -> General |
15:24:36 | inv2004 | Anyone tried to to clone benchmarkgame ? |
15:24:55 | Yardanico | there's https://github.com/kostya/benchmarks but I don't know about benchmarkgame in Nim really |
15:25:12 | * | couven92 quit (Read error: Connection reset by peer) |
15:25:37 | * | couven92 joined #nim |
15:25:40 | inv2004 | Yardanico, Yes, I saw it, but I saw it is just few benches there |
15:25:55 | Yardanico | well benchmarkgame author himself refused addition of quite a few languages |
15:27:44 | FromDiscord | <Rika> damn, nim's still slaying |
15:28:31 | Yardanico | yeah, and json is slow because languages implement JSON parsers differently |
15:28:44 | Yardanico | I mean in this benchmark, not in real life |
15:28:48 | Yardanico | (for nim) |
15:29:01 | FromDiscord | <Rika> json is slow tho |
15:30:08 | Yardanico | "I know a lot of language hackers whose careers are based on this. You slide a language spec under their door, wait a few months, and code and benchmark results come out." lol |
15:30:12 | * | couven92 quit (Read error: Connection reset by peer) |
15:30:39 | * | couven92 joined #nim |
15:32:09 | FromDiscord | <Recruit_main707> has this been tested with Arc? |
15:32:30 | FromDiscord | <Rika> they dont try it |
15:32:48 | Yardanico | @Recruit_main707 arc performance is not that great for these benchmarks currently |
15:33:00 | Yardanico | like I tested bf benchmarks there and with arc they were like 2x slower |
15:33:22 | FromDiscord | <Recruit_main707> :/ |
15:33:24 | Yardanico | it all depends on the concrete example of course, |
15:33:42 | Yardanico | arc can beat default nim GC but as you know this default GC has been around for a lot of years |
15:33:46 | Yardanico | and ARC is not even a year old |
15:34:08 | FromDiscord | <Recruit_main707> yeah, i was thinking about that rn |
15:34:32 | FromDiscord | <Recruit_main707> i have a lot of hope in arc still |
15:34:46 | FromDiscord | <Recruit_main707> i think its definetely the way to go |
15:35:15 | Yardanico | the main advantage is that it's _deterministic_ |
15:35:27 | Yardanico | it inserts all calls to freeing objects at compile-time |
15:35:34 | Yardanico | so it should always behave the same |
15:36:36 | Yardanico | @zetashift do you think I can follow it with Nim? :) |
15:36:41 | Yardanico | I mean the first part at least |
15:40:36 | Araq | *why* is our JSON slow though? the parser hardly allocates and is a state machine... |
15:40:52 | FromDiscord | <Recruit_main707> slower than python smh |
15:41:20 | Araq | let me blame the stupid benchmark :P |
15:41:26 | Yardanico | https://github.com/kostya/benchmarks/blob/master/json/test.nim#L24 |
15:41:29 | Yardanico | this line seems stupid |
15:42:09 | FromDiscord | <Recruit_main707> `defer: socket.close()` whats this for at the beggining? |
15:42:23 | Yardanico | these benchmarks use sockets to notify the "master" program of completion |
15:42:32 | moerm | Possibly Python uses a C module (we might want to look into that) |
15:42:44 | FromDiscord | <Recruit_main707> python does use a c module |
15:42:51 | Araq | Yardanico, is that the benchmark I used for packedjson? |
15:42:57 | Yardanico | idk, probably |
15:43:09 | Yardanico | ah yes it is |
15:43:44 | Araq | if so, that benchmark is flawed... but my packedjson was faster than everything else anyway |
15:43:58 | FromDiscord | <Avatarfighter> lmao the json section of that benchmark |
15:44:25 | moerm | Araq Wouldn't be the first time some result turned out to be due to the test rather than to the testee ... |
15:44:29 | Yardanico | well it's really not a good example of a json usage |
15:44:43 | Yardanico | it parses one huge json file |
15:45:01 | Yardanico | almost everywhere else nim is on the top or near the top |
15:45:09 | FromDiscord | <Avatarfighter> its a terrible example of json usage imo |
15:45:49 | Yardanico | I really wonder how they did implementations if Vala (!!) is faster than C in bf benchmarks |
15:45:54 | Araq | the benchmark mostly tests floating point parsing which is hard to optimize |
15:45:54 | * | xet7 quit (Ping timeout: 240 seconds) |
15:46:04 | inv2004 | I like the nim-chat, just asked one question, and you descussed all the results and ~ fixed halh of them :) |
15:46:09 | Yardanico | I mean Vala compiles to C anyway but how it can be faster than C :D |
15:46:23 | Araq | Yardanico, same as Nim can be faster |
15:46:26 | FromDiscord | <Avatarfighter> inv2004: we gotta be number one 😛 |
15:46:36 | FromDiscord | <Recruit_main707> no pain no gain |
15:46:40 | Yardanico | Araq: well yeah, but the point of these benchmarks to use the same implementation |
15:46:41 | FromDiscord | <Avatarfighter> ^ |
15:46:44 | Yardanico | and that doesn't seem to be the case |
15:46:50 | FromGitter | <zetashift> @Yardanico yes absolutely! |
15:47:01 | supakeen | I suggest to hash the inputs and compare to a known set of benchmark results then just short circuit the parsing. |
15:47:04 | supakeen | Everyone in favour? |
15:47:04 | FromDiscord | <Recruit_main707> where is the used json file? |
15:47:27 | Yardanico | It's generated by https://github.com/kostya/benchmarks/blob/master/json/generate_json.rb |
15:47:54 | Araq | produced C code can be better than hand-written C code. hand-written C code is usually written by cargo cultists who cannot look at the produced assembler and instead bath in their manhood |
15:47:57 | FromDiscord | <Recruit_main707> thats huge lol |
15:48:08 | FromGitter | <zetashift> I wanted to do it in Nim but I wanted to get better at Scala that's why I didn't go for it, but it's really easy to follow and when in doubt you can always peek at https://github.com/cabhishek/nimlox |
15:48:13 | moerm | Yardanico, HOW "huge" ist that test file? |
15:48:18 | Yardanico | yeah but I'll try not to :P @zetashift |
15:48:26 | FromGitter | <zetashift> yeah major spoilers :D |
15:48:44 | Yardanico | moerm: I just ran it manually and it made a 107mb json file |
15:48:48 | Yardanico | ... |
15:49:11 | moerm | Araq, Careful there. While you are right generally I found that I still get faster code for critical stuff by hand |
15:49:18 | supakeen | I guess a large file is also a valid thing to optimize for. |
15:49:21 | supakeen | It's a common usecase. |
15:49:25 | Yardanico | not really |
15:49:30 | Yardanico | small JSON is a much more common usecase IMO |
15:49:31 | FromDiscord | <Recruit_main707> i have an app that uses python nim and json, sending about 9000 characters on average and i cant get it to more than 20 fps :p |
15:49:54 | supakeen | Yardanico: But large files are definitely not uncommon and where you might get larger gains :) |
15:50:11 | moerm | Yardanico, About 100 MB? That's not frightingly large. I suspect the error could be with the test rather than with Nim |
15:50:21 | Yardanico | moerm: there's no error |
15:50:32 | Yardanico | it's just that nim stdlib json module is not tuned for that kind of usage really |
15:50:37 | moerm | Sorry, I meant the poor result |
15:50:39 | FromDiscord | <Recruit_main707> moerm: thats probably because compilers are made to be used by the people Araq described, and optimised thinking in them (i guess) |
15:50:40 | Yardanico | packedjson will use much less memory in that case |
15:50:56 | FromDiscord | <Avatarfighter> Do you guys know if there is anywhere you can get stickers of the Nim logo? Just curious |
15:51:24 | Yardanico | well there's this on stickermule |
15:51:25 | Yardanico | https://www.stickermule.com/artworks/1123185?token=bb1e25bf6e79678069238604d8101454 |
15:52:12 | FromDiscord | <Avatarfighter> that's cooler than the one I had just found imo https://www.redbubble.com/i/sticker/Nim-Programming-Language-by-korsfarer/34701567.EJUG5 |
15:52:23 | Yardanico | that is meh |
15:52:39 | Yardanico | and why list languages it's influenced by |
15:52:44 | Yardanico | better show a smol code example |
15:53:31 | FromDiscord | <Recruit_main707> jajaja, that always looks great, and with nim it will look greater |
15:53:49 | Yardanico | where does https://nim-lang.org/sponsors.html get list from? |
15:53:58 | PMunch | Hmm, is telebot broken? http://ix.io/2i1C |
15:54:07 | PMunch | This is the echo_bot example from examples/ |
15:54:15 | * | endragor joined #nim |
15:54:30 | PMunch | UpdateCallback is defined in private/types.nim as UpdateCallback* = proc(bot: Telebot, update: Update): Future[bool] {.gcsafe.} |
15:54:59 | FromGitter | <zetashift> Yardanico maybe a mix of BountySource OpenCollective and paypal donations? |
15:55:48 | Yardanico | Well I'm asking because i was donating a bit to Nim on OpenCollective but it doesn't show on the website :P maybe it's not updated oftenly |
15:56:38 | Yardanico | ah last update 9 months ago https://github.com/nim-lang/website/blob/master/jekyll/_data/sponsors.csv |
15:57:16 | supakeen | On that page the link to the 'salt campaign' (yellow button) ends up with NXDOMAIN as well. |
15:57:26 | supakeen | Or is that me? |
15:57:34 | Yardanico | salt? |
15:57:48 | Yardanico | ah yeah same for me |
15:58:27 | FromGitter | <alehander92> well json is a pretty popular |
15:58:45 | FromGitter | <alehander92> so people write very well optimized libs about it, not so surprising |
15:59:16 | FromGitter | <zetashift> what happened to that simdjson for nim thing? |
16:00:29 | * | endragor quit (Remote host closed the connection) |
16:08:16 | Yardanico | wait wat |
16:08:22 | Yardanico | craftinginterpreters mentions nim "It doesn’t have negative connotations across a number of cultures. This is hard to guard for, but it’s worth considering. The designer of Nimrod ended up renaming his language to “Nim” because too many people only remember that Bugs Bunny used “Nimrod” as an insult." |
16:08:27 | * | couven92 quit (Quit: Client Disconnecting) |
16:10:50 | zacharycarter | if I need to define a preprocessor for the C compiler - should I use `emit`? Or is there some other way of doing this? |
16:11:16 | zacharycarter | I know I can use `--passC` but I don't want to have to type that in every time |
16:11:27 | zacharycarter | I guess I could also use the `passC` pragma? |
16:11:28 | Yardanico | you can put it in the config instead :P |
16:11:58 | zacharycarter | but wouldn't that just be a Nim define? not a preprocessor define? |
16:12:06 | Yardanico | I mean --passC |
16:12:08 | zacharycarter | oh |
16:12:17 | zacharycarter | yeah that's probably the cleanest way, thanks |
16:17:48 | FromGitter | <zetashift> naming is hard tho yardanico |
16:17:54 | Yardanico | yeah I know that myself |
16:18:14 | inv2004 | Could please someone remind how to clean nimble cache? |
16:18:14 | Yardanico | just name your language Yet Another Useless Language :P |
16:18:25 | Yardanico | inv2004: it's in ~/.nimble |
16:18:30 | inv2004 | I remember that on windows it does not recompile all the times |
16:18:34 | Yardanico | ~/.nimble/pkgs specifically |
16:18:39 | Yardanico | but Nim and Nimble cache are different things |
16:18:51 | supakeen | I once wrote a tiny post on naming things but the gist of it is: think of 5 things that you want to think about related to your project, then think of 5 things for each of those 5 things, then pick from this second or third row of things and combine words. |
16:18:53 | inv2004 | pretty sure there was special nimble command |
16:19:02 | supakeen | Not that I use it myself but people sometimes find it useful. |
16:19:03 | inv2004 | probably I am about nim - not sure |
16:20:04 | inv2004 | -f should help |
16:20:10 | FromGitter | <zetashift> I'd use the wutang name generator cause why not |
16:20:25 | supakeen | I usually just pick words in another language. |
16:20:30 | supakeen | That are related to the project. |
16:20:59 | supakeen | All my python projects are german words, for c it's dutch, and of course, always have 1 exception for each ;) |
16:21:03 | FromGitter | <zetashift> I don't think nimble has a command to clean cache btw |
16:21:26 | FromGitter | <zetashift> I like the 5 things approach |
16:22:12 | supakeen | @zetashift: Here it is with a few more words written: https://supakeen.com/weblog/how-to-name-a-project.html |
16:24:21 | FromGitter | <faulander> https://play.nim-lang.org/#ix=2i1S |
16:24:40 | FromGitter | <faulander> a more sophisticated question this time. questions are in the playground |
16:26:54 | Yardanico | "I declare the decode_fuc after the procs, the procs do not know of the decode_func" use forward declaration |
16:27:13 | Yardanico | oh, not if it's a variable |
16:27:41 | FromDiscord | <kodkuce> i think i finished my simple http.server ptyhon alternative + upload |
16:27:47 | FromGitter | <faulander> note to myself (what is forward declaration, read it up!) |
16:28:48 | leorize | Zevv: it already does? |
16:29:12 | leorize | did you map <Plug>NimStar and <Plug>NimGStar? |
16:29:41 | companion_cube | kodkuce: care to share the code? :) |
16:30:45 | * | letto quit (Quit: Konversation terminated!) |
16:31:25 | FromGitter | <faulander> @Yardanico : ok, so i forward declare both procs, is there any problem with that? |
16:32:07 | FromGitter | <faulander> and how would i call a proc where i get the name from a table-keys, value? |
16:33:14 | FromGitter | <zetashift> you mean how to get a value out of a table? |
16:33:33 | FromGitter | <zetashift> or get the key and value out of a table? |
16:35:19 | FromGitter | <faulander> no. i want to call a proc, lets call it "decode_string" and in the table i have ⏎ key: "s", value: "decode_string" |
16:35:28 | FromGitter | <zetashift> `decode_func['l'] = decode_list` also is this even possible? You declare decode_func as `[int, int]` |
16:36:11 | FromGitter | <faulander> yes, thats wrong, there are alot of mistakes still |
16:36:14 | Yardanico | https://github.blog/2020-04-14-github-is-now-free-for-teams/ |
16:36:14 | * | Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
16:36:16 | FromGitter | <faulander> i need to get the basics right |
16:36:41 | FromGitter | <zetashift> will the proc put the value in the table or something else? |
16:36:46 | * | Yardanico joined #nim |
16:37:26 | Yardanico | github scared of gitlab now :D |
16:37:28 | Yardanico | "We’re happy to announce we’re making private repositories with unlimited collaborators available to all GitHub accounts. All of the core GitHub features are now free for everyone. 🎉" |
16:37:34 | FromGitter | <faulander> its a bencoded string(https://de.wikipedia.org/wiki/Bencode) |
16:37:38 | companion_cube | ahaha nice |
16:37:45 | * | letto joined #nim |
16:37:49 | FromGitter | <zetashift> aber ich bin nicht deutsch |
16:37:59 | FromGitter | <zetashift> dull joke but I'll check what bencode is |
16:38:02 | FromGitter | <faulander> me neither ;) |
16:38:22 | FromGitter | <faulander> its a long string, like a json in one line |
16:39:13 | FromGitter | <faulander> a integer looks like: i29410e |
16:39:19 | FromGitter | <faulander> and the int proc is: |
16:39:49 | * | hax-scramper quit (Ping timeout: 264 seconds) |
16:39:59 | FromGitter | <faulander> https://play.nim-lang.org/#ix=2i22 |
16:40:13 | FromGitter | <zetashift> I think I saw bencode in Nim Days |
16:40:18 | FromGitter | <zetashift> are you trying to make a parser for it? |
16:40:27 | * | hax-scramper joined #nim |
16:40:46 | Araq | hmm we could use a streaming approach for JSON |
16:41:16 | FromGitter | <faulander> i look it up in nim days |
16:41:35 | FromGitter | <zetashift> Sorry faulander I'm not sure what you're trying to do, maybe return a tuple one containg the proc and one containg the string representation? |
16:41:43 | Araq | then we use less memory and can optimize parseFloat in order to look good on this benchmark. if streaming is allowed, I don't remember |
16:41:44 | FromGitter | <zetashift> also: https://github.com/xmonader/nim-bencode |
16:42:34 | FromGitter | <faulander> no this is a more general question let me ask it again |
16:42:56 | FromGitter | <faulander> can i call a proc which name i get from a variable? |
16:44:17 | FromGitter | <zetashift> so you'd have something like `let foo = "bar"` and you want to 'convert' that to 'bar()' which is a proc |
16:44:55 | FromDiscord | <Rika> Huh. |
16:45:05 | FromDiscord | <Rika> Bencode doesn't have float support |
16:45:50 | FromDiscord | <Rika> faulander: no, unless you mean converting the string on compile time, in which case you can, but it would be hacky |
16:46:36 | * | jjido joined #nim |
16:51:17 | * | jjido quit (Client Quit) |
16:51:44 | Yardanico | another question - s == "" or s.len == 0 |
16:51:51 | Yardanico | which one is better to use for empty strings? :) |
16:51:54 | leorize | s.len == 0 |
16:52:13 | leorize | because in the end, s == "" still have to compare the len first :) |
16:52:26 | FromDiscord | <Varriount> faulander: What are you trying to achieve? |
16:52:31 | FromDiscord | <Recruit_main707> s.len == 0 becuase it looks better |
16:54:45 | Prestige | I think he meant invoking a proc by its name at runtime? |
16:55:23 | leorize | @faulander: you can't, runtime reflection is not a thing in Nim |
16:55:40 | Araq | leorize, we optimize s == "" to s.len == 0 |
16:55:43 | leorize | however you can store a "string" -> proc pointer table |
16:58:08 | FromDiscord | <kodkuce> hmm if i take someones code (my example dom96/jester parser) and on his github he licenced it with MIT do i have to licence it too on my github as MIT or can i put CC0 licence ? |
16:58:28 | Yardanico | you need to have a copy of MIT license for the code you used |
16:58:32 | Yardanico | but you can license your project in CC0 |
16:59:01 | FromDiscord | <kodkuce> ye in my file i have part of his code and i copyed his licence text there |
16:59:06 | Yardanico | yeah that's ok then |
16:59:14 | dadada | hope Nim will have an empty method for all collection types, cause questions about s == "" or s.len == 0 should really be answerd with s.empty IMO |
16:59:52 | dadada | it's not only shorter, it also looks nicer, but I guess stuff like that is a matter of taste |
16:59:56 | * | inv2004 quit (Ping timeout: 256 seconds) |
17:00:14 | leorize | back in the old days, `isNilOrEmpty` was how it's done |
17:00:21 | leorize | so maybe we can now have `isEmpty` :P |
17:00:34 | dadada | I think we could drop the is |
17:00:46 | leorize | it's better to have it |
17:00:51 | dadada | why? |
17:00:58 | leorize | since isEmpty(string) is a thing too |
17:01:00 | dadada | we don't use getLen either |
17:01:11 | leorize | empty(string) looks like you're trying to empty a string :P |
17:01:19 | dadada | no, that would be clear |
17:01:27 | dadada | but, I do see your point |
17:01:45 | Zevv | leorize: oooh no i didnt! |
17:01:53 | Prestige | Empty is also a verb so yeah that looks confusing |
17:02:16 | dadada | if s.empty: <- can in my mind only man that you want to know a state (is it empty?) |
17:02:19 | Prestige | Imagine empty(seq) |
17:02:21 | dadada | s/man/mean |
17:02:50 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
17:03:15 | dadada | Prestige: I can't remember that word empty being used in that way anywhere, most of the time it's something like clear, or even deleteAll |
17:03:28 | leorize | Zevv: lol I literally implemented that feature because you asked |
17:03:42 | leorize | dadada: it's still a verb |
17:04:25 | leorize | "can you empty the bottle?" is still a sentence people use |
17:04:35 | dadada | leorize: it can be a verb, but it can also be an adjective, empty on its own is an adjective, to empty is a verb |
17:05:02 | leorize | I'd say verbs don't really cut out for property name |
17:05:52 | dadada | leorize: https://www.dict.cc/?s=empty |
17:06:21 | dadada | if I'm reading this table right, empty is used more than 10 times more commonly as adjective, compared to it being used as verb |
17:07:06 | leorize | I don't even know what the table mean :) |
17:07:36 | leorize | isn't this just an english -> deutsch table? |
17:07:51 | dadada | leorize: I'm using this site regularly, so I have a feel for it, and I'm pretty sure the english words on the left are ordered by their occurances in regular English usage |
17:07:52 | * | icebattl1 quit (Quit: leaving) |
17:07:57 | leorize | and highlighting how empty in english can be translated to various forms in deutsch? |
17:08:08 | dadada | leorize: it's a very advanced translation site |
17:08:13 | * | icebattle joined #nim |
17:08:15 | dadada | dictionary site |
17:09:29 | dadada | leorize: yes, but it's most common translation by far is (see number 6120) is the adjective form, and the other adjective forms also are all in all more common than the verb form |
17:10:06 | Prestige | Either way I think it's best to prevent any ambiguity |
17:10:27 | Prestige | If we were to use empty at all I think we'd want to use it as isEmpty |
17:13:06 | dadada | it's extremely common for English words to have both verb and adjective form, we would always have to use isAdjective... |
17:13:37 | leorize | in practice it appears that we don't have to :) because they are not that common |
17:14:09 | dadada | leorize: did you check them all with a dictionary? name a random adjective that you believe not to have a verb analog? |
17:14:21 | FromGitter | <zetashift> I like how Elixir does it for functions that return true or false, they add '?' to the function name e.g. `Enum.empty?(collection)` |
17:14:57 | dadada | zetashift: I believe Crystal does also use ? for something like hta |
17:14:58 | dadada | tthat |
17:15:09 | FromDiscord | <kodkuce> why github has no Zero-Clause BSD in options for licence 😦 |
17:15:10 | FromGitter | <zetashift> maybe it's a Ruby thing then |
17:15:21 | leorize | dadada: my bad, noun is what we use 99% of the time :P |
17:15:47 | leorize | and for adjectives we do use `isAdjective` |
17:16:09 | dadada | okay, I appreate if it's consistent |
17:16:10 | leorize | @kodkuce: it's just a shortcut to have a license in your repo |
17:16:13 | dadada | appreciate |
17:16:30 | dadada | leorize: would you accept something like if s.empty?: |
17:16:43 | leorize | sure, but we don't have that kind of syntax |
17:17:11 | dadada | maybe I can wrote a macro that enables this... |
17:17:14 | dadada | write |
17:17:53 | leorize | sorry, but macros don't magically make invalid syntax work :) |
17:17:54 | FromGitter | <zetashift> NEP-1 doesn't mention proc naming huh |
17:18:03 | dadada | simply rewite .whatever? to .isWhatever , but honestly even I think it might not be worth saving one character |
17:18:32 | leorize | @zetashift: yea it's in apis.html instead |
17:18:52 | leorize | https://nim-lang.org/docs/apis.html |
17:19:59 | FromGitter | <zetashift> yea I had it :p |
17:20:06 | * | chemist69 quit (Quit: WeeChat 2.7) |
17:20:09 | leorize | @kodkuce: if you want to use a license that's not in the license selector, then just go and download the license.txt you want and add to your repo |
17:20:16 | FromGitter | <zetashift> I would be surprised if apis.html wasn't under docs |
17:20:22 | * | chemist69 joined #nim |
17:20:32 | leorize | nep-1 is still the only nim enhancement proposal |
17:20:39 | FromGitter | <zetashift> handy reference I didn't know about, saved iit |
17:20:50 | leorize | because we don't have any process for writing more :P |
17:21:08 | FromGitter | <zetashift> but didn't know `?` was an illegal char for a name |
17:21:27 | FromGitter | <zetashift> weird error tho: `Error: invalid visibility: '?'` |
17:22:12 | leorize | the identifier set consists of `[a-zA-Z][a-zA-Z0-9_]` |
17:22:23 | leorize | for ascii |
17:22:35 | leorize | if utf-8 then it can be anything |
17:23:02 | FromGitter | <zetashift> I'll keep it ascii |
17:31:16 | * | audiofile joined #nim |
17:35:04 | * | ftsf quit (Ping timeout: 256 seconds) |
17:35:30 | * | jjido joined #nim |
17:42:57 | Yardanico | wow, probably the single longest error message (I mean single line) I've ever seen in Nim |
17:42:58 | Yardanico | "Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature." |
17:43:10 | audiofile | wheres the recipe |
17:43:29 | Araq | Yardanico, it wasn't written by me, maybe that's why :P |
17:43:33 | Yardanico | haha |
17:43:59 | FromDiscord | <Recruit_main707> does somebody know why nimporter generates something that doesnt exist? |
17:44:16 | FromDiscord | <Recruit_main707> (it tries, it obv errors) |
17:44:25 | Yardanico | wdym "doesn't exist"? |
17:44:26 | Araq | why would generate somethingt that already exists though? |
17:44:32 | Araq | *would you |
17:44:42 | FromDiscord | <Recruit_main707> i mean, not existing in the header |
17:44:58 | Yardanico | what exactly does it make? |
17:44:59 | FromDiscord | <kodkuce> https://github.com/kodkuce/nimple.http.server hmm, i hit a doom, is asynchttpserver limited to 8mb post request |
17:45:06 | Yardanico | why not jester |
17:45:22 | FromDiscord | <Recruit_main707> well, the problem is not that it creates it, its that it doesnt, but it uses it |
17:45:31 | Yardanico | well nimterop isn't perfect |
17:45:41 | companion_cube | oh, multipart? |
17:45:44 | Yardanico | it might fail to generate something so you'll need to use c2nim or translate it from headers manually |
17:45:51 | companion_cube | kodkuce: have you looked at the chunked encoding? |
17:46:09 | FromDiscord | <kodkuce> nah newer heard of it, i can google it |
17:46:43 | Yardanico | audiofile: if you're still wondering |
17:46:46 | Yardanico | !eval var prc = (proc (a: auto): int = 5) |
17:46:48 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature. |
17:46:52 | companion_cube | it's how you can upload a 10G file onto a machine with 200MB of ram :) |
17:47:02 | companion_cube | streaming content, in http |
17:47:37 | audiofile | thanks! |
17:49:17 | * | inv2004 joined #nim |
17:51:25 | FromDiscord | <Recruit_main707> its very weird, `NSbuilder_t` doesnt appear in my whole project, neither in nimterop's source |
17:51:52 | FromGitter | <sealmove> this incopatibility issue with ints and uints is getting on my nerves! |
17:52:08 | FromGitter | <sealmove> I even define the `<` op and still doesn't work |
17:52:35 | FromDiscord | <kodkuce> hmm i have 16gb or ram but still it wont let moe more then 8mb, i think asynchttp is limiting it of 5 freezes it responed 1 time with file limit error |
17:52:52 | FromGitter | <sealmove> also lenientops is just for `float <-> int` not for conversions betweens different kind of integer types |
17:53:19 | FromGitter | <faulander> @leorize |
17:53:28 | FromGitter | <faulander> @leorize: thanks for the clarification |
17:58:52 | FromDiscord | <kodkuce> and have one more question, writeFile from IO its not async right, i am atm calling it from async proc that will block whole async thingy right? |
17:59:15 | Yardanico | yes |
17:59:31 | Yardanico | one way to solve that is to use THREADS (yes :DDDD) |
17:59:31 | FromDiscord | <kodkuce> any suggestion how to fix this? |
17:59:37 | leorize | Yardanico: or use asyncfile |
17:59:42 | Yardanico | oh right forgot about that sorry |
18:00:34 | FromDiscord | <kodkuce> ok so TODO is adding asynchfile and figure out this upload thingy 🙂 |
18:00:49 | * | Vladar quit (Quit: Leaving) |
18:01:59 | * | narimiran_ joined #nim |
18:02:19 | * | narimiran quit (Ping timeout: 260 seconds) |
18:10:44 | moerm | The goal of an error message is not to be a short as possible but to provide a *useful and helpful* message. Or at least that should be the goal |
18:11:42 | Yardanico | well yeah I understand why that happens |
18:11:49 | Yardanico | the error message is pretty clear |
18:14:32 | moerm | related to *readibility*. Do not underestimate it. well readible code is code that is easily maintainable and likely contains less bugs in the first place. |
18:14:52 | moerm | One of the many things I like about Nim |
18:15:48 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:17:16 | * | abm quit (Quit: Leaving) |
18:22:36 | Yardanico | lol |
18:22:37 | Yardanico | https://play.nim-lang.org/#ix=2i2Q |
18:23:42 | * | inv2004 quit (Ping timeout: 265 seconds) |
18:26:49 | FromGitter | <sealmove> when did we re-enabled += op? |
18:26:58 | Yardanico | ? |
18:27:08 | FromGitter | <sealmove> x += 1 always worked? |
18:27:11 | leorize[m] | @sealmove: it's always been there? |
18:27:12 | Yardanico | yes? |
18:27:36 | Araq | Yardanico, I have an RFC in the works for taming 'converter' |
18:27:45 | Yardanico | oh no :P |
18:27:53 | FromGitter | <sealmove> hmm, for some reason I thought it wasn't, maybe because we don't have `++` (well we have the better `inc` of course) |
18:28:31 | Yardanico | some stuff in nimpylib wouldn't be possible without converters (yes I implicitly convert values to bool like Python does to mimic some behaviour) but it's just a fun and kinda stupid project :P |
18:28:31 | leorize[m] | Araq: so finally it's gonna be clearer when a converter will apply? |
18:28:40 | Yardanico | if that means less bugs in the compiler I'm all for it |
18:30:24 | FromGitter | <sealmove> so I am working on Nim 1.0.0, this works on devel https://play.nim-lang.org/#ix=2i2U but doesn't on 1.0.0. I wondered what changed, and if there is a workaround for 1.0.0 which doesn't require convertion or adding suffixes to literal (maybe define some proc, but I couldn't make it work) |
18:30:57 | leorize | one thing for sure it does work on nim 1.2.0 |
18:31:48 | leorize | I think you should move to 1.2.0 and use --useVersion:1.0 :P |
18:31:51 | FromGitter | <sealmove> yeah, I can use 1.0.6 max because of study travis using ancient gcc Search Results ⏎ Web results ⏎ ⏎ 🤦 [https://gitter.im/nim-lang/Nim?at=5e960197e7ca460b065eaae1] |
18:32:22 | FromGitter | <sealmove> (oops copy pasted more stuff than just emoji 🤦) |
18:32:41 | FromGitter | <sealmove> (also study = stupid*) |
18:32:44 | Araq | leorize, version 1 has --useVersion:1.0 |
18:32:55 | FromGitter | <sealmove> (no I am not drunk, despite the looks) |
18:33:30 | Araq | leorize, yeah |
18:34:50 | Araq | the RFC is mostly "instead of converter let's have a convert[T, toT] type like varargs" plus some special mechanism for 'distinct' types |
18:35:30 | FromGitter | <sealmove> hmm what exactly does --useVersion:1.0? |
18:35:57 | * | onionhammer quit (Quit: WeeChat 2.6) |
18:36:44 | Yardanico | wait I can simplify that macro to a simple template |
18:36:46 | Yardanico | template `:=`*(name, value: untyped): untyped = (var name = value; name) |
18:36:55 | Yardanico | this behaves roughly like a simple version of walrus operator in Python |
18:37:04 | Yardanico | if (a := 5) > 3: echo a |
18:37:25 | Yardanico | basically saves a few characters and shows that nim is cool :P |
18:37:53 | companion_cube | don't you need a `block` in there? |
18:38:00 | Yardanico | no lol, it just works (TM) |
18:38:02 | companion_cube | or do the () act like one |
18:38:05 | companion_cube | ah cool. |
18:38:39 | Yardanico | it's the same as writing |
18:38:48 | Yardanico | if (var a = 5; a) > 3: echo a |
18:38:50 | leorize | @sealmove: here's your 1.2.0 fix: https://play.nim-lang.org/#ix=2i2Z |
18:38:55 | leorize | save it in your config.nims |
18:38:59 | moerm | Let us leave looking cryptic (and a short-cut operator zoo to the curly braces languages ... |
18:40:14 | companion_cube | Yardanico: just tried it, it's pretty cool indeed |
18:40:44 | * | onionhammer joined #nim |
18:43:27 | Araq | Yardanico, well as you noticed, there is 'if (var a = 5; a) > 4' |
18:44:55 | Yardanico | companion_cube: if you sell your soul to Nim compiler you can do stuff like https://play.nim-lang.org/#ix=2i33 |
18:45:34 | Yardanico | Araq: well, I know, := is just to mimic Python, I don't really use this if expression in code anyway |
18:45:57 | moerm | Don't we have better and more important things to work on than creating "cool" sugaring? |
18:46:21 | Yardanico | moerm: yeah, but I don't really do any nimpylib stuff anymore, just pushed a few fixes today because I was bored |
18:46:23 | moerm | Yardanico, And that's good, because that's poor coding |
18:46:36 | companion_cube | ahahah jeez |
18:46:45 | Yardanico | companion_cube: it's not a theoretical example btw |
18:47:00 | companion_cube | showing off your macro-fiu |
18:47:02 | companion_cube | fu |
18:47:27 | FromDiscord | <Yardanico> tonim is a simple macro, the real magic is in projects like nimterop |
18:47:32 | moerm | "Mom, I saved a line!" (but oh well, my program is actually of worse quality now ...) |
18:47:34 | FromDiscord | <Yardanico> Or async or jester |
18:48:00 | companion_cube | did you suddenly move to discord?! |
18:48:20 | Araq | moerm, be gentle, people are allowed to have fun and play syntax games |
18:48:24 | FromDiscord | <Yardanico> I just got out of my room and I carry my phone with me |
18:48:26 | moerm | No, he is using NSA tech * whisper |
18:48:48 | Araq | it's not like 'pylib' is for a production setting |
18:49:31 | Araq | I mean, maybe some fool uses it in production but then it's still better than not using Nim :D |
18:49:39 | moerm | Not to lack modesty but why would I care about Python when there is Nim? (Python has become fat) |
18:50:19 | FromDiscord | <Yardanico> Hmmm, seems like Juan removed a bold warning I had on the top of README to not use pynim in real code |
18:50:32 | moerm | *g |
18:50:34 | Araq | because Python still has more libraries |
18:50:54 | moerm | Araq hmmm ... |
18:51:31 | FromDiscord | <Yardanico> We can already use them with nimpy anyway :D |
18:51:43 | moerm | Saturn is way bigger than earth. I'll stay here anyway |
18:52:41 | moerm | I'm probably a victim of my field. Pardon me |
18:53:55 | Araq | you wouldn't believe how many, many people approach "programming". Search on stack overflow for a snippet, copy it into your "Program", done. |
18:55:56 | moerm | Araq And the result is: OS is buggy, libraries are buggy, and even critical stuff like openssl is buggy |
18:56:08 | moerm | Welcome to the "programming is fun" world! |
18:56:31 | companion_cube | not sure openssl's state is caused by stack overflow copy pasting, really |
18:56:50 | FromGitter | <sealmove> hmm 1.2.0 brought some very nice improvements, I hadn't noticed |
18:57:06 | Araq | moerm, well one gets for what one paid for |
18:57:33 | * | companion_cube didn't pay anything for the nim compiler |
18:57:34 | FromGitter | <sealmove> collect is here too :) |
18:57:36 | moerm | companion_cube, probably not. But by the "programming is fun" attitude (and when it turns un-funny "1000 eyes" turn into "not even 4 eyes" ... |
18:58:32 | Araq | > Hmmm, seems like Juan removed a bold warning I had on the top of README to not use pynim in real code |
18:58:35 | moerm | Whenever I interview a developer candidate and I hear anything about developing being "fun" he's out of the race |
18:58:52 | companion_cube | that sounds… a bit rigid |
18:58:55 | supakeen | `k |
18:59:27 | FromGitter | <alehander92> guys |
18:59:36 | FromGitter | <alehander92> i am trying to call a magic |
18:59:39 | FromGitter | <alehander92> copyLineInfo |
18:59:46 | moerm | companion_cube, Oh gawd! "rigid" ... well, rigid happens to also describe what I want. Solid ("rigid") code. Thank you |
18:59:52 | FromGitter | <alehander92> from a macro but it seems like .. it just isnt invoked from vmgen! |
19:00:05 | FromGitter | <alehander92> which is strange, as it seems defined correctly |
19:00:15 | FromGitter | <alehander92> i tried to debug it in many ways |
19:00:21 | companion_cube | moerm: what's your fiekd? |
19:00:23 | companion_cube | field* |
19:00:24 | FromGitter | <sealmove> I think Nim 1.2.0 deserves an Araq youtube video |
19:00:46 | moerm | companion_cube, security, vaguely |
19:00:56 | * | inv2004 joined #nim |
19:01:07 | Araq | moerm, my litmus test is more like "imagine a language where array indexing starts at 1" if the reaction is "wtf" I become skeptical. if the reaction is "I don't care" I'm happy. |
19:01:38 | moerm | Araq Let me guess ... not many pass the test ... |
19:02:09 | companion_cube | Araq: what if it's "ugh"? |
19:02:28 | moerm | companion_cube, I don't need "cool" people. I need engineers, preferably ones for whom coding starts with proper modelling (incl. verification) |
19:02:29 | Araq | moerm, indeed |
19:03:08 | moerm | But, but ... "C is THE language and in C arrays start at zero!" |
19:03:21 | FromGitter | <sheerluck> Araq Julia is a language where array indexing starts at 1 |
19:03:27 | Araq | companion_cube, "ugh" is like "wtf", but don't take it too serious, it's not the only question I care about |
19:03:38 | Araq | sheerluck: I know |
19:03:41 | FromGitter | <matrixbot> `donpdonp` for i in 0 .. <arglist.len-2: ... proc `<`(x, y: int): bool missing parameter: y |
19:03:42 | FromGitter | <alehander92> *writes down notes for a nim interview |
19:03:44 | moerm | In other words: that poor guy still has to re-discover what people like Wirth, Dijkstra et al. knew decades ago ... |
19:03:46 | FromGitter | <zetashift> hehe |
19:04:04 | FromGitter | <matrixbot> `donpdonp` i just upgraded to nim 1.2 and any project with random-0.5.6 is failing with that error :( |
19:04:20 | companion_cube | (that 0-indexing is indeed better? :D) |
19:04:23 | FromGitter | <alehander92> is it possible that the compiler just ignores some magic calls or that it somehow skips them |
19:04:34 | FromGitter | <zetashift> @donpdonp can you post your snippet on play.nim-lang.org and maybe include the full codeblock ? |
19:04:35 | FromGitter | <awr1> if i had my way boolean procs would end in `?` a la Ruby |
19:04:40 | companion_cube | I mean, I hear you about well designed, thoughtful code |
19:04:46 | FromGitter | <zetashift> we just talked about that awr1 :P |
19:04:47 | Araq | moerm, no, it's actually not about Wirth's designs, for me it's about keeping a flexible mind |
19:05:05 | Araq | maybe I should instead ask "Imagine the indexing starts at 3" |
19:05:06 | FromGitter | <alehander92> "what if indexes start at sqrt(2) man " |
19:05:21 | moerm | Araq And for me it's about the same PLUS engineering rigorosity |
19:05:23 | FromGitter | <matrixbot> `donpdonp` zetashift (Gitter): its not my snippit its https://github.com/oprypin/nim-random/blob/master/src/random.nim#L83 |
19:05:31 | FromGitter | <zetashift> I do agree, I feel like those posts that complain about Julia for 1 indexing are the same plague that moan about Nim case insensitivity |
19:06:06 | FromGitter | <matrixbot> `donpdonp` zetashift (Gitter): im trying to make a similar case in the playground but havent been able to reproduce it yet |
19:08:13 | Araq | moerm, btw do you know Wirth's later designs make arrays start at 0 and he also nuked 'enums' from Oberon? |
19:08:20 | FromGitter | <awr1> yeah people tend not to look big picture with languages |
19:09:31 | moerm | But I concede when I started I felt the compiler (complaining) to be my enemy too. It took some maturing to understand that "-Werror -pedantic" is a GOOD setting and that a strict compiler is my FRIEND |
19:10:15 | moerm | Araq I highly likely have that somewhere in the depths of m head but I haven't touched Oberon since 2 or 3 years |
19:10:16 | FromGitter | <zetashift> @donpdonp can you try replaceing `..<` with `..` and change it to arglist-3 |
19:10:20 | companion_cube | -Werror is good, except in releases, it'll break your code in the future when compilers become more strict |
19:10:57 | moerm | But who care anyway what an array starts with. After all compilers are good at transposing |
19:11:42 | FromGitter | <iffy> What's the right way to add to a sequence which has itself been added to another sequence: http://ix.io/2i3d <-- doesn't work |
19:12:13 | * | icebattle quit (Ping timeout: 264 seconds) |
19:12:24 | companion_cube | iffy: group[^1].add("hi") ? |
19:12:25 | moerm | btw I think it should be obligatory in CS to force students to look (and plus/minus understand) at the ASM code produced |
19:13:11 | FromGitter | <zetashift> @donpdonp I think you're hitting https://github.com/oprypin/nim-random/pull/25 and w/e library you're using is using an old version of random |
19:13:42 | FromGitter | <iffy> companion_cube: That works! I guess I'm also asking: "What do I not understand correctly that makes me think the code I pasted would work?" |
19:13:42 | moerm | companion_cube, "production code" not surviving '-Werror -pedantic' is not production code. Period. |
19:14:08 | FromGitter | <awr1> @iffy sequences are deep copied |
19:14:14 | FromGitter | <zetashift> moerm how *pedantic* of you........................... ba dum tsh |
19:14:14 | * | Guest85 quit (Ping timeout: 256 seconds) |
19:14:29 | FromGitter | <zetashift> I'll let myself out now |
19:14:36 | moerm | zetashift Thanks for the compliment :) |
19:15:24 | FromGitter | <matrixbot> `donpdonp` zetashift (Gitter): nod. though 0.5.6 is the latest published |
19:15:34 | moerm | So I am actually a compiler? * attempt at being funny |
19:16:16 | companion_cube | moerm: but -Werror on what compiler? :) |
19:16:26 | companion_cube | can you be sure you have 0 warning in 2025 gcc? |
19:16:46 | FromGitter | <zetashift> one hella complex compiler then |
19:18:20 | FromGitter | <zetashift> @donpdonp that would be correct: https://github.com/oprypin/nim-random/commits/master I think you need to do something like `nimble install random@#head` |
19:18:28 | moerm | companion_cube, Quite. But even if I had an error then I wouldn't disable -Werror but correct my code |
19:18:40 | FromGitter | <zetashift> or nim-random w/e it's name is |
19:19:08 | FromGitter | <matrixbot> `donpdonp` zetashift (Gitter): that will work for my immediate dependency, but i depend on 'ulid' for example which depends on random 0.5.6 o^O |
19:19:57 | * | hpyc9 quit (Killed (Sigyn (Stay safe off irc))) |
19:20:12 | companion_cube | moerm: which is why I said "except in a release" |
19:20:16 | FromGitter | <matrixbot> `donpdonp` zetashift (Gitter): for this case im happy with going into ~/.nimble/pkg and hand-editing (horrors). thx for the help. |
19:20:51 | FromGitter | <zetashift> you could also open an issue on nim-random to cut a new release or change ulid's nimble file |
19:21:04 | FromGitter | <zetashift> I don't know enough about nimble to know what the correct procedure is :P |
19:21:07 | * | icebattle joined #nim |
19:22:56 | * | hpyc9 joined #nim |
19:23:10 | FromGitter | <matrixbot> `donpdonp` zetashift (Gitter): bug filed with nim-random. |
19:23:34 | Araq | > I don't know enough about nimble to know what the correct procedure is |
19:23:58 | Araq | uh oh, <insert my usual complaints about package managers in general here> |
19:25:48 | * | icebattle quit (Ping timeout: 256 seconds) |
19:26:06 | * | icebattle joined #nim |
19:26:22 | moerm | * laughing |
19:26:56 | FromDiscord | <Asmodeus> "<FromGitter> <matrixbot> donpdonp zetashift (Gitter): ..." |
19:26:56 | FromGitter | <zetashift> Araq I can assure you this time it's not the package manager who is lacking, it's me hehe |
19:26:57 | FromDiscord | <Asmodeus> good heavens |
19:27:26 | FromGitter | <zetashift> you just added discord to that "*<FromDiscord>* <Asmodeus> "<FromGitter> <matrixbot> donpdonp zetashift (Gitter): ..." |
19:27:55 | Northstrider | How many layers of indirection are too many heh |
19:28:10 | Yardanico | Please use IRC->Matrix and then Matrix->Gitter and then Gitter->IRC |
19:28:10 | moerm | moerm can I talk to myself in IRC |
19:28:13 | Yardanico | we've come full circle |
19:28:16 | moerm | Yay! |
19:28:56 | moerm | moerm, I can even auto-complete my name. |
19:29:18 | FromGitter | <awr1> we need a ICQ, MSN messenger, and AIM bridge |
19:29:26 | Yardanico | what about Skype |
19:29:37 | Yardanico | also don't forget facebook |
19:29:58 | Araq | zetashift: for me it's always the PM because PMs are bad |
19:30:20 | moerm | Yes, Skype and facebook PLUS javascript based <whatever if only it's fat and bloated>!!! |
19:31:28 | moerm | It's a shame anyway that todays fat fat fat super-bloated browsers still don't have a built in OS! |
19:31:39 | Yardanico | I have bad news for you |
19:31:48 | FromGitter | <iffy> Araq: what's the alternative? |
19:31:50 | Yardanico | https://copy.sh/v86/ |
19:32:13 | FromGitter | <zetashift> I mean the web has become so big, is it really bloat |
19:32:29 | Yardanico | yeah |
19:32:34 | FromGitter | <zetashift> some sites take it too far sure |
19:32:48 | * | nsf quit (Quit: WeeChat 2.8) |
19:33:29 | moerm | Yardanico, Ts those surely are std. OS versions. *My* FreeBSD is smaller |
19:33:29 | * | opal joined #nim |
19:33:38 | Yardanico | moerm: some of them are |
19:33:42 | Yardanico | ReactOS is really small |
19:33:56 | FromGitter | <zetashift> reactOS is that windows clone no? |
19:34:05 | Yardanico | it is, an open-source one |
19:34:10 | moerm | What I found amazing is that Oberon is relatively large. Larger than FreeBSD for example |
19:34:13 | Yardanico | for userspace it's mostly wine, but they have their own NT kernel |
19:34:23 | Yardanico | it's still active |
19:34:41 | moerm | Yeah ... and in 2054 they'll be at 1.0 |
19:34:48 | Yardanico | well there's no one to blame them |
19:34:53 | Yardanico | it's just that nobody is interested in it :) |
19:34:56 | FromGitter | <iffy> Araq: and if you want to just point me to something to read, that's fine -- I'm genuinely curious, but I haven't had problems with nimble (I have with npm/yarn though) |
19:35:01 | Yardanico | btw maybe I should try to check if Nim works on it |
19:39:19 | dom96 | iffy: with the little development that Nimble's getting, that's a miracle :) |
19:39:38 | FromGitter | <iffy> :) |
19:39:42 | Yardanico | let's just use npm for nim, even the name is almost the same! |
19:39:56 | Araq | iffy: glad to hear it |
19:41:31 | Araq | iffy: dunno good articles about it but the one talk from Rich Hickey about it is good |
19:42:32 | moerm | Yardanico, Why not take dog poop right away? It's almost the same as npm and it's less ugly |
19:44:37 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
19:46:39 | FromGitter | <zetashift> Every big package manager/build tool gets complaints |
19:46:52 | FromGitter | <zetashift> Is it even possible to make the perfect PM? |
19:47:06 | moerm | I like nimble |
19:47:35 | FromGitter | <zetashift> I like it too, it just werks |
19:47:41 | moerm | And I like non-bloat |
19:47:42 | FromGitter | <zetashift> but I admit I don't maintain big projects |
19:48:37 | leorize[m] | anyone want a DSL for spawning processes like this? https://play.nim-lang.org/#ix=2i3S |
19:49:10 | moerm | I'm gone. Have a good time everyone |
19:49:18 | Yardanico | see ya |
19:49:25 | FromGitter | <zetashift> bye |
19:49:33 | leorize[m] | o/ |
19:49:38 | * | moerm quit (Quit: Leaving) |
19:49:51 | FromGitter | <zetashift> @leorize looks nice |
19:50:56 | Araq | iffy: https://www.youtube.com/watch?v=oyLBGkS5ICk |
19:51:01 | * | Lord_Nightmare joined #nim |
19:51:22 | * | FromGitter * iffy 14minutes in :) |
19:52:31 | leorize[m] | @zetashift: thanks |
19:53:14 | leorize[m] | I figured that instead of adding more options to createProcess, I can just invent a DSL instead :) |
19:53:35 | Yardanico | ^any nim user when they discover the power of macros |
19:55:12 | FromGitter | <zetashift> yes I looked at that and I was like why wasn't a function enouugh |
19:55:34 | FromGitter | <zetashift> and then I remembered it's Nim |
19:57:37 | Yardanico | well yeah Nim "spoiled" be a lot :P |
19:57:46 | Yardanico | *me |
19:58:20 | Northstrider | leorize[m]: What's the [m] in your name? |
19:58:35 | Yardanico | matrix |
19:58:46 | Yardanico | he's using freenode matrix->irc bridge |
19:59:23 | Northstrider | Ah gotcha, thanks |
19:59:24 | leorize | yep |
19:59:28 | * | Northstrider is now known as Northstrider[m] |
19:59:31 | Northstrider[m] | o |
19:59:36 | Northstrider[m] | or it could just be a nick thing |
19:59:57 | Yardanico | no :D |
19:59:58 | * | Northstrider[m] is now known as Northstrider |
20:00:07 | leorize[m] | yea I use both matrix and logging into freenode directly :) |
20:01:05 | Northstrider | So in this chat we have irc, gitter, discord, and matrix users |
20:01:06 | Northstrider | :D |
20:01:15 | Northstrider | https://xkcd.com/1782/ |
20:02:57 | leorize[m] | we also have a telegram channel, but we don't bridge that one to irc |
20:03:26 | Yardanico | yeah |
20:03:34 | Yardanico | https://t.me/nim_lang |
20:03:54 | FromDiscord | <Avatarfighter> We have a telegram too!? we have everything |
20:04:44 | Yardanico | yes and I'm quite active there too :P |
20:05:05 | Northstrider | What's the purpose of having so many? This is the only community I've seen that has so many |
20:05:15 | Yardanico | Northstrider: not really, most languages are like that |
20:05:22 | Yardanico | people prefer different messaging platforms |
20:05:34 | Yardanico | python has multiple IRC, Telegram, Discord, Gitter chats |
20:05:39 | FromDiscord | <Avatarfighter> Its to provide the motivation to make a bridge between all the messengers 😛 |
20:05:46 | Yardanico | yeah, rewrite matterbridge in nim |
20:06:01 | leorize[m] | I could bridge them all via matrix if the freenode bridge wasn't so terrible |
20:06:08 | FromDiscord | <Avatarfighter> lmfao |
20:06:26 | Northstrider | leorize[m]: why is it terrible? |
20:06:41 | Yardanico | JS |
20:07:15 | Yardanico | and it's pretty "stable" in crashing every few days |
20:07:25 | Yardanico | when you see 30-50 matrix users leave and then reconnect after a few hours |
20:07:25 | leorize | crashing isn't the problem |
20:07:39 | leorize | the problem is that it chokes for a few weeks before it crashes |
20:08:20 | leorize | this is due to how overloaded matrix.org is |
20:08:26 | leorize | and how overloaded that bridge is |
20:09:05 | leorize[m] | I'm currently on a KDE-hosted bridge |
20:09:16 | Northstrider | Is it a nim specific bridge or something offered by your matrix network? |
20:09:49 | leorize[m] | but to bridge between networks I gotta use the matrix.org one, because kde don't expose the tools needed to create a plumbed room |
20:10:03 | FromDiscord | <Avatarfighter> I'm curious to know but if I have a func with the same name as an attribute of a type will and I access the attribute will it call the func or get the value directly from the type? E.g: https://dsh.re/74428 |
20:10:16 | * | jjido_ joined #nim |
20:10:18 | Yardanico | Northstrider: it's offered by freenode |
20:10:23 | leorize[m] | @Avatarfighter: attribute |
20:10:26 | Yardanico | and matrix |
20:10:27 | Yardanico | https://github.com/matrix-org/matrix-appservice-irc |
20:10:29 | Yardanico | that's the source |
20:10:38 | FromDiscord | <Avatarfighter> leorize thank you, I was about to try my thing |
20:10:46 | Northstrider | Yardanico: I imagine it would just be for a specific network though? |
20:11:08 | leorize[m] | the matrix.org bridge used to bridge to all networks |
20:11:17 | leorize[m] | now they just do freenode |
20:11:23 | Yardanico | leorize[m]: really? lol |
20:11:23 | Northstrider | Oh, why? Abuse? |
20:11:59 | leorize[m] | because centralization isn't good :) |
20:12:16 | Northstrider | Hm, might give matrix a go. Is riot still the go to? |
20:12:18 | leorize[m] | and with just freenode the bridge already kinda stalled |
20:12:25 | leorize[m] | imagine bridging all networks :p |
20:12:37 | leorize[m] | I use riot and weechat-matrix |
20:12:56 | FromDiscord | <Avatarfighter> is riot good? |
20:13:06 | leorize[m] | ok-ish |
20:13:12 | Yardanico | in the browser? ok |
20:13:16 | Yardanico | on desktop? electron |
20:13:28 | FromDiscord | <Avatarfighter> tbh anything is better than xmpp for me atm |
20:13:58 | leorize[m] | xmpp is too fragmented |
20:14:08 | leorize[m] | go on matrix, it's already performing better |
20:14:45 | leorize[m] | just make sure you never use the matrix.org home server |
20:14:50 | Northstrider | why? |
20:14:54 | Yardanico | too overloaded |
20:15:11 | Northstrider | ah |
20:15:18 | leorize[m] | https://www.anchel.nl/matrix-publiclist/ |
20:15:53 | leorize[m] | ^ either pick a public one or just host one yourself |
20:16:01 | Northstrider | If you start your own server, is it hard to "link" to other servers? i.e. will you get filtered out for being a small network? |
20:16:03 | leorize[m] | I'm using a public one though :P |
20:16:24 | leorize[m] | nope, in fact people do it all the time :) |
20:17:02 | * | sz0 quit (Ping timeout: 246 seconds) |
20:18:09 | FromGitter | <kennymalac> how to escape " in regex? |
20:18:10 | FromGitter | <kennymalac> csvd.replace(re"\".*\"", "") |
20:18:19 | FromGitter | <kennymalac> 12, 21) Error: undeclared identifier: '.*\' |
20:18:24 | Yardanico | why are you using regex for something like that? :( |
20:18:27 | * | Spy653 quit (Ping timeout: 260 seconds) |
20:18:33 | FromGitter | <kennymalac> it doesn't matter |
20:18:36 | * | sz0 joined #nim |
20:18:56 | leorize[m] | `csvd.replace(re "\".*\"", "")` |
20:19:17 | leorize[m] | yes I literally just added a space :) |
20:19:30 | FromGitter | <kennymalac> thanks |
20:19:43 | Northstrider | welp, guess I'm setting up a matrix server then |
20:19:54 | FromGitter | <kennymalac> examples online say re"" no space though , |
20:19:57 | FromGitter | <kennymalac> interetsing |
20:20:15 | leorize[m] | @kennymalac: it's a nim syntax sugar |
20:20:18 | * | sz0 quit (Max SendQ exceeded) |
20:20:24 | leorize[m] | `re""` == `re(r"")` |
20:20:35 | leorize[m] | and `r""` is a raw string, you can't escape anything in there |
20:20:42 | * | Spy653 joined #nim |
20:21:06 | FromGitter | <kennymalac> rip |
20:21:17 | FromGitter | <zetashift> what a small mistake lol |
20:21:25 | leorize[m] | it's useful when you want to type `re"\t"` |
20:21:37 | * | sz0 joined #nim |
20:21:42 | leorize[m] | since `\t` won't turn into an actual Tab |
20:23:56 | FromGitter | <kennymalac> yep |
20:24:09 | FromGitter | <kennymalac> wish it were clearer from the error I suppose |
20:28:03 | FromDiscord | <Varriount> Hm, is there a way to construct/allocate a returned object value to a reference of the object type? |
20:28:41 | FromDiscord | <Varriount> I tried doing something like `var x = (ref objectType)(functionReturningObject(...))`, but that doesn't seem to work... |
20:29:12 | leorize[m] | var x = new(ObjectType); x[] = functionReturningObject() |
20:29:19 | leorize[m] | * `var x = new(ObjectType); x[] = functionReturningObject()` |
20:29:25 | FromDiscord | <Varriount> Hm, no one-liner? |
20:29:48 | leorize[m] | well a template and you got your one-liner |
20:30:09 | leorize[m] | looks like edits on matrix don't translate well to irc |
20:54:01 | * | narimiran_ quit (Ping timeout: 265 seconds) |
20:55:49 | * | filcuc joined #nim |
20:59:35 | * | filcuc quit (Client Quit) |
21:00:16 | * | inv2004 quit (Ping timeout: 256 seconds) |
21:01:15 | * | filcuc joined #nim |
21:04:04 | FromDiscord | <Gary M> Part of a C api I'm working with requires passing a pointer to an array, but in nim I have to type the parameter as a fixed length |
21:04:18 | Yardanico | ? |
21:04:24 | Yardanico | you want to get a pointer to a nim array? |
21:04:33 | FromDiscord | <Gary M> is there a better way of handling this? I tried using ptr openArray instead but that sure didn't work |
21:04:51 | Yardanico | the C function accepts an array or returns an array? |
21:05:02 | FromDiscord | <Gary M> it accepts a pointer to an array |
21:05:04 | Yardanico | addr yourarr[0] |
21:05:08 | Yardanico | to get a pointer to an array |
21:05:20 | Yardanico | it should be "var" |
21:05:24 | FromDiscord | <Gary M> yes but as the parameter |
21:05:49 | Yardanico | ? |
21:05:54 | FromDiscord | <Gary M> proc(instance: VkInstance, pPhysicalDeviceCount: ptr uint32, pPhysicalDevices: ptr array[2, VkPhysicalDevice]) |
21:06:06 | Yardanico | you can just say "pointer" |
21:06:22 | Yardanico | and call this proc like myinstance(myarr.len, addr myarr[0]) |
21:06:26 | FromDiscord | <clyybber> @Gary M Take the address of the nim array |
21:06:26 | leorize[m] | does physical device count has any relation to the array? |
21:06:41 | FromDiscord | <Gary M> @clyybber I was, and it works if everything is fixed |
21:06:47 | FromDiscord | <clyybber> Yeah |
21:07:07 | FromDiscord | <Gary M> but that means fixed size in the wrapper which isn't really correct |
21:07:24 | FromDiscord | <clyybber> Yeah, which wrapper are you using? |
21:07:29 | leorize[m] | is this a raw wrapper? |
21:07:39 | FromDiscord | <clyybber> You could use mine: https://github.com/Clyybber/vulkanim ? |
21:07:41 | FromDiscord | <clyybber> 😄 |
21:08:28 | FromDiscord | <Gary M> it's the nimsl vulkan wrapper |
21:08:31 | * | natrys quit (Ping timeout: 265 seconds) |
21:08:37 | * | ljoonal quit (Quit: ljoonal.xyz) |
21:08:42 | FromDiscord | <Gary M> which previously only accepted a pointer to a single VkPhysicalDevice |
21:08:48 | FromDiscord | <Gary M> instead of an array |
21:09:03 | FromDiscord | <clyybber> Which is the right way here |
21:09:16 | FromDiscord | <clyybber> Give it addr thearray[0] |
21:09:44 | FromDiscord | <clyybber> The address to the first array element so to say |
21:09:53 | FromDiscord | <clyybber> You can do that for seqs too |
21:10:26 | * | ljoonal joined #nim |
21:11:23 | FromDiscord | <Gary M> ah, thank you 😄 |
21:11:28 | FromDiscord | <clyybber> np |
21:11:34 | FromDiscord | <Gary M> does your wrapper cover 1.2 spec? |
21:11:53 | FromDiscord | <clyybber> Ah, not yet. Let me update it |
21:12:17 | FromDiscord | <Gary M> cool, I'll see about switching over then |
21:14:24 | * | inv2004 joined #nim |
21:16:33 | FromGitter | <sealmove> kill this guy https://www.youtube.com/watch?v=DCfDLWfPqiA |
21:17:19 | Yardanico | he just used "Nim" to make his video more popular |
21:17:30 | Yardanico | too long to watch |
21:18:24 | * | liblq-dev joined #nim |
21:19:10 | * | EvergreenTree left #nim ("The Lounge - https://thelounge.chat") |
21:19:21 | FromGitter | <sealmove> he does it with all languages and finishes each video with something like "learning X is a waste of time because PHP will get you more money" |
21:19:36 | Yardanico | I quickly skimmed over the video and it's just "python is popular" and "money matters the most" |
21:19:55 | FromGitter | <sealmove> pretty accurate |
21:20:08 | FromGitter | <sealmove> (description of the video content) |
21:21:25 | FromGitter | <sealmove> also the article he refers to is garbage! it says Nim is a scripting language |
21:21:27 | * | natrys joined #nim |
21:21:50 | FromGitter | <sealmove> I don't know, this guy is toxic to programming community |
21:21:57 | FromGitter | <kaushalmodi> yeah, that was a garbage article; I commented on Twitter |
21:23:05 | Yardanico | what would you recommend for a personal blog guys? I mean software |
21:23:43 | FromGitter | <kaushalmodi> Hugo |
21:29:14 | zacharycarter | Hmm - I have a cpp file in my project that I need to compile as well as an objective-c source file |
21:29:23 | zacharycarter | not quite sure how to do this... |
21:31:10 | * | NimBot joined #nim |
21:31:17 | FromDiscord | <clyybber> @Gary M updated `:)` |
21:31:28 | zacharycarter | anyone have any suggestions? |
21:32:14 | zacharycarter | I don't need my Nim code compiled to cpp, but I do need to compile a cpp source file when building my project |
21:32:29 | companion_cube | is there a way of imitating C's `struct foo { int n; char c[] }` where the array has size n? |
21:32:41 | companion_cube | (in one block, I mean) |
21:33:22 | FromGitter | <kaushalmodi> zacharycarter: https://nim-lang.github.io/Nim/manual.html#implementation-specific-pragmas-compile-pragma ? |
21:33:55 | zacharycarter | thanks |
21:34:21 | zacharycarter | well I"m using that in one of my files with the cpp source |
21:34:43 | zacharycarter | maybe it's nimterops fault :P let me try replacing `cCompile` with a compile pragma in my nimterop module |
21:35:40 | FromGitter | <kaushalmodi> zacharycarter: hmm. I'd think that nimterop should be then doing the Right Thing here |
21:37:19 | zacharycarter | here's what happens - I have one file in my lib folder named `cr.cpp` which contains a preprocessor directive - `#define CR_HOST CR_SAFEST` and then includes a header file - that's it |
21:37:28 | * | leorize[m] sent a long message: < https://kde.modular.im/_matrix/media/r0/download/kde.org/KwkGYOebBgFfkuBABqsmTnoN > |
21:37:36 | leorize | companion_cube: ^ |
21:38:16 | zacharycarter | then I have a `nim` file named `cr.nim` which contains a Nim wrapper for this lib as well as `{.compile: "./lib/cr.cpp".} |
21:38:42 | zacharycarter | then I have another file named `sokol.nim` which uses nimterop to wrap the sokol_gfx and sokol_app single header files |
21:39:11 | companion_cube | leorize: oh cool, and it will have the same layout in one block then? |
21:39:16 | zacharycarter | and in that file I call `cCompile` to a `.m` file which does essentially the same thing as the cpp source file, just with sokol preprocessor directives / includes |
21:39:23 | companion_cube | I haven't really found how to display the generated C in a nice way |
21:39:33 | zacharycarter | and I end up with this error - `error: invalid argument '-std=gnu++14' not allowed with 'Objective-C` |
21:39:35 | leorize[m] | you can't :P |
21:39:47 | companion_cube | sad :D |
21:40:19 | leorize[m] | zacharycarter: I don't think the compiler support multiple backend in one module |
21:40:43 | zacharycarter | ooph |
21:41:23 | zacharycarter | I guess I'm screwed then |
21:42:32 | FromDiscord | <exelotl> Trying to use nimterop's toast and I keep getting errors such as `Identifier '__NEWLIB__' (nskConst) contains leading/trailing underscores '_' [AssertionError]` |
21:42:46 | Yardanico | you need to use onSymbol |
21:43:02 | Yardanico | https://github.com/Yardanico/nim-libvlc/blob/master/src/libvlc.nim#L31 see like I for example replace libvlc_ with "" |
21:43:29 | FromDiscord | <exelotl> ah so I have to give toast a plugin source path? |
21:43:57 | Yardanico | oh idk how to do it directly with toast |
21:44:22 | FromDiscord | <Gary M> @Clyybber cool, and do you mind me bugging you in DM's about your API? |
21:44:40 | FromDiscord | <exelotl> I want to write a program that generates bindings |
21:45:05 | Yardanico | why not use nimterop itself? |
21:45:50 | FromDiscord | <clyybber> @Gary M go bug ahead! |
21:46:35 | FromDiscord | <exelotl> I don't understand how to troubleshoot nimterop issues, it could really do with a tutorial or something |
21:48:18 | zacharycarter | leorize[m]: the restriction doesn't even appear to be per-module but instead for the entire source tree |
21:48:33 | zacharycarter | I just split my imports into different modules, and I get the same error |
21:48:49 | zacharycarter | so there's no workaround for this? this kind of stinks |
21:49:12 | inv2004 | Are there any way to disable overflow check just for one function? my proc hash. |
21:50:12 | leorize | zacharycarter: sadly, nope |
21:50:35 | leorize | inv2004: yes, but wouldn't a hashing function use uint instead? |
21:50:38 | FromDiscord | <clyybber> inv2004: Use uint |
21:51:14 | zacharycarter | ugh well I guess I'm just going to use Nim for game code only then |
21:52:02 | companion_cube | leorize: it'd be nice to see at least type declarations in C |
21:52:20 | leorize | you can see them, they are just not pretty |
21:53:31 | leorize | zacharycarter: doesn't nimterop let you build using the target library build system? |
21:53:36 | * | fputs joined #nim |
21:54:18 | zacharycarter | yes but these are both single header files |
21:54:28 | * | Yardanico_ joined #nim |
21:54:35 | zacharycarter | one of the projects does have a build system, but it's fips which I'm guessing nimterop doesn't support |
21:54:45 | leorize | wouldn't emit `#include` work? |
21:55:02 | zacharycarter | the implementation still has to be compiled |
21:55:48 | leorize | write some nimscript to setup the target build system then |
21:55:52 | * | Yardanico quit (Read error: Connection reset by peer) |
21:57:22 | zacharycarter | I'm not sure I follow - I am not compiling anything to a shared library - I'm just compiling these sources when I compile the Nim source that depends on them |
21:57:50 | zacharycarter | I'm pretty sure you get that - but I'm not understanding what I can do with Nimscript to fix the need for multiple backends during compilation |
22:01:26 | FromDiscord | <exelotl> can anyone see what I'm doing wrong here? https://github.com/exelotl/nimterop-test |
22:03:30 | FromDiscord | <exelotl> oh... is it just because set_n is an inline function? |
22:04:31 | * | tane quit (Ping timeout: 250 seconds) |
22:04:41 | inv2004 | leorize, it did not help, but ok, will check it later :) |
22:07:49 | * | lritter joined #nim |
22:08:33 | inv2004 | While chat is not sleeping, can I ask another question: https://gist.github.com/inv2004/74b7067050f3d1421e95b967f493d377 |
22:09:23 | inv2004 | Its about: Error: cannot create a flowVar of type: CountTable[system.int] |
22:09:48 | leorize | try using the threadpool at https://github.com/yglukhov/threadpools instead |
22:11:58 | inv2004 | Cannot find it in nimble |
22:12:16 | leorize[m] | yea it's not on nimble |
22:12:27 | leorize[m] | you can just clone it as a submodule |
22:13:00 | inv2004 | can I somehow include it .nimble file from git ? |
22:14:02 | * | filcuc quit (Quit: Konversation terminated!) |
22:18:22 | * | natrys quit (Quit: natrys) |
22:18:43 | shashlick | you can use -E and -F on the command line to strip leading and trailing chars |
22:18:52 | shashlick | or pass it to the flags param for cImport |
22:19:04 | shashlick | exelotl, will check out your issue in 30 mins |
22:19:07 | shashlick | z as well |
22:19:13 | Northstrider | test |
22:19:57 | leorize[m] | are you on matrix now? |
22:20:08 | Northstrider | Can you see my messages on matrix? |
22:20:17 | Northstrider | @chance:carey.sh |
22:20:54 | leorize[m] | I'm not in the matrix.org bridge :p |
22:20:57 | Northstrider | I see messages, but can't seem to send them |
22:20:58 | leorize[m] | but if you're on IRC then matrix sees you |
22:21:43 | * | leorize[m]1 joined #nim |
22:23:03 | dadada | is æ easy to produce on an English keyboard? it's easy with Alt Gr + a on a German one |
22:23:53 | leorize[m]1 | chance: yep I see you |
22:23:57 | leorize[m]1 | welcome to the matrix.org bridge |
22:24:08 | inv2004 | are there any way to apply some operation to varible and immidiately pass it like var ? |
22:24:17 | leorize[m]1 | now you know why I said it's trash :) |
22:24:31 | leorize | inv2004: wdym? |
22:24:41 | FromGitter | <zacharycarter> shashlick: thanks but I think this might be a mom limitation and not an issue with nimterop |
22:24:42 | leorize[m]1 | #_freenode_#nim:kde.org <- join that instead |
22:25:00 | leorize[m]1 | * `#_freenode_#nim:kde.org` <- join that instead |
22:25:05 | * | leorize[m]1 left #nim (#nim) |
22:25:07 | Northstrider | #_freenode_#nim ? |
22:25:11 | Northstrider | Underscores like that? |
22:25:25 | leorize | yea, it's the KDE freenode bridge |
22:25:26 | * | chance-M joined #nim |
22:25:38 | leorize[m] | it's not on matrix.org and less people use this one |
22:25:42 | leorize[m] | so it's much more responsive |
22:25:43 | chance-M | Oh wow, that was a good bit faster |
22:25:57 | FromGitter | <zacharycarter> https://github.com/nim-lang/Nim/issues/2748 |
22:26:00 | chance-M | Was wondering if it was my synapse server killing itself |
22:26:10 | chance-M | Ran into the weirdest issues and, as always, it was fucking DNS |
22:26:13 | chance-M | Wasn't sure I'd solved them all |
22:28:18 | FromDiscord | <exelotl> ok so I got `toast` to load my plugin... how do I tell it to throw away the symbol? |
22:28:44 | FromDiscord | <exelotl> ```proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} = #something``` |
22:29:03 | * | chance-M is now known as Northstrider[m] |
22:30:11 | FromDiscord | <InventorMatt> did you try using discard? |
22:30:15 | Northstrider[m] | Alright, seems to be all set up, wonder how stable this will be. Have to say, riot isn't the most responsive of clients, and joining medium sized rooms takes absolutely forever |
22:31:23 | * | opal quit (Ping timeout: 240 seconds) |
22:31:24 | * | hpyc9 quit (Killed (Sigyn (Stay safe off irc))) |
22:31:53 | * | Northstrider[m] quit (Quit: authenticating) |
22:32:00 | * | Northstrider[m] joined #nim |
22:33:44 | leorize[m] | chance: it depends on what server the room is on :P |
22:33:55 | leorize[m] | but yea, the riot client UX is terrible for this |
22:34:55 | Northstrider[m] | hoho, setting a different nick to my matrix name was a mistake, as you'll see me as @chance, and irc will see northstrider[m] |
22:35:44 | leorize[m] | use /nick to change it here |
22:36:40 | * | hpyc9 joined #nim |
22:36:40 | * | opal joined #nim |
22:38:48 | * | Northstrider[m] quit (Disconnected by services) |
22:38:55 | * | Northstrider[m] joined #nim |
22:39:54 | shashlick | exelotl: set it to blank to discard |
22:41:01 | FromDiscord | <exelotl> It doesn't like that: `Blank identifier, originally 'Override:_NEWLIB_VERSION_H__' (nskConst), cannot be empty` |
22:41:56 | FromDiscord | <exelotl> that's if I do `sym.name = ""`, or `sym = Symbol()` |
22:46:15 | * | pbb joined #nim |
22:47:07 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:50:28 | * | xcm quit (Remote host closed the connection) |
22:52:40 | * | xcm joined #nim |
22:53:38 | dadada | is there a std proc for reading the nth line of a file? |
22:54:22 | dadada | ie. the 700th line, without having to go through 1-699 |
22:54:48 | leorize | the sad story is that to do so you still gotta read through the other ones :P |
22:55:15 | dadada | ya, it's for convenience |
22:55:47 | Prestige | hm so compilation doesn't seem to fail if I make incorrect calls to external libs? I passed extra params of incorrect types to XGrabButton and compilation succeeded. Is there a way to check for these kinds of issues? |
22:56:09 | shashlick | @exelotl can you point to the code you are wrapping |
22:57:17 | leorize[m] | dadada: https://play.nim-lang.org/#ix=2i5n this for now |
22:58:11 | dadada | thanks, I'll use it :-) |
22:58:51 | * | Yardanico_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:59:21 | dadada | leorize[m]: should there not be a inc i somewhere? |
22:59:23 | * | Yardanico joined #nim |
22:59:53 | dadada | an inc i |
23:00:02 | leorize | oh yea I forgot :P |
23:03:39 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
23:05:20 | * | jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:07:27 | * | Northstrider[m] quit (Disconnected by services) |
23:07:33 | * | Northstrider[m] joined #nim |
23:10:43 | * | PMunch quit (Quit: leaving) |
23:11:02 | dadada | there a macros/pragmas specifically for forstmts? am I right? |
23:11:15 | dadada | if so, does somebody have examples? |
23:14:20 | inv2004 | Any ideas how to improve getSeq here? https://github.com/inv2004/knucleotide_nim/blob/master/src/knucleotide_nim.nim#L61 |
23:14:43 | inv2004 | Because it takes x4 more times than my rust implementation |
23:15:17 | Yardanico | how are you compiling it ? :) |
23:15:33 | inv2004 | ??? nimble build -d:danger |
23:16:00 | * | xet7 joined #nim |
23:17:08 | leorize | what's your rust implementation? |
23:18:16 | inv2004 | leorize, its here: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/knucleotide-rust-9.html |
23:18:31 | Yardanico | that is what encrypted message |
23:18:47 | inv2004 | It was on the first place, but looks like they broke something again and it is on the second now. |
23:19:37 | leorize | omg this is spaghetti |
23:19:56 | inv2004 | I can translate :) |
23:19:56 | leorize | is this how idiomatic rust supposed to look like? :P |
23:20:46 | inv2004 | leorize, you see, I am in the nim-chat, even after I created the fastest Rust implementation :) |
23:20:56 | leorize | I can see why |
23:21:58 | FromDiscord | <KingDarBoja> videofile: you there bro? |
23:24:32 | FromDiscord | <Gary M> so uh, I'm linking to a vulkan dll on windows like {.link: """C:\Windows\System32\Vulkan-1.dll""".} but hard coding the path feels wrong |
23:24:47 | Araq | inv2004, try with --gc:arc and somehow fight the seq implementation not to auto-initialize the memory |
23:24:49 | * | neceve quit (Ping timeout: 264 seconds) |
23:24:58 | Araq | good night |
23:25:19 | leorize | add {.noInit.} to the function and see if it's faster |
23:36:57 | * | dwdv quit (Ping timeout: 246 seconds) |
23:37:01 | * | chance[m] joined #nim |
23:37:59 | leorize | @Gary M: I don't think you even have to link |
23:38:22 | inv2004 | --gc:arc has some conflict with threads. .noinit. to the var line did not help also, and I did not expect it would help |
23:39:34 | leorize | I mean `{.noInit.}` to the function declaration itself :) |
23:39:49 | leorize | it will prevent the `result` variable from auto initializing |
23:40:34 | inv2004 | ah, ok, but I am not sure that one allocation takes all the time |
23:40:43 | Yardanico | did you profile it? |
23:40:55 | Yardanico | to see which takes the most time |
23:40:58 | Yardanico | *what |
23:41:17 | inv2004 | not yet, did not profile in nim anything |
23:41:29 | inv2004 | but pretty sure it is readline |
23:41:31 | Yardanico | well the simplest way is to just use "perf" if you're on linux |
23:41:32 | leorize | inv2004: genericReset is a creepy performance killer |
23:41:45 | leorize | and it's implicit for result variables |
23:42:08 | leorize | though we should probably ping @mratsim, as he is the perf king |
23:42:35 | inv2004 | leorize, just googled it "Always use a main proc" interesting |
23:44:21 | leorize | I consider it really wrong when the C++ version is more readable than the rust one |
23:46:32 | inv2004 | leorize, a-ha-ha, I pointed it also. My main "rust" idea was to use generics for primitive types, for hashtable for u8 u16 and u32 is a bit more affective than plain u64 solution. And it worked. |
23:46:50 | inv2004 | ... effective ... irc :( |
23:48:00 | inv2004 | C++ do this optimization for hash by templates, I am pretty sure it is very hard to beat it with any other's languages' hashtables |
23:48:34 | inv2004 | anyway generics helped a bit even in rust's implementation |
23:48:44 | leorize[m] | well Nim can do that kind of optimization too :) |
23:48:46 | FromGitter | <awr1> is `export <module_name> except <symbol>` valid |
23:48:53 | Yardanico | I think so |
23:48:54 | FromGitter | <awr1> i know `export <module_name>` is valid |
23:49:08 | Yardanico | !eval import sequtils; export sequtils except mapIt |
23:49:09 | inv2004 | leorize[m], wrapping in main did not help, but it would be too easy |
23:49:10 | NimBot | <no output> |
23:49:35 | FromGitter | <awr1> thanks! |
23:50:22 | FromGitter | <awr1> bitops disappoints me...no varargs bitor/bitand |
23:51:03 | leorize[m] | maybe write one and pr it in? :) |
23:52:31 | FromGitter | <awr1> good idea |
23:52:33 | leorize[m] | inv2004: you should try to profile the Nim version. Build with debuginfo `-g` and -d:release and you can use pretty much any C profiler to profile the program |
23:52:55 | inv2004 | yes, thank you, it is clear, I will try |
23:53:01 | FromGitter | <zacharycarter> does anyone have any idea how difficult it would be to make the compile pragma invoke different backends based on file extension? |
23:53:36 | shashlick | it should already right? |
23:54:00 | FromGitter | <awr1> if it doesn't already, you could do a macro |
23:54:02 | leorize[m] | it probably doesn't know about objc |
23:54:38 | * | Yardanico quit (Read error: Connection reset by peer) |
23:54:47 | FromGitter | <awr1> ahhhhh |
23:54:48 | FromGitter | <awr1> i see |
23:54:50 | FromGitter | <awr1> hm |
23:54:50 | * | inv2004 quit (Quit: Leaving) |
23:55:04 | FromGitter | <awr1> you should raise an issue imo |
23:55:04 | FromGitter | <zacharycarter> yeah apparently it does not |
23:55:52 | FromGitter | <zacharycarter> I will - I'll see if I can fix it first though |
23:55:54 | shashlick | you could just compile it manually and add it to the link call |
23:57:17 | zacharycarter | link the object file? |
23:57:25 | zacharycarter | I don't want to actually build any library from the code |
23:58:00 | zacharycarter | it's like three single header libs - two need to be compiled with objc and the other needs to be compiled with cpp |
23:59:51 | * | ftsf joined #nim |
23:59:51 | * | Yardanico joined #nim |