00:00:50 | * | ftsf joined #nim |
00:02:51 | * | ptdel joined #nim |
00:05:12 | * | exelotl_ quit (Quit: Leaving) |
00:05:15 | * | xcm quit (Remote host closed the connection) |
00:07:22 | * | xcm joined #nim |
00:10:30 | * | zacharycarter quit (Ping timeout: 260 seconds) |
00:12:11 | * | zacharycarter joined #nim |
00:17:56 | * | couven92 quit (Ping timeout: 258 seconds) |
00:20:40 | * | Trustable quit (Remote host closed the connection) |
00:31:58 | * | zacharycarter quit (Ping timeout: 260 seconds) |
00:40:04 | * | ryan_ is now known as number_dos |
00:40:12 | * | number_dos is now known as numero_dos |
00:46:44 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
00:48:32 | * | ryan_ joined #nim |
00:49:34 | * | ryan_ is now known as ni-ban |
00:50:43 | * | numero_dos quit (Ping timeout: 246 seconds) |
01:06:14 | * | dddddd quit (Remote host closed the connection) |
01:33:45 | * | krux02_ quit (Ping timeout: 240 seconds) |
01:43:40 | FromDiscord | <cgarciae> hey, I've been trying to finds the docs for concept types but had no luck. Can someone point me to them? |
01:44:11 | FromDiscord | <Rika> manual_experimental |
01:44:19 | FromDiscord | <Rika> https://nim-lang.org/docs/manual_experimental.html |
01:44:40 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/manual_experimental.html#concepts |
01:44:42 | FromDiscord | <Elegant Beef> 1 upd! |
01:44:47 | FromDiscord | <cgarciae> Thanks! Are they experimental? |
01:44:52 | FromDiscord | <Rika> kinda yes |
01:45:10 | FromDiscord | <Rika> my experience with them makes me think theyre still p. experimental |
01:45:33 | FromDiscord | <cgarciae> I've found posts from 2015-16 talking about them |
01:45:42 | FromDiscord | <Rika> age does not mean maturity |
01:45:53 | FromDiscord | <Elegant Beef> *Ha dick joke here* |
01:46:39 | FromDiscord | <cgarciae> I see. Thanks! |
01:47:17 | FromDiscord | <Rika> maybe someone more advanced than me can pitch in regards this though |
01:47:27 | FromDiscord | <Rika> one sample point is not much to base on |
01:48:10 | FromDiscord | <cgarciae> By the way, types automatically "implement" a concept if they have the correct signature? No need to explicitly declare them? |
01:48:25 | FromDiscord | <Rika> signature? |
01:48:47 | FromDiscord | <Rika> also note concepts are compile time constructs |
01:49:00 | * | Kaivo quit (Ping timeout: 244 seconds) |
01:49:35 | FromDiscord | <Elegant Beef> Im looking at these now and i dont understand a thing |
01:49:50 | leorize | concepts are additional constraints that a type must conform |
01:50:02 | FromDiscord | <Elegant Beef> It's like an interface in C# no? |
01:50:02 | leorize | a more detailed version of generics |
01:50:05 | leorize | no |
01:50:10 | FromDiscord | <Rika> how do you check if a type conforms to a concept |
01:50:15 | FromDiscord | <Rika> interfaces are runtime |
01:51:00 | leorize | how do you check if something matches your generic type? |
01:51:57 | FromDiscord | <cgarciae> I am basing on this: https://gist.github.com/PhilipWitte/33819b40112a18c30b43 |
01:52:06 | * | chemist69 quit (Ping timeout: 244 seconds) |
01:52:40 | FromDiscord | <Rika> leorize: i do not know either |
01:52:41 | FromDiscord | <Rika> is? |
01:52:50 | FromDiscord | <Rika> Type is Concept? |
01:53:08 | FromDiscord | <cgarciae> For me they are similar to Swift protocols |
01:53:32 | Prestige | Does sort of remind me of an interface |
01:53:39 | FromDiscord | <Elegant Beef> I'd say they're very similar to a C# interface in this example |
01:53:53 | leorize | yea, but most interface implementations are runtime |
01:54:04 | FromDiscord | <Rika> @Elegant Beef https://stackoverflow.com/questions/6948166/javas-interface-and-haskells-type-class-differences-and-similarities |
01:54:06 | leorize | this is a compile time thing |
01:54:17 | * | chemist69 joined #nim |
01:54:25 | FromDiscord | <Rika> nims concepts are closer to haskells type class than interfaces |
01:54:26 | Prestige | even better! |
01:54:40 | leorize | there's a reason they're in experimental |
01:54:49 | FromDiscord | <Rika> when i saw "concepts" i immediately thought haskell |
01:55:29 | FromDiscord | <Elegant Beef> I mean a majority of my coding experience is inside Unity so.... everything is runtime! |
01:55:49 | FromDiscord | <Rika> sounds like absolute pain, beef |
01:55:53 | leorize | the syntax of concepts are weird |
01:56:07 | leorize | and that if you aren't careful those things explodes your compile time |
01:56:13 | Prestige | js/java mostly, here. Love having compile-time code in nim |
01:56:14 | FromDiscord | <cgarciae> Concept contraints seem very powerful |
01:56:18 | FromDiscord | <Elegant Beef> lol, good think im more of a technical artist now, than a proper gamedev |
01:56:19 | FromDiscord | <Rika> which is why theyre experimental |
01:56:24 | FromDiscord | <Elegant Beef> thing* |
01:57:17 | leorize | we also had a proposal for vtref, which is the kind of interface you know |
01:57:26 | FromDiscord | <Rika> vtref? |
01:57:44 | leorize | basically the runtime version of concepts |
01:57:46 | FromDiscord | <Elegant Beef> I sorta liked interfaced |
01:58:06 | FromDiscord | <Elegant Beef> Although it's unlicensed so not technically legally allowed to copy it |
01:58:11 | FromDiscord | <Elegant Beef> Although it's unlicensed so not technically legally allowed to copy/distribute it |
01:58:26 | leorize | don't worry, it's originated from the nimforum |
01:58:37 | leorize | all code there are mit licensed unless stated otherwise |
01:58:44 | FromDiscord | <Elegant Beef> Ah |
01:58:55 | FromDiscord | <cgarciae> In this example: |
01:58:55 | FromDiscord | <cgarciae> |
01:58:55 | FromDiscord | <cgarciae> Comparable = concept x, y |
01:58:56 | FromDiscord | <cgarciae> (x < y) is bool |
01:58:56 | FromDiscord | <cgarciae> |
01:58:56 | FromDiscord | <cgarciae> How do you use Comparable? |
01:59:01 | leorize | or you can ask krux :P |
01:59:06 | FromDiscord | <Elegant Beef> Nah |
01:59:13 | FromDiscord | <Elegant Beef> It's slangmgh's version |
01:59:20 | FromDiscord | <Elegant Beef> So it's on github without a license |
01:59:45 | leorize | cgarciae: use it as a type for parameters |
01:59:58 | FromDiscord | <Rika> OH |
02:00:01 | FromDiscord | <Rika> i see |
02:00:12 | FromDiscord | <cgarciae> proc f(x: Comparable) ?? |
02:00:17 | FromDiscord | <Rika> yeah i assume |
02:00:23 | FromDiscord | <cgarciae> Hmmm |
02:01:30 | FromDiscord | <cgarciae> So `concept x, y` do implies x and y are of the same type? |
02:02:16 | FromGitter | <Knaque> How might I go about adding new environment variables on Windows? As in, how can I add them through code? |
02:02:22 | FromDiscord | <Elegant Beef> putEnv |
02:02:36 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/os.html#putEnv%2Cstring%2Cstring |
02:02:57 | FromDiscord | <Rika> @cgarciae `The identifiers following the concept keyword represent instances of the currently matched type` |
02:02:59 | FromDiscord | <Rika> from the manual |
02:03:48 | leorize | Knaque: depends on what you're trying to do |
02:03:50 | FromDiscord | <Elegant Beef> So seems you need to have an implementation where x<y == bool |
02:03:56 | leorize | if you only want to export GIT_ASKPASS, use putEnv |
02:04:05 | FromDiscord | <cgarciae> Just saw it! Thanks @Rika |
02:05:51 | FromDiscord | <cgarciae> In Swift it was very painful to have an array of protocols, can you have an array/seq of concepts? |
02:06:02 | FromDiscord | <Elegant Beef> It'd appear so |
02:06:06 | FromDiscord | <Rika> no? |
02:06:12 | leorize | you can't |
02:06:15 | FromDiscord | <Rika> we just established that concepts are compile time only |
02:06:16 | FromDiscord | <Elegant Beef> *Weird* |
02:06:21 | FromDiscord | <Rika> they cease to exist on runtime |
02:06:27 | FromDiscord | <Rika> just like generics |
02:06:53 | leorize | as I said, they're like generics but detailed |
02:07:08 | FromDiscord | <cgarciae> I see. So you have to create a wrapper type? |
02:07:13 | FromDiscord | <Rika> ? |
02:07:18 | FromDiscord | <Rika> what do you mean |
02:07:21 | FromDiscord | <Rika> i dont understand |
02:07:33 | FromDiscord | <Elegant Beef> i'd imagine using methods and inheritance is what you'd want? |
02:07:43 | FromDiscord | <Elegant Beef> Idk runtime- compile time shit is scary |
02:07:45 | FromGitter | <Knaque> Regarding `putEnv()`, it saves that variable permanently, right? |
02:07:48 | FromDiscord | <Elegant Beef> Idk runtime - compile time shit is scary |
02:07:48 | FromDiscord | <cgarciae> In Swift the trick is called Type Erasure |
02:08:32 | FromGitter | <Knaque> Cause I need it to stick around indefinitely (unless manually removed ofc). |
02:08:57 | leorize[m] | then it wouldn't do |
02:09:11 | FromDiscord | <Rika> is it "more efficient" to represent a sequence of bytes as a string, or do the other disadvantages outweigh the advantages, if any? |
02:09:35 | leorize[m] | @Rika: depends on the context |
02:09:35 | FromGitter | <Knaque> Is there a file or something I can edit? |
02:09:41 | leorize[m] | in Nim they're the same |
02:09:50 | FromDiscord | <Rika> to represent an image] |
02:09:54 | FromGitter | <Knaque> (Assuming you were talking to me a second ago, Leorize) |
02:10:11 | leorize[m] | Knaque: learn from the compiler source, see finish.nim |
02:10:23 | leorize[m] | it has a proc for adding things into the path variable |
02:10:48 | leorize[m] | should be applicable to everything |
02:11:26 | leorize[m] | @Rika: in Nim a string and a seq[byte] have the same internal representation |
02:14:27 | FromDiscord | <Rika> okay, thanks |
02:19:48 | FromGitter | <Knaque> @leorize I think I found the right proc, but it's not immediately clear how to use it and I'd rather not screw with my environment variables trying to figure it out. Could I get away with running `setx`? |
02:20:21 | leorize[m] | give it a go I guess |
02:20:30 | FromGitter | <Knaque> Worth a shot. |
02:22:57 | leorize[m] | https://stackoverflow.com/questions/5246046/how-to-add-environment-variable-in-c#5246097 |
02:23:21 | leorize[m] | ^ winim should have the needed apis wrapped too |
02:26:35 | * | endragor quit (Quit: Leaving...) |
02:28:16 | * | muffindrake quit (Ping timeout: 244 seconds) |
02:30:39 | * | muffindrake joined #nim |
02:42:13 | FromGitter | <tulayang_gitlab> Hi. |
02:43:18 | * | xcm quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
02:44:01 | leorize | hi :) |
02:45:06 | * | xcm joined #nim |
02:47:59 | FromGitter | <tulayang> How to disable the hints of ``runnableExamples``? I found this switch ``hints:off`` does not work. I am working on a lot of documentation, these hints are really bothering me. |
03:00:02 | leorize | I don't think you can :/ |
03:07:09 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:13:04 | FromGitter | <Knaque> Alright, last question cause I've gotten everything else working: Is it possible to make a shortcut (.lnk)? I'm thinking that I could just write a .lnk file, but I have no idea how they're actually laid out, 'cause I can't open them. |
03:14:48 | FromGitter | <Knaque> Nevermind, managed to open one, but turns out it's garbled binary stuff. |
03:19:37 | FromDiscord | <Elegant Beef> Knaque entire pdf for the lnk format https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SHLLINK/%5bMS-SHLLINK%5d.pdf |
03:19:54 | leorize | you can do some COM wizardry to get it to work |
03:20:01 | leorize | pretty sure winim might have what you need |
03:20:11 | FromDiscord | <Elegant Beef> If it doesnt have fun! 😄 |
03:23:18 | leorize | https://docs.microsoft.com/en-us/windows/win32/shell/links?redirectedfrom=MSDN#creating-a-shortcut-and-a-folder-shortcut-to-a-file |
03:23:20 | leorize | have fun :P |
03:42:57 | FromDiscord | <cgarciae> Created a gist about "Type Erasure" in Nim, at least how I learned it in Swift. Is there a more idiomatic way of doing this? |
03:42:57 | FromDiscord | <cgarciae> |
03:42:57 | FromDiscord | <cgarciae> https://gist.github.com/cgarciae/9b7f5d456e8aed3181f8b30f13de2f01 |
03:47:08 | FromDiscord | <cgarciae> Basically you create Any* types that erase specific types by capturing their functionality in procs. |
03:47:08 | FromDiscord | <cgarciae> Now you can create arrays/seqs of these types. |
04:04:55 | Prestige | Is there no min/max math procs? I see something for sequences but that's about it |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:42 | * | supakeen joined #nim |
04:07:33 | FromDiscord | <Yardanico> There are |
04:07:38 | FromDiscord | <Yardanico> In math module :( |
04:07:41 | FromDiscord | <Yardanico> :) * |
04:08:07 | FromDiscord | <Yardanico> Ah wait sorry no |
04:08:44 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#max%2CopenArray%5BT%5D |
04:09:03 | FromDiscord | <Yardanico> Look above this one for two-argument mac |
04:09:08 | FromDiscord | <Yardanico> *max. Same for min |
04:09:28 | * | nsf joined #nim |
04:10:06 | Prestige | Is there any cost to creating an array to pass into a function? I've just been using a simple proc I've created that takes two ints |
04:12:42 | * | rockcavera quit (Remote host closed the connection) |
04:15:50 | * | opal quit (Quit: No Ping reply in 180 seconds.) |
04:15:58 | * | qwertfisch_ joined #nim |
04:16:26 | * | qwertfisch quit (Ping timeout: 260 seconds) |
04:17:12 | * | opal joined #nim |
04:22:48 | voltist | How does the Nim compiler know where the standard library is on your system without you having to specify? |
04:22:55 | voltist | When installed with choosenim that is |
04:29:57 | * | narimiran joined #nim |
04:31:49 | disruptek | voltist: it looks near its binary. |
04:32:04 | skrylar[m] | got around to seeing if hcr worked on windows. it kinda did, but then it exploded when i tried to use after_code_reload hooks :shrug: |
04:32:06 | disruptek | you can specify the lib location. |
04:32:15 | voltist | Ah ok, thanks |
04:33:50 | disruptek | cgarciae: see case objects, aka variant objects, for the idiomatic approach. |
04:36:23 | leorize | cgarciae: so basically this is just dynamic dispatching? |
04:36:28 | leorize | see `method` |
04:36:48 | * | disruptek sighs. |
04:38:53 | Prestige | Is there something inherently bad with using methods instead of variant objects? Idk about any of the downsides |
04:40:22 | disruptek | they are slower. |
04:40:34 | * | thomasross quit (Ping timeout: 240 seconds) |
04:40:48 | Prestige | Interesting |
04:41:21 | Prestige | I will need to play with variant objects more |
04:42:05 | disruptek | they are idiomatic. methods are more trappy. |
04:43:05 | Prestige | Do you happen to have any implemented examples on hand I could check out, other than NimNodes? |
04:43:51 | disruptek | countless. |
04:45:03 | disruptek | !repo gully |
04:45:04 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 2⭐ 0🍴 |
04:45:53 | disruptek | !repo nimph |
04:45:54 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 60⭐ 4🍴 7& 1 more... |
04:46:04 | Prestige | Thanks, I'll give it a look over |
04:48:04 | FromGitter | <bung87> any resource for build portable windows exe with icon? |
04:50:14 | skrylar[m] | well the exes are already "portable" unless you use a dependency which brings in outside dlls |
04:51:26 | FromGitter | <bung87> what about icon? |
04:52:35 | FromGitter | <bung87> I'm writing a gui app and already write a build script for mac , that can packaing it to .app , I want implement it for windows |
05:06:36 | leorize | you need to build a resource file and link it with your program |
05:07:03 | * | ryan_ joined #nim |
05:08:17 | voltist | Gee I love Nim's simplicity (and wonderful package developers). Static website generator in 43 lines of code? Can do. |
05:08:28 | skrylar[m] | yes but i forget if the nim compiler will do that part |
05:08:56 | skrylar[m] | usually you have to make a res file and then run winres on it and link that along with the c files |
05:09:15 | * | ni-ban quit (Ping timeout: 240 seconds) |
05:09:44 | skrylar[m] | it might be fine if you used {.passl.} |
05:13:41 | * | shodan45 quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:28:09 | FromGitter | <bung87> @ leorize thank you , found it's related to windres |
05:29:14 | FromGitter | <bung87> @skrylar thank you, "windres.exe for GNU targets (included in the mingw-w64 toolchain)" |
05:39:39 | * | kungtotte quit (Read error: Connection reset by peer) |
05:40:12 | skrylar[m] | finally finished that ecs video araq posted |
05:41:32 | * | kungtotte joined #nim |
05:45:12 | * | martinium joined #nim |
05:45:59 | martinium | how can I ignore this error? Error: unhandled exception: Invalid argument |
05:45:59 | martinium | Additional info: "System error" [OSError] |
05:46:17 | martinium | I tried using discard to ignore any errors and it still quits |
05:47:06 | skrylar[m] | discard ignores return values not exceptions/errors. and araq doesn't want errors catch-ignorable either |
05:47:25 | skrylar[m] | so you get around it by not putting invalid parameters in os calls :F |
05:49:07 | martinium | what's funny is I am not making any OS calls |
05:49:27 | martinium | I have a seq with futures that need to process |
05:49:46 | martinium | and it errors out after processing like 15k of them |
05:52:25 | leorize | you probably found a bug or so |
05:52:49 | leorize | what are you doing? |
05:55:59 | martinium | https://gist.github.com/martinium/81737bb1cde23ba6ede5af504dd45d8a |
05:56:52 | martinium | do I need to poll the futures seq? |
05:57:44 | martinium | line 100 is where it fails with OS error |
06:01:15 | skrylar[m] | hum. its not trying to open too many handles at once is it |
06:01:41 | martinium | it does as many as it can |
06:01:54 | martinium | wonder if OS has a limit |
06:02:56 | leorize | windows does |
06:03:02 | * | ryan__ joined #nim |
06:03:15 | martinium | I am on linux |
06:03:54 | leorize | try this: do a 10-20 ms poll() after you add a future |
06:04:24 | martinium | so poll(10)? after futs.add |
06:04:30 | martinium | let me try |
06:05:02 | leorize | ahh I didn't read your error correctly |
06:05:04 | leorize | EINVAL |
06:05:07 | skrylar[m] | linux also has file handle limits; but also the network stacks can only do so much in a second |
06:05:18 | leorize | do you have a stack trace? |
06:05:37 | * | ryan_ quit (Ping timeout: 258 seconds) |
06:06:14 | leorize | you can raise the handle limit to infinite |
06:06:25 | leorize | and from that error message it might not be due to the handle limit |
06:07:20 | skrylar[m] | sure but that doesn't mean the stack can handle more requests |
06:07:40 | leorize | the stack? |
06:07:41 | skrylar[m] | if you try to pelt an http server running on localhost with thousands of requests per second it still drops half of them |
06:08:05 | leorize | usually it drops because deadlines couldn't be met, no? |
06:08:32 | skrylar[m] | i dunno. i ran some of those stress testers on a simple static server and those were my results |
06:09:13 | skrylar[m] | its worth seeing if the error still happens when only ex. five requests are queued |
06:10:02 | martinium | this is querying a prod API |
06:10:06 | martinium | on the web |
06:10:25 | martinium | so adding a poll did help get some of the assets processing to next callback function |
06:10:37 | * | ryan__ is now known as donkey_duo |
06:10:38 | martinium | but eventually once it gets to asset 59084 fails |
06:10:43 | martinium | every time |
06:10:50 | martinium | with the invalid argument |
06:11:03 | skrylar[m] | blacklist the asset? |
06:11:19 | leorize | do you have the stack trace? |
06:11:30 | leorize | without it I can't pin point where the error came from |
06:11:47 | martinium | am a noob how do I get a stacktrace |
06:11:51 | martinium | run the program with strace? |
06:11:57 | skrylar[m] | it should say it in the console when it dies |
06:11:59 | leorize | no, just run the program |
06:12:07 | leorize | compile it with --stacktraces:on |
06:12:29 | martinium | i assume needs to be non release build |
06:12:44 | leorize | that works too |
06:12:51 | leorize | --opt:speed can be added to make it a bit faster |
06:13:19 | skrylar[m] | admittedly i have had this problem, but i still have never used async. i solved it (when i was trying to do the neural tts in nim w/ arraymancer) by putting all the requests in beanstalk, and then workers just asked for jobs there. i had occasional crashes running WORLD on stuff and never figured out why, but with an external task queue it can just die sometimes and it will pick the jobs back up :shrug: a very erlang way of |
06:13:20 | skrylar[m] | doing tings |
06:13:56 | martinium | rerunning with stacktrace |
06:14:06 | martinium | compile flag was --stacktrace:on |
06:15:39 | skrylar[m] | kinda wanted to experiment with gearman a time or two, but it seemed to be more of a pain than beanstalking things |
06:16:52 | martinium | leorize, stacktrace: https://gist.github.com/martinium/db980cc391e1bba1a95c0ade4158f720 |
06:17:49 | * | solitudesf joined #nim |
06:18:31 | leorize | there aren any line numbers, that's weird |
06:18:51 | martinium | bah I left release mode on |
06:18:56 | martinium | let me re-run in debug |
06:21:34 | * | skrylar[m] winces for your api call credits |
06:22:44 | leorize | do you think you can share the asynchttpclient? |
06:22:51 | leorize | you're making a new one for every request |
06:24:59 | martinium | updated gist |
06:25:00 | skrylar[m] | wouldn't that keep resetting the client |
06:25:23 | martinium | httpclient is the req proc in the gist I shared prior to the stacktrace |
06:25:35 | martinium | I close the connection after each request |
06:26:09 | martinium | https://gist.github.com/martinium/81737bb1cde23ba6ede5af504dd45d8a |
06:26:26 | martinium | line 27 |
06:28:41 | martinium | my understanding is that every request creates a new client so I purposefully close each to avoid a too many connections error |
06:29:38 | leorize | since you request from the same host |
06:29:52 | leorize | you can just share the connection |
06:30:25 | martinium | do I need to specify anything for that to happen? |
06:30:48 | leorize | make the httpclient global, then create once, request many :P |
06:30:58 | Araq | https://techxplore.com/news/2020-04-zero-day-exploit-sophos-firewall-xg.html yay an SQL injection in 2020 |
06:31:20 | martinium | Araq, company I work for got hit by that in one of our brands |
06:31:30 | leorize | your problem with that approach would be the headers afaict |
06:31:40 | martinium | many IT deps make dumb config errors |
06:32:33 | skrylar[m] | its pretty embarassing when you consider most of these database systems accept separately packaged parameters :| |
06:32:37 | martinium | if I create the client globally each new request will reuse the existing connection? |
06:32:45 | leorize | yea |
06:32:53 | martinium | let me attempt that 1 sec |
06:33:05 | skrylar[m] | but http/1.1 does not work this way leorize: |
06:33:23 | leorize | yes, pipelining is a thing in http 1.1 |
06:34:04 | skrylar[m] | i think http2 does let you just open a huge flurry of requests all at once |
06:34:58 | martinium | got this error |
06:34:59 | martinium | Error: unhandled exception: invalid http version, `{` [ProtocolError] |
06:35:25 | martinium | doesn't even get passed first function with a global client |
06:35:44 | leorize | skrylar[m]: http2 let you request and receive in parallel |
06:35:58 | leorize | martinium: well guess we're back to your old way |
06:36:05 | leorize | probably that server don't support pipelining |
06:36:09 | leorize | or http 1.1 |
06:36:50 | leorize | martinium: can you try putting the close in `req` in a `defer`? |
06:37:29 | martinium | let me try |
06:38:01 | leorize | also maybe do a bit of refactoring |
06:38:08 | leorize | instead of getContent, use get |
06:38:25 | leorize | then inspect the http result code before attempting to parse it |
06:38:34 | leorize | should speed it up a bit if the request came back bad |
06:41:15 | martinium | for some reason changing to .get vs getContent is giving me an error |
06:41:31 | leorize | yep, they return different thing |
06:42:08 | leorize | get returns a Future[AsyncResponse] |
06:42:43 | FromGitter | <bung87> can I get benefit doing transform RGBA to BGRA through using `laser` |
06:43:15 | martinium | how can I parse that with parseJson then |
06:43:26 | martinium | do I need to convert it to a string? |
06:43:29 | leorize | check resp.code first |
06:43:32 | martinium | or await it |
06:43:40 | leorize | yea, await, then check resp.code |
06:44:25 | leorize | if it's clear (ie. Http200), then you can go fetch the entire body and parse it |
06:44:38 | leorize | `await resp.body` should work here |
06:44:48 | leorize | pass that to parsejson |
06:47:38 | * | PMunch joined #nim |
06:48:58 | leorize | also maybe don't do flushFile() a lot |
06:49:02 | leorize | that's slow as hell |
06:49:32 | martinium | is that even needed to write to a file? |
06:49:47 | leorize | no |
06:49:59 | martinium | usually its only needed if buffer is going to have tons of content loaded to memory |
06:50:01 | leorize | it's only needed if you want it to be written immediately |
06:50:47 | martinium | I'll do flushFile() only when for loop completes |
06:51:11 | leorize | this might not be a good time to tell you that asyncfile exists :P |
06:52:40 | leorize | well but your problem is weird |
06:53:06 | leorize | the only time I can think of that you can get an EINVAL from read is if the FD is closed or smt |
06:53:24 | leorize | but then if it's closed it wouldn't be EINVAL |
06:54:19 | leorize | ahhhhhhhhh |
06:54:28 | leorize | I read the stacktrace wrong |
06:54:42 | martinium | lol |
06:54:48 | martinium | it happens |
06:55:41 | leorize | it died doing DNS |
06:56:22 | martinium | lol how |
06:56:37 | martinium | do I need to make the poll longer? |
06:58:11 | martinium | getAddrInfo then RaiseOSError comes right after that |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:26 | leorize | you might have to |
07:00:35 | leorize | you managed to overload your system with dns requests :P |
07:00:40 | martinium | let me try 50 |
07:01:09 | martinium | wonder if that is a due to a linux setting |
07:01:33 | leorize | the error you got happens within glibc, so I can't dig deeper than that |
07:02:09 | leorize | if your server is capable of pipelining this would have been much easier :P |
07:02:41 | martinium | was trying to read this |
07:02:42 | martinium | https://linux.die.net/man/3/getaddrinfo_a |
07:03:10 | leorize | asyncdispatch wasn't built to use it, as it's a linux-only thing |
07:03:18 | leorize | most OS don't have native primitives for async dns |
07:04:06 | martinium | so only way to get around this is my slowing down amount of requests I make by increasing poll rate yeah? |
07:04:36 | * | gmpreussner joined #nim |
07:04:42 | martinium | no wonder I couldn't discard the error |
07:04:58 | martinium | my OS was like "no bitch there is no more left in me" |
07:05:27 | leorize | yea, ideally you wouldn't have to deal with all this if your server supported pipelining |
07:06:03 | leorize | actually, can I see the code you refactored to 1 client? |
07:07:32 | martinium | all I did was move the client = newAsyncHttpClient() to global level |
07:07:50 | leorize | you should move the header setting there to |
07:07:53 | leorize | too* |
07:07:55 | martinium | yeah it is there |
07:08:09 | leorize | I think I might know why it didn't work |
07:08:31 | leorize | change await() into waitFor() for `resp` (NOT resp.body) |
07:08:39 | leorize | see if it works then |
07:09:39 | martinium | before that |
07:09:45 | martinium | program successfully completed |
07:09:51 | martinium | using poll of 100 |
07:10:07 | martinium | actually |
07:10:09 | martinium | cancel |
07:10:09 | leorize | I guess you really choked the dns :P |
07:10:13 | martinium | I added a discard for error |
07:10:21 | martinium | let me disable that |
07:10:24 | leorize | lol |
07:12:41 | martinium | wonder if it's the DNS on my router |
07:12:51 | martinium | that in turn chokes my systems DNS |
07:14:29 | leorize | well, still not a good practice to query dns a thousand time :P |
07:15:31 | martinium | waitFor is so slowwwwww |
07:15:54 | leorize | to be fair, pipelining will likely slow this down by a ton |
07:17:33 | leorize | yea, httpclient is not designed to balance load in pipelining situations |
07:20:15 | leorize | I guess your best bet right now is to throttle your requests |
07:20:37 | leorize | poll(100) seem to work for you |
07:23:07 | martinium | will try poll300 next |
07:23:08 | martinium | lol |
07:28:41 | martinium | no dice |
07:28:50 | martinium | this is frustrating |
07:30:19 | FromGitter | <alehander92> morning |
07:32:24 | martinium | morning |
07:32:37 | martinium | poll at 2000 gives me Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError] |
07:40:53 | martinium | did some further digging |
07:41:23 | martinium | using func and looking up the specific asset ids causing problems I get a key not found error when querying the api |
07:41:31 | martinium | those ids get input into URL |
07:41:55 | martinium | so not that my DNS was overloaded it was just that those keys couldn't be resolved |
07:42:32 | martinium | leorize, how can I either ignore or go to next iterable once that error happens? |
07:47:48 | martinium | I am going to pop those out of seq before looping through |
07:48:04 | martinium | but I need a way to ignore the error |
07:52:03 | * | letto quit (Quit: Konversation terminated!) |
07:53:55 | * | letto joined #nim |
07:57:13 | PMunch | martinium, you can wrap it in a try/expect block? |
07:57:29 | martinium | that fails also |
07:57:38 | martinium | tried discarding the error to no avail |
07:57:51 | PMunch | Uhm, then it isn't raised where you expect |
07:58:06 | martinium | it fails at web request |
07:58:16 | martinium | getaddrinfo function in libc |
07:58:31 | PMunch | Yeah, but try/except should still catch a ValueError.. |
07:58:43 | martinium | it comes up as an OSError |
07:58:56 | PMunch | Then it's not the error you showed above |
07:58:58 | martinium | valueerror from before was just some testing |
07:59:03 | PMunch | Ah |
07:59:21 | PMunch | OSError is still catchable though.. |
07:59:29 | martinium | how can I obtain the index position of two values in a seq? |
07:59:36 | martinium | how would you catch an OSError |
07:59:46 | martinium | this error holds up my processing when it doesn't need to |
07:59:49 | PMunch | With a try/expect statement |
07:59:56 | martinium | I would just pass the error in python using try/expect |
08:00:07 | PMunch | Yeah, you can do the same thing in Nim |
08:00:27 | martinium | try: do soemthing except: discard? |
08:00:41 | PMunch | Yup |
08:00:56 | martinium | or for except do I need to do except OSError: discard |
08:01:00 | leorize | isn't Future[T] have .failed to check for errors? |
08:01:04 | martinium | I've tried the before and it has not worked |
08:01:19 | PMunch | You can use: https://nim-lang.org/docs/system.html#find%2CT%2CS to get the index of an element in a seq |
08:01:32 | PMunch | But keep it mind that it loops through until it finds it, so it can be slow |
08:01:39 | PMunch | martinium, then you were probably doing it wrong :P |
08:01:43 | PMunch | Because that should work |
08:02:46 | leorize | martinium: https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/asyncfutures.nim#L462 |
08:03:05 | leorize | copy the implementation and tweak it so that it handle errors the way you want it to |
08:07:54 | * | Trustable joined #nim |
08:08:43 | PMunch | martinium, as you can see OSError can be caught just fine: https://play.nim-lang.org/#ix=2k8d |
08:09:29 | narimiran | leorize: do you maybe know if there's some switch to prevent github actions to auto-cancel if some other action has failed? |
08:09:43 | narimiran | there was 'fast finish' or something like that on travis, IIRC |
08:09:44 | PMunch | Any reason why this hasn't been added yet? https://github.com/nim-lang/packages/pull/1444 |
08:09:45 | disbot | ➥ Add ansiparse and ansitohtml packages |
08:10:01 | narimiran | PMunch: i missed it. merging now |
08:10:08 | PMunch | Sweet, thanks |
08:10:10 | leorize | narimiran: see ssl ci |
08:10:34 | leorize | iirc its called fail-fast |
08:10:44 | narimiran | leorize: ah, too easy :) thanks |
08:10:47 | PMunch | IIRC it was breaking one of the important packages that had added it as a dependency with a direct link to the repo |
08:15:51 | narimiran | PMunch: in the future, if it some package isn't merged in 2 days since PR creation, just ping me ;) |
08:16:02 | PMunch | Will do :) |
08:36:47 | * | abm joined #nim |
08:38:37 | * | liblq-dev joined #nim |
08:44:34 | * | couven92 joined #nim |
08:49:25 | * | solitudesf- joined #nim |
08:51:50 | * | solitudesf quit (Ping timeout: 260 seconds) |
08:52:12 | * | solitudesf- is now known as solitudesf |
08:56:24 | * | khanate[m]0 quit (Quit: killed) |
08:56:24 | * | watzon quit (Quit: killed) |
08:56:25 | * | GitterIntegratio quit (Quit: killed) |
08:56:25 | * | codic quit (Quit: killed) |
08:56:25 | * | Demos[m] quit (Quit: killed) |
08:56:27 | * | planetis[m] quit (Quit: killed) |
08:56:28 | * | tml[m] quit (Quit: killed) |
08:56:28 | * | BitPuffin quit (Quit: killed) |
08:56:30 | * | vycb[m] quit (Quit: killed) |
08:56:30 | * | Cadey quit (Quit: killed) |
08:56:33 | * | sirikon quit (Quit: killed) |
08:56:37 | * | nerdrat[m] quit (Quit: killed) |
08:56:39 | * | k0mpjut0r quit (Quit: killed) |
08:56:40 | * | lqdev[m] quit (Quit: killed) |
08:56:43 | * | skrylar[m] quit (Quit: killed) |
08:56:43 | * | salotz[m] quit (Quit: killed) |
08:56:54 | * | reversem3 quit (Quit: killed) |
08:56:57 | * | wiltzutm[m] quit (Quit: killed) |
08:56:57 | * | chance[m] quit (Quit: killed) |
08:56:57 | * | unclechu quit (Quit: killed) |
08:56:59 | * | dzamo[m] quit (Quit: killed) |
08:57:01 | * | polypoid[m] quit (Quit: killed) |
08:57:01 | * | yassen[m] quit (Quit: killed) |
09:00:22 | * | Trustable quit (Ping timeout: 246 seconds) |
09:02:50 | FromGitter | <wltsmrz> I have a case where a struct that's imported from C expects a __prefixed field |
09:03:05 | FromGitter | <wltsmrz> How to get around that? |
09:04:24 | FromGitter | <alehander92> cant you use `__prefixed` ? |
09:04:37 | FromGitter | <alehander92> like with "`" around |
09:05:57 | FromGitter | <wltsmrz> Negative.. but actually, the only reason it was breaking is because I was passing it to debugEcho.. as long as I don't care to access the __pad field from a Stat I'm ok to use fstat it seems, so scratch that! |
09:06:18 | PMunch | You can declare a different name for fields by using something like `prefixed {.importc: "__prefixed".}: int` in your definition |
09:06:45 | FromGitter | <wltsmrz> Oh, that's sort of what I was wondering. Noted |
09:07:05 | FromGitter | <alehander92> ah nice so you can do it with fields |
09:07:17 | FromGitter | <alehander92> PMunch are you going to participate in the conf! |
09:07:29 | PMunch | For sure! |
09:07:32 | PMunch | When was it again? |
09:07:56 | * | hoijui joined #nim |
09:08:27 | FromGitter | <alehander92> https://docs.google.com/forms/d/e/1FAIpQLSeLeVBRETQW-iHiegW7xs52AKYH0g3xoxM7xPdtgTjPBs9Txg/viewform |
09:08:53 | PMunch | Oh cool |
09:09:04 | PMunch | A bit more organised than the forum thread approach :P |
09:09:32 | * | skrylar[m] joined #nim |
09:09:32 | skrylar[m] | oh. reminds me i have prs to merge too tomorrow ._. |
09:11:11 | FromGitter | <alehander92> 6 june saturday . |
09:11:13 | FromGitter | <alehander92> oh yeah |
09:11:35 | FromGitter | <alehander92> just asking again narimiran: its ok to submit 2 proposals, right? |
09:11:50 | FromGitter | <alehander92> (i might submit 0 or 1, just wanting to know if i should just think of 1 thing) |
09:12:50 | * | Demos[m] joined #nim |
09:13:43 | narimiran | yeah, of course |
09:14:01 | PMunch | These are a bit worrying: https://forum.nim-lang.org/t/6253 |
09:14:23 | PMunch | I mean, yes you can optimise these things. But for a newcomer it might be a bit off putting |
09:18:24 | * | Trustable joined #nim |
09:19:30 | Araq | PMunch: completely agree but it's IO and I cannot optimize IO |
09:19:48 | Araq | for some reason I never get reproducible results that are meaningful for other machines |
09:20:09 | Araq | since it comes up regularly there must be something we're doing very wrong though :-) |
09:20:15 | narimiran | disruptek: you here? |
09:20:27 | * | Vladar joined #nim |
09:23:32 | * | ryan_ joined #nim |
09:25:16 | FromGitter | <alehander92> one thing i wonder Araq is |
09:25:54 | * | donkey_duo quit (Ping timeout: 240 seconds) |
09:25:57 | * | ryan_ is now known as donger |
09:26:42 | FromGitter | <alehander92> e.g. in this case, a very smart optimizer *can* guess that split(..)[4] is the same as ln[ln.findNth('\t', 3) .. ^1] |
09:27:40 | FromGitter | <alehander92> or one can define that chain (something like the term rewriting things maybe) |
09:27:46 | FromGitter | <alehander92> do people do that kind of optimization anywhere |
09:28:20 | FromGitter | <alehander92> like, optimizing combinations of high level data structure calls into more optimal ones |
09:29:27 | PMunch | I think functional languages tend to do that |
09:29:40 | FromGitter | <alehander92> e.g. i can write in my lib `echo a[n .. m] -> echoSlice a, n, m # no allocation` |
09:30:42 | PMunch | Hmm, I need to find something to talk about for NimConf.. |
09:30:50 | FromGitter | <alehander92> or `split(a: string, c: char)[i: index] -> a[a.findNth(i - 1, c) .. ^1]` |
09:30:57 | FromGitter | <alehander92> (pseudo) |
09:32:00 | narimiran | PMunch: reddit post turned into an article turned into a conference talk :D |
09:32:26 | narimiran | PMunch: and a second one is: HN comment turned ..... :D |
09:32:31 | FromGitter | <alehander92> PMunch yeah, but i am not sure one can do that with just slices/iterators |
09:32:39 | FromGitter | <alehander92> as you would still generate the 0, 1, 2 string in split |
09:33:20 | PMunch | Haha narimiran then I can post the talk to HN/Reddit |
09:33:21 | narimiran | and then you put a link to a video of a talk of a thread turned into an article to your blog |
09:33:37 | PMunch | And next year have the cycle one step longer |
09:34:13 | PMunch | alehander92, it would require split to be lazy |
09:34:18 | FromGitter | <alehander92> so basically this way you can "teach" your rewriting pass how to optimize random code |
09:34:23 | FromGitter | <alehander92> that people would write |
09:34:29 | FromGitter | <alehander92> PMunch but this is not enough i think |
09:34:51 | FromGitter | <alehander92> because i want not only split to be lazy, but for it to detect it shouldn't split the first 3 tokens at all |
09:35:24 | PMunch | So split wouldn't return a seq[] but an object with the arguments and access to that object would trigger it to forward the iterator and cache things |
09:35:43 | FromGitter | <alehander92> but even if its an iterator |
09:35:43 | PMunch | It could do that |
09:36:06 | FromGitter | <alehander92> it should somehow accept that `4` |
09:36:24 | FromGitter | <alehander92> which requires knowledfge outside of the callsite |
09:36:40 | FromGitter | <alehander92> direct callsite* |
09:37:00 | PMunch | Basically you would get back an object SplitResult[T][originalSeq: seq[T], splitChar: char] and then on access to [4] it would see that it didn't have anything in the cache and could skip straight to the fourth element |
09:37:30 | PMunch | And then a converter that made it collapse down to a seq if needed |
09:37:58 | FromGitter | <alehander92> ah, interesting |
09:38:21 | FromGitter | <alehander92> doable, but the rewriting thing seems simpler to me :D |
09:38:38 | PMunch | Well that requires teaching the compiler when it can rewrite stuff |
09:38:41 | FromGitter | <alehander92> because you dont change anything, but just add a simple rule |
09:38:44 | PMunch | I've used my approach in libraries before |
09:38:56 | FromGitter | <alehander92> but you dont need to teach the compiler, if there is a general rewriting pass |
09:39:14 | FromGitter | <alehander92> like, you do, but its a general language system, like type annotations |
09:39:43 | Araq | alehander92: Nim's TR macros were designed for this but we don't use them |
09:40:07 | Araq | the current implementation is too slow and they have a design flaw I'd like to fix |
09:40:33 | Araq | but yeah, other compilers also do this for stdlib routines |
09:40:45 | Araq | GCC does it since forever for loops that use 'strlen' |
09:40:59 | Araq | (O(n²) turned into O(n)) |
09:41:28 | Araq | JavaScript engines are also known to do these things |
09:45:23 | Araq | it's pretty standard these days and it's also a lesson for why compilers become complex. the compiler is written by few and used by many people. users benefit from what's done inside the compiler. |
09:45:36 | FromGitter | <Hammer2900> hey, help me please, how can i get last index in seq or array , i have this error (Error: unhandled exception: index -1 not in 0 .. 4 [IndexError]) |
09:45:42 | narimiran | ^1 |
09:46:08 | FromGitter | <Hammer2900> thank you !!!!! |
09:50:36 | FromGitter | <alehander92> Araq yeah i thought its not very useful, but i now realized it seems good for this kind of stuff |
09:55:41 | * | reversem3 joined #nim |
09:55:41 | * | salotz[m] joined #nim |
09:55:41 | * | unclechu joined #nim |
09:55:41 | * | lqdev[m] joined #nim |
09:55:41 | * | dzamo[m] joined #nim |
09:55:41 | * | watzon joined #nim |
09:55:42 | * | codic joined #nim |
09:55:42 | * | BitPuffin joined #nim |
09:55:42 | * | k0mpjut0r joined #nim |
09:55:42 | * | Guest4337 joined #nim |
09:55:42 | * | tml[m] joined #nim |
09:55:42 | * | khanate[m]0 joined #nim |
09:55:42 | * | nerdrat[m] joined #nim |
09:55:42 | * | GitterIntegratio joined #nim |
09:55:47 | * | vycb[m] joined #nim |
09:55:48 | * | yassen[m] joined #nim |
09:55:48 | * | wiltzutm[m] joined #nim |
09:55:48 | * | polypoid[m] joined #nim |
09:55:48 | * | planetis[m] joined #nim |
09:55:49 | * | sirikon joined #nim |
10:02:17 | FromGitter | <alehander92> it makes sense for compilers to be complex overally |
10:03:34 | FromGitter | <alehander92> but maybe this can be done easily: like overally loadDataStructure(..)[index] in general makes sense to optimize out unneeded elements of the call so one can just call a loadWithIndex overload for that |
10:03:39 | FromGitter | <alehander92> but thats just an edge case |
10:04:19 | * | lritter joined #nim |
10:15:51 | Araq | lol, how is that easy to do inside a compiler? you need to understand 'loadDataStructure' completely and then rewrite its inner workings |
10:17:11 | Araq | das ist so wie wenn man durch die Wüste läuft und auf einmal sagt, "so, ich springe jetzt in diesen Teich und erfrische mich" |
10:17:33 | Araq | sorry, too lazy to translate it into English |
10:22:53 | * | dddddd joined #nim |
10:25:51 | FromDiscord | <Recruit_main707> being seen and inp a seq, could i extract the index in which inp[i] is in seem? |
10:25:51 | FromDiscord | <Recruit_main707> ```if inp[i] in seen: |
10:25:52 | FromDiscord | <Recruit_main707> twice.add i |
10:25:52 | FromDiscord | <Recruit_main707> twice.add seen_index``` |
10:28:26 | narimiran | i'm not sure i understand the question, but if you need both a position in a seq and the element there, use: `for i, x in mySeq` |
10:29:42 | * | hoijui quit (Quit: Leaving) |
10:30:19 | narimiran | or maybe you're looking for `find` proc? https://nim-lang.github.io/Nim/system.html#find%2CT%2CS |
10:32:39 | FromGitter | <alehander92> Araq this was a bit over my deutsch-learning head |
10:32:46 | FromGitter | <alehander92> but i google translated it |
10:33:01 | FromGitter | <alehander92> but no i didnt want that |
10:33:46 | FromGitter | <alehander92> my idea was that when the compiler sees `call()[]` it can look for `callIndex(args, index)` and replace it if it exists |
10:34:02 | FromGitter | <alehander92> which is very simple |
10:34:12 | FromGitter | <alehander92> but its not good language design, so nevermind |
10:34:30 | FromGitter | <alehander92> a general mechanism like rewriting seems better indeed |
10:44:30 | * | krux02 joined #nim |
10:52:35 | FromDiscord | <Recruit_main707> for i, x in inp: this is index and value in that order? |
11:00:35 | FromGitter | <alehander92> yes |
11:14:34 | * | dadada quit (Ping timeout: 260 seconds) |
11:15:41 | * | dadada joined #nim |
11:16:05 | * | dadada is now known as Guest99433 |
11:18:45 | FromDiscord | <clyybber> Araq: Are there now other reasons why a parameter can't be turned into sink? https://github.com/nim-lang/Nim/pull/14163/files#diff-061ade0026ed465dedf6806687820f3aL51-R51 |
11:18:45 | disbot | ➥ fixes #14079 [backport:1.2] |
11:24:31 | * | xcm quit (Remote host closed the connection) |
11:28:03 | * | xcm joined #nim |
11:29:47 | PMunch | Hmm, anyone know what might cause this? http://ix.io/2k9h |
11:29:55 | PMunch | Brb, rebooting |
11:29:55 | * | PMunch quit (Quit: leaving) |
11:33:23 | * | solitudesf- joined #nim |
11:35:46 | * | solitudesf quit (Ping timeout: 246 seconds) |
11:38:41 | FromGitter | <bung87> does `laser` has api like this ? `tf.reverse(img, axis=[-1])` |
11:42:08 | * | a_b_m joined #nim |
11:43:15 | * | abm quit (Ping timeout: 240 seconds) |
11:48:43 | FromGitter | <bung87> found `arraymancer ` more close to this |
11:48:45 | FromGitter | <Vindaar> @bung87 I assume you mean `arraymancer`? At the moment there's no `reverse`. I was thinking about adding it earlier today, since I just added `sort`. |
11:48:47 | FromGitter | <Vindaar> ah |
11:53:17 | FromGitter | <bung87> yeah, that's easy understood proc and less code, I'd like to use it |
12:02:22 | FromDiscord | <mratsim> `laser` is more of a research repo |
12:02:40 | FromDiscord | <mratsim> I didn't put it on nimble personally |
12:02:51 | FromDiscord | <mratsim> not sure how people are even using it |
12:05:53 | FromGitter | <bung87> just found it like numpy in python |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:44 | * | supakeen joined #nim |
12:10:59 | * | D_ quit (Ping timeout: 252 seconds) |
12:14:08 | * | D_ joined #nim |
12:14:41 | * | PMunch joined #nim |
12:21:26 | * | PMunch quit (Quit: Leaving) |
12:21:49 | * | PMunch joined #nim |
12:22:32 | PMunch | Sweet, got my new graphics card up and running :) |
12:28:48 | * | lritter quit (Quit: Leaving) |
12:29:52 | * | lritter joined #nim |
12:29:53 | * | oculuxe quit (Quit: blah) |
12:31:40 | * | oculux joined #nim |
12:33:52 | * | sagax quit (Read error: Connection reset by peer) |
12:35:15 | * | crem quit (Ping timeout: 240 seconds) |
12:36:19 | * | crem joined #nim |
12:40:24 | Araq | clyybber: probably but this was simple |
12:40:42 | Araq | oh |
12:41:46 | Araq | if you use .nosinks explicitly, the error message was off |
12:44:51 | * | martinium_ joined #nim |
12:46:58 | * | martinium quit (Ping timeout: 260 seconds) |
12:51:31 | FromDiscord | <clyybber> Ah |
12:51:33 | FromDiscord | <clyybber> I see |
12:57:42 | FromDiscord | <Recruit_main707> has someone made a rust like impl macro? |
12:58:32 | FromDiscord | <Recruit_main707> its pretty much the class macro, but out of curiosity |
12:58:35 | Araq | yeah but it's old stuff |
12:58:42 | Araq | so it probably doesn't compile anymore |
12:58:44 | krux02 | what is an impl macro? |
12:59:06 | FromDiscord | <Recruit_main707> i mean, the rust impl thing, implemented in nim as a macro |
12:59:17 | FromDiscord | <Rika> rust implements trait? |
12:59:20 | FromDiscord | <Rika> that thing? |
12:59:56 | krux02 | I remember the impl thing. As far as I can tell it is not needed in Nim. |
13:00:33 | FromDiscord | <Recruit_main707> well, sure, but this are all hypothetical things i think of |
13:00:33 | * | lritter_ joined #nim |
13:00:37 | FromGitter | <alehander92> but isnt it an annotation? |
13:00:39 | FromGitter | <alehander92> like |
13:00:47 | FromGitter | <alehander92> it just says you implement this trait with this code |
13:00:51 | krux02 | In Nim you just have generic functions, no need to tag anyithng with impl. |
13:00:54 | FromGitter | <alehander92> what does it give you |
13:01:02 | * | lritter quit (Ping timeout: 260 seconds) |
13:01:11 | FromDiscord | <Recruit_main707> Araq: id like to see it anyway, do you know where can i find it? |
13:01:20 | krux02 | the impl thing in rust is a restriction |
13:01:28 | FromDiscord | <Rika> so basically Concepts |
13:01:45 | krux02 | no it is not concepts |
13:01:57 | FromDiscord | <Rika> ? how so? |
13:02:13 | FromGitter | <alehander92> sorry no idea of rust |
13:02:17 | FromGitter | <alehander92> i'd like to hear also |
13:02:32 | FromDiscord | <Recruit_main707> https://github.com/ViliamVadocz/Autoplay/blob/master/struggle/src/bot.rs |
13:02:32 | FromDiscord | <Recruit_main707> looking at this, impl looks more of a class like thing |
13:02:33 | krux02 | it is generic function, but with the restriction that the generic function can only be called, if it is explicitly whitelisted in the `impl` section of the type |
13:03:04 | krux02 | Nim does not have such a restriction. |
13:03:39 | krux02 | you can but a restriction on types in the generic function, but you can.t put the restriction on the type. A generic will always work, if it compiles. |
13:04:14 | FromGitter | <alehander92> <3 |
13:04:34 | FromGitter | <alehander92> makes sense |
13:05:03 | krux02 | s/can but/can put/ |
13:06:11 | krux02 | these restrictions are also part of the rust security/safety functionality. |
13:06:18 | Araq | Recruit_main707: I don't have the code |
13:06:26 | FromDiscord | <Recruit_main707> i think i found it |
13:06:40 | FromGitter | <alehander92> please link it |
13:06:48 | FromDiscord | <Recruit_main707> https://gist.github.com/PhilipWitte/2cba4544530f23631ad1#file-gistfile1-nim-L149 |
13:07:09 | krux02 | oh yea |
13:07:41 | * | qwertfisch_ is now known as qwertfisch |
13:07:44 | krux02 | first line I see already three things that are deprecated/removed or at least discouraged to do |
13:08:17 | FromGitter | <alehander92> this is some old code probably |
13:08:18 | krux02 | node kind based overload resolution. |
13:08:29 | krux02 | still works, but really don't do it. |
13:08:43 | krux02 | expr/stmt doesn't exist anymore. |
13:08:44 | FromGitter | <alehander92> but you can kinda do it with `using` Recruit_main |
13:08:52 | krux02 | today it is `typed` and `untyped` |
13:08:54 | FromGitter | <alehander92> if your goal is just to not write self: Type everywehre |
13:09:20 | krux02 | immediate macros don't make sense |
13:09:36 | FromDiscord | <Recruit_main707> i was just wondering, although it sounds interesting, any examples using `using`? |
13:09:47 | FromGitter | <alehander92> i use it sometimes |
13:09:50 | FromDiscord | <clyybber> Same here |
13:12:09 | FromGitter | <alehander92> but Recruit i'd say its more general |
13:12:20 | FromGitter | <alehander92> as you can apply it for different names and many arguments |
13:13:07 | FromGitter | <alehander92> e.g. ⏎ `using .. <newline> .. <indent>a: MyObj<newline><indent>env: Env etc` |
13:13:34 | FromGitter | <alehander92> `func onA(a, env): Node = .. func onB(a, env): Node = .. ` |
13:14:39 | * | Hideki_ joined #nim |
13:14:56 | FromDiscord | <Recruit_main707> i see, that seems very useful for someone as lazy as me :p |
13:15:17 | FromGitter | <alehander92> i think its useful when you have a module with many procedures with the same signature |
13:15:38 | FromGitter | <alehander92> e.g. implementing visitor pattern or something like handlers |
13:16:52 | * | Hideki_ quit (Remote host closed the connection) |
13:17:06 | * | Hideki_ joined #nim |
13:18:12 | FromGitter | <alehander92> ok, visitor pattern might not be the correct name, sorry |
13:20:54 | * | rockcavera joined #nim |
13:25:32 | * | muffindrake quit (Quit: muffindrake) |
13:26:23 | Araq | visitor pattern is close enough |
13:34:25 | * | ptdel joined #nim |
13:44:11 | * | Guest4337 quit (Changing host) |
13:44:11 | * | Guest4337 joined #nim |
13:44:37 | * | Guest4337 quit (Quit: authenticating) |
13:44:51 | * | Guest4337 joined #nim |
13:46:36 | * | Guest4337 quit (Changing host) |
13:46:36 | * | Guest4337 joined #nim |
13:47:53 | * | Guest4337 is now known as Cadey |
13:49:14 | * | muffindrake joined #nim |
13:52:44 | FromDiscord | <mratsim> For my ML compiler I use generated enums instead of visitors |
13:58:58 | * | Hideki_ quit (Remote host closed the connection) |
14:01:23 | FromDiscord | <Recruit_main707> hold up, ML compiler= |
14:01:24 | FromDiscord | <Recruit_main707> ? |
14:01:49 | FromDiscord | <Recruit_main707> @mratsim |
14:03:23 | FromGitter | <bung87> maybe https://github.com/numforge/laser/tree/master/laser/lux_compiler |
14:06:49 | * | tane joined #nim |
14:08:51 | disruptek | !last zevv |
14:08:51 | disbot | Zevv spoke in 12#nim 32 hours ago |
14:09:05 | FromDiscord | <Recruit_main707> does that ping him? |
14:09:09 | disruptek | hearts and minds, people; HEARTS AND MINDS! |
14:09:25 | * | ftsf quit (Ping timeout: 246 seconds) |
14:09:27 | disruptek | i know he hates to miss my morning mantra. |
14:11:38 | * | ftsf joined #nim |
14:17:25 | FromGitter | <sealmove> I have a general (possibly very ambigious) question. How easy or common is it to implement typical design patterns (say factory) in Nim, since it doesn't have standard object-oriented programming facilities? |
14:17:25 | * | Trustable quit (Ping timeout: 240 seconds) |
14:17:53 | disruptek | every newObjectType() proc you see is such an animal. |
14:18:43 | * | Guest99433 is now known as dadada |
14:21:01 | FromGitter | <sealmove> Ok, for factory you make newObjectType() methods I guess. But in general, I'd like to see common design patterns implementations in Nim. Maybe we could make a doc page about it. |
14:21:21 | disruptek | why? |
14:21:38 | disruptek | why not use the idiomatic patterns everyone writes in nim, which work so well with the rest of the language? |
14:22:53 | FromGitter | <sealmove> But that was exactly my question. For example what you would use instead of X design pattern. |
14:24:02 | disruptek | i think you're going to have to put value to your X variable. |
14:24:08 | FromGitter | <sealmove> Design patterns are like common language, many people know them and can understand code that uses it fast. If in Nim you do it in an other way, knowing how a pattern maps to Nim could be useful. |
14:24:28 | disruptek | help me help you. tell me what the fuck you're talking about. |
14:24:45 | Araq | disruptek, please be more friendly |
14:24:45 | disruptek | this language is not common enough, i guess. |
14:25:15 | FromDiscord | <Recruit_main707> disruptek, u good? |
14:25:39 | disruptek | of course. |
14:25:55 | disruptek | not all of us have the benefit of a secondary education. |
14:26:01 | FromDiscord | <Recruit_main707> lmao |
14:26:46 | Araq | yet everybody can show good manners, independently of education |
14:27:17 | * | mono joined #nim |
14:27:28 | FromDiscord | <Recruit_main707> sealmove: i also feel like that sometimes |
14:27:28 | disruptek | i didn't mean to be rude. just wanted to add some emphasis. |
14:27:48 | disruptek | i'm sorry, sealmove. i'm really trying to help. |
14:27:58 | FromGitter | <sealmove> disruptek: I can take it, I am not offended. But still other people see the chat and might not like the tone. |
14:28:44 | disruptek | well, araq knows a lot of buzzwords. |
14:29:22 | FromGitter | <sealmove> 🤔 |
14:29:49 | Araq | a factory is a proc newFoo(): Foo, yes |
14:30:08 | Araq | you're free to return a subtype from inside 'newFoo' |
14:30:50 | Araq | the "factory pattern" is a workaround for overly specialized syntax like 'new T' |
14:31:20 | Araq | the "visitor pattern" is a workaround for a case/pattern matching construct with exhaustiveness checks |
14:31:37 | Araq | *for a missing construct |
14:31:40 | Zevv | disruptek: zup? |
14:32:49 | Araq | a "facade" is a wrapper proc |
14:33:01 | Araq | a "singleton" is a global/thread local variable |
14:33:28 | Zevv | aw don't spoil it now araq |
14:33:34 | Zevv | you're taking out all the fun |
14:33:51 | FromGitter | <bung87> https://github.com/nim-lang/RFCs/issues/27 what's current progress? about endians |
14:33:52 | disbot | ➥ [RFC] Option for endianness in streams |
14:34:08 | Zevv | please rationalize SFINAE for me, while you're at it araq |
14:35:47 | FromGitter | <sealmove> Araq thanks for the info |
14:36:36 | FromGitter | <alehander92> disruptek btw what did annoy you about the await template |
14:37:46 | FromDiscord | <Trem.> 4yhuiq2w |
14:38:12 | Araq | bung87: use the external Nimble package for it |
14:39:01 | Araq | Zevv, SFINAE can be used to pattern match against types in C++ but it was introduced for other reasons that I can't recall |
14:42:56 | disruptek | alehander92: only that UFCS broke. |
14:43:08 | disruptek | it's fine, imo. |
14:43:32 | FromGitter | <alehander92> oh sorry |
14:43:37 | FromGitter | <alehander92> can you give an example |
14:43:55 | FromGitter | <alehander92> did it work before ? e.g. `a.await` |
14:43:56 | disruptek | no, i think the change is a good one. |
14:44:04 | disruptek | await foo "bar" |
14:44:11 | FromGitter | <alehander92> ahh |
14:44:19 | FromGitter | <bung87> @Araq ok , found struct.nim throught irc logs |
14:44:21 | FromGitter | <alehander92> but now `a.await` might work |
14:44:25 | FromGitter | <alehander92> not sure, havent tried |
14:44:33 | FromGitter | <alehander92> which i am not sure is a good thing |
14:44:38 | FromGitter | <alehander92> but rust fans might like it |
14:44:58 | disruptek | then we had better find a way to break it. |
14:45:21 | FromDiscord | <Rika> lmao |
14:46:58 | FromDiscord | <mratsim> @Recruit_main707 it pings me but I was busy |
14:47:11 | FromDiscord | <mratsim> https://github.com/numforge/laser/tree/master/laser/lux_compiler |
14:47:19 | FromDiscord | <mratsim> and https://github.com/numforge/laser/tree/master/laser/lux_compiler/core |
14:47:23 | FromDiscord | <mratsim> look for the markdown files |
14:47:25 | FromDiscord | <Recruit_main707> no hurry, thanks |
14:48:31 | * | waleee-cl joined #nim |
14:52:33 | * | Trustable joined #nim |
14:58:19 | FromGitter | <kaushalmodi> is the compiler name stored in some internal var in nim? |
14:58:31 | disruptek | the what? |
14:58:34 | FromGitter | <kaushalmodi> instead of doing `when defined(tcc)`, `when defined(gcc)` |
14:58:50 | disruptek | oh, i dunno. |
14:58:52 | FromGitter | <kaushalmodi> I am looking for a way to encode the compiler into the built binary for my debug purpose |
14:58:59 | FromGitter | <kaushalmodi> *encode the compiler name |
14:59:17 | FromGitter | <kaushalmodi> so that when I do `mybin --version`, it also prints the compiler used to build that |
14:59:30 | disruptek | maybe you can use shashli<k's new compilerSettings stuff. |
14:59:33 | FromGitter | <alehander92> you can just write your own thing that does it |
14:59:44 | FromGitter | <alehander92> but do you want this to happen for random binaries |
15:00:01 | FromGitter | <kaushalmodi> @alehander92 for now I will just do ⏎ ⏎ ```when defined (tcc) ⏎ versionStr.add("-tcc")``` [https://gitter.im/nim-lang/Nim?at=5eaae7f1adb0ec5c2bd7e396] |
15:00:08 | FromGitter | <alehander92> yeah something like that |
15:00:11 | FromGitter | <kaushalmodi> but I was wondering if there's a var I can use |
15:00:25 | FromGitter | <kaushalmodi> so that I don't have to have those hardcoded statements |
15:00:27 | FromGitter | <alehander92> you can write a var compiler = loadCCompiler() |
15:00:43 | FromGitter | <alehander92> and do that in loadCCompiler |
15:01:16 | FromGitter | <alehander92> if there is not such a var of course |
15:01:22 | FromGitter | <kaushalmodi> ok, thanks |
15:01:40 | FromGitter | <kaushalmodi> for now, I am experimenting between just gcc and tcc so it's not too bad |
15:01:50 | FromGitter | <kaushalmodi> just so that I know which binary I am running 😆 |
15:02:01 | FromDiscord | <mratsim> const GCCcompatible = defined(clang) or defined(GCC) |
15:02:46 | FromGitter | <kaushalmodi> mratsim: Yes, seems like that's the only way right now: https://gitter.im/nim-lang/Nim?at=5eaae7f1adb0ec5c2bd7e396 |
15:04:00 | FromGitter | <gogolxdong> Is destructor still a gc option or replaced by arc? |
15:06:14 | FromGitter | <gogolxdong> What's the comparable of RAII now? |
15:07:28 | FromGitter | <alehander92> ok :) |
15:16:28 | * | zacharycarter joined #nim |
15:19:58 | disruptek | i really need nimble to work in #devel. |
15:20:02 | disruptek | is that crazy? |
15:20:17 | disruptek | or should i just replace it in nimph today? |
15:23:01 | shashlick | same paramCount issue? |
15:23:06 | disruptek | yep. |
15:23:34 | shashlick | Araq said he'd revert that PR |
15:28:19 | * | NimBot joined #nim |
15:28:47 | narimiran | shashlick: i think there was talk about "maybe we should revert" |
15:31:36 | FromDiscord | <Chiqqum_Ngbata> Good idea @sealmove re: design patterns |
15:33:56 | narimiran | shashlick: ...but i don't see any "reverts ...." commit in the recent ones |
15:37:23 | shashlick | okay ya cause it is breaking all over the place |
15:37:46 | * | ftsf quit (Ping timeout: 260 seconds) |
15:45:10 | * | Vladar quit (Quit: Leaving) |
15:47:43 | * | nsf quit (Quit: WeeChat 2.8) |
15:48:35 | FromDiscord | <codic> whoa. from 0 to 7 (mods) |
15:50:22 | Araq | gogolxdong: compile with --gc:orc and report bugs :-) |
15:50:34 | Araq | it's the upcoming new default way we'll do MM |
15:57:19 | * | thomasross joined #nim |
15:59:34 | dom96 | guess Nimble should have it's own copy of the stdlib to prevent breakage :P |
16:01:17 | * | xcm quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
16:02:46 | shashlick | this isn't a nimble issue |
16:03:05 | * | xcm joined #nim |
16:08:19 | Araq | I'm working on it |
16:20:23 | * | Vladar joined #nim |
16:31:18 | zacharycarter | I'm trying to write a nimscript file with some tasks - how can I execute the tasks without nimble? |
16:33:37 | leorize | nim task |
16:33:41 | leorize | nim task_name |
16:33:43 | zacharycarter | thanks |
16:34:54 | FromGitter | <kaushalmodi> *may more people get hooked on to the config.nims awesomeness* |
16:36:01 | leorize | with nim being able to run tasks, I see even less reason to use nimble :P |
16:37:37 | * | axion joined #nim |
16:37:47 | FromGitter | <Kvothe87> got a bit lost |
16:37:55 | FromGitter | <Kvothe87> the future is arc or orc? |
16:38:56 | axion | leorize, krux, etc: Regarding the recent discussion, yes I went back to Lisp. As for why, I think Rika knows best, and I'd rather not repeat everything back. I'll leave it to him to relay what is appropriate. |
16:39:35 | leorize | Kvothe87: both |
16:39:38 | zacharycarter | `orc` is `arc` with a cycle collector |
16:39:54 | leorize | library should be designed around arc, while user program might use orc to forget about all the cycles |
16:45:28 | * | xcm quit (Remote host closed the connection) |
16:47:00 | leorize | axion: hopefully we will see you around again :) |
16:48:43 | shashlick | axion: it is hard to change when you have a large established way of doing things that you understand well and have figured out ways to work around limitations |
16:49:07 | * | xcm joined #nim |
16:49:27 | axion | That's an insignificant part of it. In actuality, I probably wouldn't try Nim again if it was the last language in existence. |
16:49:33 | axion | I know many languages. |
16:51:59 | shashlick | that's too bad |
16:53:14 | Araq | axion, wow ... |
16:54:27 | narimiran | axion: you cannot say that and just delegate to somebody else to explain why you feel that way.... |
16:54:49 | narimiran | Rika only knows *second best* ;) |
16:54:59 | FromGitter | <Kvothe87> on a completely different topic. i was reading about the svelte js framework for front end development. I know that karax uses a VDOM, but i think the svelte approach is interesting and could fit nicely with nim where there is already the compliation to JS, and additional information are available. Anbody thought about it? just wondering |
16:55:52 | zacharycarter | IMO if you really want to do something cool with Nim, explore WASM for frontend development |
16:56:00 | zacharycarter | and look at MS's Blazor |
16:56:01 | Araq | narimiran, it's ok, not everybody has to like Nim |
16:56:25 | narimiran | of course, but the way it was put it is a tease |
16:57:03 | shashlick | i agree, if you have legitimate feedback, be generous and share it |
16:58:22 | FromDiscord | <Recruit_main707> can i catch an exception without knowing the error? |
16:58:54 | FromDiscord | <Recruit_main707> try: |
16:58:54 | FromDiscord | <Recruit_main707> echo(params.packet[].parseJson) |
16:58:54 | FromDiscord | <Recruit_main707> except E: |
16:58:54 | FromDiscord | <Recruit_main707> echo(E)? |
16:59:07 | zacharycarter | `echo getCurrentExceptionMsg()` I think? |
16:59:20 | zacharycarter | and just `except:` |
16:59:38 | leorize | Kvothe87: Araq already tried iirc, and it didn't work out, at least not the kind of design he was aiming for :P |
16:59:46 | leorize | it's in karax |
16:59:50 | leorize | see reactive.nim iirc |
17:03:15 | FromGitter | <Kvothe87> @leorize i will check it. Do you know what was the problem on a high level? |
17:07:13 | Araq | Kvothe87: the problem is that monads don't work well |
17:07:32 | Araq | what used to be 'T' becomes 'Reactive[T]' everywhere, it's annoying |
17:08:17 | Araq | plus the runtime mechanism is even more complex than DOM diffing, so what's the point, DOM diffing works well |
17:08:36 | Araq | I mean, I hate it because I had to write and debug the algorithm |
17:09:08 | zacharycarter | i |
17:09:40 | Araq | but for end users it's nice and it doesn't complexify Nim's type system |
17:14:21 | FromGitter | <Kvothe87> thanks @Araq for the feedback. I did not check any details, it just seemed like a nice idea, so i was asking before embarking without any experience . i would have to study what karax does and what svelte is doing. Anyway if i get the time it will be a good point for learning |
17:14:34 | Araq | (btw I wrote the algorithm 3 or 4 times! :-/ ) |
17:17:18 | FromGitter | <bung87> too frontend many frameworks |
17:18:41 | Araq | there is also too much hype around these things, where is the proof that the stateful DOM actually sucks after you added a type system over it? |
17:19:28 | Araq | seems to me people enjoy the statefulness, after all, why add "components" to the DOM diffing otherwise |
17:20:30 | leorize | people like this because it's simple to use at hindsight |
17:20:55 | Araq | so yeah, you can get update bugs where parts of the UI don't follow the changes to the internal model anymore. That's an easy bug to fix though. Whereas with DOM diffing you can end up in a performance hell which is much worse |
17:22:17 | FromGitter | <alehander92> is svelte |
17:22:19 | FromGitter | <alehander92> reactive at all |
17:22:25 | * | MyMind joined #nim |
17:22:42 | Araq | iirc it's just like vue.js and that means yes, it's reactive. |
17:22:44 | FromGitter | <alehander92> didn't it just infer some code to insert after certain "expressions" |
17:22:52 | FromGitter | <alehander92> i thought its nothing like vue.js |
17:22:57 | FromGitter | <alehander92> but i never really tried it |
17:23:06 | FromGitter | <alehander92> maybe i got confused |
17:23:13 | FromGitter | <bung87> only big company very interested, most projects using frameworkA or B no much diferiences |
17:23:13 | Araq | I could be wrong too |
17:24:58 | Araq | I've said it before, the next time I would look closely at my 'Knete' attempts, DOM diffing on top of a stateful DOM is the biggest abstraction inversion that I've seen |
17:25:03 | * | Sembei quit (Ping timeout: 256 seconds) |
17:26:30 | FromGitter | <bung87> frameworks getting do more works that part of browser, that's sad |
17:26:57 | FromGitter | <alehander92> Araq i am not sure |
17:27:08 | FromGitter | <alehander92> it seems you're right, they say they're reactive |
17:28:52 | FromGitter | <alehander92> i thought vue.js is more similar to react somehow |
17:29:30 | leorize | bung87: it's more that browsers are doing more work that's part of these frameworks :) |
17:29:30 | Araq | it isn't, vue.js is reactive and React is not reactive |
17:29:41 | leorize | so much for the name then :P |
17:29:47 | leorize | what exactly is reactive btw? |
17:29:58 | leorize | I heard it a ton and never visualized what it actually is |
17:30:58 | Araq | it's a spreadsheet |
17:31:16 | Araq | so now you know. :P |
17:31:32 | leorize[m] | ok :P |
17:32:37 | leorize[m] | I guess we will see that kind of thing in Nim once we can write compiler plugins in user code :P |
17:33:25 | Araq | but yeah, use Karax, it's awesome, I fixed the most critical bugs and its performance problems :-) |
17:33:35 | FromGitter | <bung87> https://github.com/google/incremental-dom |
17:33:54 | FromGitter | <bung87> here is another approach |
17:34:43 | Araq | not really, karax could use incremental-dom |
17:34:48 | Araq | PRs are welcome :P |
17:35:00 | leorize[m] | isn't this just karax but without the automated part? :p |
17:36:23 | leorize | what's the pattern for writing a DSL in nim? |
17:36:37 | leorize | preferably I'd like to write it in a way that it supports nimsuggest completion |
17:39:04 | Araq | nimsuggest used to work inside macros and then we had a nice regression |
17:39:06 | * | zacharycarter quit (Ping timeout: 260 seconds) |
17:39:52 | leorize | well it's working now, at least for highlighting |
17:40:08 | leorize | not all the time though |
17:42:16 | * | rockcavera quit (Remote host closed the connection) |
17:50:46 | * | a_b_m quit (Ping timeout: 260 seconds) |
18:06:41 | Araq | 2 showstopper bugs left... |
18:07:38 | * | sagax joined #nim |
18:09:09 | * | abm joined #nim |
18:11:40 | Araq | so how to reproduce the paramStr madness? disruptek ? |
18:12:07 | FromDiscord | <Yardanico> Try to install nim-terminaltables package for example :P |
18:12:40 | FromDiscord | <Yardanico> Ah sorry it's just terminaltables |
18:12:58 | krux02 | leorize, if you want nimsuggest completion, there is no other option than using using overloads of operators and creating your syntax that way. |
18:13:27 | disruptek | i just dodged a bullet. |
18:14:38 | Araq | krux02, leorize knows nimsuggest's implementation quite well... |
18:14:53 | krux02 | I think Nim could be extended with programmable completion. |
18:15:23 | krux02 | zsh and other shells also have programmable completion. |
18:15:43 | FromGitter | <kaushalmodi> Araq: ⏎ ⏎ > so how to reproduce the paramStr madness ⏎ ⏎ Simply use paramStr in config.nims without importing `os` [https://gitter.im/nim-lang/Nim?at=5eab15cfb6dd23069799a9d4] |
18:16:06 | krux02 | I think Nim could provide a compiler callback to query completions for macro contexts. |
18:16:06 | FromGitter | <kaushalmodi> Earlier that worked because `paramStr` and `paramCount` existed in system |
18:16:40 | krux02 | but that is at the current state just an idea, nothing developed. |
18:16:53 | FromGitter | <kaushalmodi> Araq: This is how I fixed that breakage: https://github.com/kaushalmodi/hello_musl/commit/42e96a8eaae1307335af05583647f71212b4a973#diff-1e9f4e932d6743264195a0cbb63b83d9R12 |
18:22:59 | Araq | ok, fixed |
18:23:23 | disruptek | nice, thanks. |
18:23:30 | leorize | I like Windows CreateProcess() and I hate it a lot at the same time :P |
18:24:34 | leorize | question: why do people tend to use execCmd more than execProcess? |
18:24:35 | disruptek | that's how i feel about having to use constants when creating objects from case kind: |
18:24:49 | leorize | is it because the array syntax is annoying? |
18:25:14 | leorize | though personally I like having the array syntax |
18:25:41 | * | martinium_ is now known as martinium |
18:25:44 | * | martinium quit (Changing host) |
18:25:44 | * | martinium joined #nim |
18:26:23 | FromGitter | <kaushalmodi> > question: why do people tend to use execCmd more than execProcess? ⏎ ⏎ That almost feels directed towards me :P |
18:26:31 | FromGitter | <kaushalmodi> Does execProcess do shell quoting too? |
18:26:56 | leorize | execProcess use array-style parameter passing |
18:27:01 | leorize | so yes, it's a part of the package |
18:27:05 | leorize | safer, even |
18:27:16 | disruptek | ~stream |
18:27:18 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
18:27:32 | leorize | I noticed the use of execCmd being popular everywhere |
18:27:50 | leorize | so I think it's something I can try to tackle |
18:28:05 | FromGitter | <kaushalmodi> answering myself.. yep it eventually shell quotes! https://github.com/nim-lang/Nim/blob/devel/lib/pure/osproc.nim#L478 |
18:28:34 | FromGitter | <kaushalmodi> leorize: Thanks, I will slowly start incorporating `execProcess` in my code |
18:28:51 | leorize | I'm aiming to build an osproc alternative that's easy to use and can be extremely powerful if the situation calls for it |
18:29:40 | FromGitter | <kaushalmodi> nooo! you will be forking off osproc? |
18:29:52 | leorize | it's a new implementation |
18:29:57 | leorize | different syntax, etc |
18:30:20 | leorize | osproc is nice but not powerful enough for me |
18:30:31 | FromGitter | <kaushalmodi> hmm |
18:30:44 | leorize[m] | for example, the "simple" task of redirecting something to file is impossible |
18:30:59 | FromGitter | <kaushalmodi> or creating symlinks |
18:31:07 | FromGitter | <kaushalmodi> I call `ln` via `exec` in nimscripts |
18:31:07 | leorize[m] | the only way you can do this is to spawn a shell to do it for you |
18:31:32 | leorize[m] | creating symlink is not something osproc need to care about though :P |
18:31:42 | FromGitter | <kaushalmodi> oh well, hehe |
18:32:43 | Araq | symlinks are like regexes |
18:33:35 | FromGitter | <kaushalmodi> so.. they are awesome! |
18:33:46 | disruptek | wut |
18:34:18 | Araq | leorize[m], add it to 'fusion' please |
18:34:20 | Araq | bbl |
18:34:46 | leorize | sure, once I got it working well :P |
18:34:56 | FromGitter | <kaushalmodi> what's fusion? |
18:35:06 | leorize | !repo nim-fusion |
18:35:08 | disbot | https://github.com/nim-lang/fusion -- 9fusion: 11Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches. Time will tell if the idea is a good one. 15 31⭐ 0🍴 |
18:36:02 | FromGitter | <kaushalmodi> cool.. that repo is just 9 days old |
18:36:09 | * | axion left #nim (#nim) |
18:36:35 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
18:38:45 | * | zacharycarter joined #nim |
18:40:25 | * | waleee-cl joined #nim |
18:48:53 | * | shodan45 joined #nim |
18:55:16 | * | dddddd_ joined #nim |
18:57:15 | * | sz0 quit (Quit: Connection closed for inactivity) |
18:57:29 | * | dddddd quit (Ping timeout: 246 seconds) |
18:58:56 | * | dddddd__ joined #nim |
19:00:49 | * | dddddd_ quit (Ping timeout: 264 seconds) |
19:01:17 | * | Vladar quit (Quit: Leaving) |
19:14:44 | * | liblq-dev quit (Ping timeout: 244 seconds) |
19:16:39 | * | liblq-dev joined #nim |
19:20:38 | FromDiscord | <KrispPurg> Hey guys, so every time when I set my shards in my library (https://github.com/krisppurg/dimscord) higher than 2 I keep having this issue of sending identifies per 5 seconds. The issue is that if it reaches the limit the both shards will wait and then when done it will be called multiple times exceeding the limit. (Ratelimit checker: https://github.com/krisppurg/dimscord/blob/devel/dimscord/gateway.nim#L259, Identify sending: https://gith |
19:20:58 | FromDiscord | <Yardanico> your message got stripped in irc xd |
19:21:05 | FromDiscord | <KrispPurg> wut |
19:21:15 | FromDiscord | <KrispPurg> rip then |
19:21:33 | leorize | Yardanico: maybe you should update the mattermost bridge you're using here? |
19:21:39 | leorize | maybe it got some new features now? :P |
19:22:00 | Yardanico | leorize: well I can, it's easy, but I'm scared something will break :P |
19:22:02 | Yardanico | worth a try I guess |
19:22:17 | Yardanico | I know that matterbridge now supports discord webhooks too |
19:22:20 | leorize | maybe read the changelog before attempting :P |
19:22:41 | dom96 | Your bot not ready? |
19:22:42 | FromDiscord | <KrispPurg> Anyways here was the message https://play.nim-lang.org/#ix=2kcW |
19:23:01 | Yardanico | leorize: for two years? :D |
19:23:14 | leorize | why not :p |
19:23:16 | Yardanico | but I really looked at discord config for latest version, there's not that much new stuff |
19:23:57 | leorize | maybe they support pinging now? |
19:24:14 | Yardanico | @dom96 well it works quite ok in #nim-offtopic, there are some crashes because of some websocket errors (maybe that's due to the bot running on my PC), but generally with a script to auto-restart it it works just fine |
19:24:37 | leorize | dom96: if possible you should allow it to hook into nimbot's logging system |
19:24:47 | Yardanico | but I still need to fix edit diffing (and limit it to only 3 most recent discord messages), and add ability to ping people from discord in irc |
19:24:51 | Yardanico | leorize: wdym? |
19:24:52 | leorize | that will let us host long messages on discord directly on our servers :P |
19:25:21 | leorize | that means you log directly into irclogs without all the <FromDiscord> jazz |
19:25:40 | leorize | also give you a nice way to support long messages |
19:25:52 | leorize | just log them there and generate a link to the entry |
19:27:03 | * | Zevv quit (Ping timeout: 260 seconds) |
19:28:14 | Yardanico | well there are some paste services which support storing contents "forever" |
19:28:29 | Yardanico | like paste.debian.net (it has a XML-RPC (jesus) API too) |
19:28:32 | dom96 | that sounds like it would be quite a complex system |
19:28:39 | Yardanico | yeah I think so too |
19:29:02 | dom96 | what might work is if the bot generates its own IRC logs and then NimBot can merge them or link to them |
19:33:55 | * | dddddd__ is now known as dddddd |
19:33:56 | leorize[m] | it's better to host the logs on our infrastructure |
19:34:59 | Yardanico | leorize: well matterbridge already runs on the same VPS as the nimbot |
19:35:23 | Yardanico | and logs are there too |
19:38:36 | * | Zevv joined #nim |
19:38:36 | * | Zevv quit (Changing host) |
19:38:36 | * | Zevv joined #nim |
19:42:47 | Yardanico | tbh the log thing would've been easier if nimbot used a DB (even sqlite), so it could just ignore messages from FromDiscord and ircord will write them in the same DB, but that requires changing nimbot quite a bit too |
19:43:14 | Yardanico | and irclogs website will need to be adapted too, and it'll be slower since it'll require reading DB every time someone opens a page (although I guess we could just generate an .html at the end of each day) |
19:55:23 | * | leorize quit (Ping timeout: 240 seconds) |
19:56:45 | FromDiscord | <KrispPurg> uhh, hello? |
19:56:52 | Yardanico | hi? |
19:57:18 | FromDiscord | <KrispPurg> Are you gonna help me with the ratelimit issue or uh? |
19:57:28 | Yardanico | I didn't understand the issue at all, sorry |
19:57:35 | FromDiscord | <KrispPurg> oh. |
19:58:20 | FromDiscord | <KrispPurg> I'm going to show an understandable minimal example that reproduces this issue. |
19:59:03 | FromDiscord | <KrispPurg> Only at tomorrow, because I gotta watch this quiz show that I like. |
20:12:47 | martinium | what module or libray was the Nim website built with? |
20:12:52 | * | lain quit (Quit: kthxbai) |
20:13:10 | Yardanico | martinium: old website was built statically using a nim tool, new one is jekyll |
20:13:11 | Yardanico | https://github.com/nim-lang/website |
20:13:34 | martinium | jekyll aka Ruby? |
20:13:40 | * | lain joined #nim |
20:13:50 | Yardanico | jekyll aka static website :P |
20:13:55 | Yardanico | but yeah, jekyll itself is in ruby |
20:14:50 | martinium | any static website builders for Nim? |
20:14:59 | Yardanico | github search may help you :P |
20:15:11 | martinium | darn, wanted to be lazy |
20:15:13 | martinium | hehe |
20:15:25 | martinium | what ever happened to jester framework |
20:16:27 | Yardanico | martinium: it's still around, wdym |
20:16:46 | martinium | I thought Nim site was built using Jester |
20:16:53 | Yardanico | martinium: there's no point in using jester |
20:16:56 | Yardanico | since the website is static anyway |
20:17:05 | martinium | static is fast |
20:17:07 | martinium | love it |
20:17:08 | Yardanico | for static page hosting nothing beats nginx :P |
20:17:34 | martinium | going to search for a nim static site generator |
20:17:43 | martinium | if none exists maybe I'll take that on as a project |
20:18:04 | shashlick | disruptek: is nimph now working with latest devel? 4raq fixed the paramCount issue |
20:18:32 | Yardanico | martinium: there are some |
20:19:34 | * | iws quit (Ping timeout: 240 seconds) |
20:20:24 | * | iws joined #nim |
20:23:38 | disruptek | i can't get over how slow nimph is now. |
20:23:50 | zacharycarter | why is it so much slower now? |
20:23:57 | disruptek | i dunno. |
20:24:06 | zacharycarter | oh |
20:24:36 | shashlick | what's a benchmark we can use to test it? |
20:25:03 | disruptek | you should install it and try operating it. |
20:26:06 | disruptek | if that's too much, then don't worry about it. |
20:26:42 | disruptek | i guess it's `nim dump`. |
20:27:39 | disruptek | it's not /only/ that, though. |
20:29:08 | shashlick | i just ran nimph on the nimph folder itself |
20:29:18 | shashlick | but guess i have nothing to compare it with |
20:29:38 | disruptek | how long did it take? |
20:30:10 | shashlick | 10 seconds |
20:30:33 | shashlick | good chunk was downloading the package list perhaps |
20:30:54 | Yardanico | ah right, is --gc:orc supposed to work with async now? |
20:31:03 | disruptek | yes. |
20:31:11 | Yardanico | disruptek: what if it doesn't? :D |
20:31:33 | Yardanico | both arc/orc fail to work with irc module in async mode for example |
20:31:38 | Yardanico | they fail with "Exception message: File descriptor not registered." |
20:31:57 | disruptek | that explains one problem i have with my bot. |
20:32:18 | disruptek | shashlick: just run it a few times and take the best number. |
20:32:24 | Yardanico | well I can submit an issue but irc module is quite big (~600 lines) |
20:32:32 | disruptek | go for it. |
20:32:35 | disruptek | i will fix it. |
20:32:45 | disruptek | i mean, irc. |
20:32:58 | shashlick | disruptek: http://ix.io/2kdv |
20:32:59 | Yardanico | disruptek: aren't you supposed to fix arc/orc instead? :P |
20:33:02 | disruptek | i think newer nim broke openapi which broke github. |
20:34:04 | FromGitter | <Willyboar> Nice things happen last 3 months :) |
20:34:20 | disruptek | shashlick: but, how long did it take? |
20:34:32 | shashlick | disruptek: 10 seconds every time |
20:34:39 | disruptek | a good test is `nimph path nimterop` or w/e. |
20:34:41 | shashlick | most of it was these two steps - the nimble package list is 2 days old, loaded 2612 packages from nimble |
20:35:03 | disruptek | weird; that happens almost instantly for me. |
20:35:24 | shashlick | almost 5 seconds |
20:35:42 | shashlick | 4.3s |
20:36:26 | disruptek | you have a thing that times line output? |
20:36:33 | disruptek | that's sorta neat as an idea. |
20:38:46 | * | narimiran quit (Ping timeout: 260 seconds) |
20:39:08 | shashlick | nimble path nimterop returns instantaneously |
20:39:17 | shashlick | what is nimph doing for nimph path? |
20:39:30 | disruptek | only computing the entire environment. |
20:39:57 | shashlick | so you have to run nim dump multiple times? |
20:40:08 | disruptek | no, i (should) only run it once. |
20:40:58 | shashlick | let me build with profiling |
20:41:09 | disruptek | it's some problem that arrived when the config changes came in. |
20:41:22 | disruptek | i can look at it when i fix the damned hints. |
20:45:13 | shashlick | disruptek: okay wasn't compiled with danger, with it, nimph runs path nimterop in 0.88s |
20:49:09 | * | rockcavera joined #nim |
20:53:33 | * | disruptek quit (*.net *.split) |
20:53:33 | * | Araq quit (*.net *.split) |
20:53:33 | * | qbradley quit (*.net *.split) |
20:53:33 | * | WilhelmVonWeiner quit (*.net *.split) |
20:53:33 | * | dv^_^ quit (*.net *.split) |
20:53:33 | * | Amun_Ra quit (*.net *.split) |
20:53:33 | * | gsingh93 quit (*.net *.split) |
20:53:33 | * | shashlick quit (*.net *.split) |
20:53:33 | * | dom96 quit (*.net *.split) |
20:53:43 | * | WilhelmV1nWeiner joined #nim |
20:53:48 | * | Araq joined #nim |
20:53:48 | * | qbradley joined #nim |
20:53:49 | * | dv^_^ joined #nim |
20:54:19 | * | dom96 joined #nim |
20:54:56 | * | dom96 quit (Changing host) |
20:54:56 | * | dom96 joined #nim |
20:55:00 | * | gsingh93 joined #nim |
20:55:17 | * | disruptek joined #nim |
20:55:33 | disruptek | that seems fast enough. |
20:55:51 | * | shashlick joined #nim |
20:56:24 | Yardanico | netsplit, rip |
20:57:36 | skrylar[m] | well this is a dumb request, but does anyone have a favorite system for splitting or visualizing trace logs on prefixes |
20:58:02 | skrylar[m] | (i mean yeah, grep ^foo, but.. :|) |
21:00:48 | dadada | is nim using ldpreload internally somewhere? |
21:02:54 | dadada | moe from nimble is broken on my Linux, so I tried to fix it with my own ldpreload tool I created, but that didn't help cause apparently according to strace moe also is setting its own ldpreload settings, possibly overriding anything my tool is doing... I think ldpreload should be left to external tools (like mine), or is there a reason why an application should dynamically change ldpreload environment |
21:03:00 | dadada | variables and the like? |
21:03:26 | dadada | probably this isn't caused by moe code, but rather some ncurses binding related stuff |
21:05:14 | dadada | hmm, wait, pardon, I think I saw something that wasn't there, or assumed something wrongly ... ignore my last few messages |
21:05:19 | dadada | like you usually do! :-) |
21:08:08 | FromDiscord | <Rika> less ignore more "busy with other stuff: |
21:09:00 | FromDiscord | <Rika> 5 minutes aint a lot of time to let people read when the day's busy |
21:10:28 | dadada | Rika: uhm, take it with a grain of salt, I did imply that ignoring me would make sense (joke about myself), because at least in this case, the thing I wrote was for naught |
21:11:18 | FromDiscord | <Rika> thought you were mad |
21:11:31 | FromGitter | <dawkot> What should I expect Haxe to be worse at than Nim? |
21:11:35 | FromDiscord | <Rika> habitual assumption due to repeat offenses (badly worded, i know) |
21:11:36 | FromGitter | <dawkot> Seems similiar, but I never used it |
21:11:46 | FromDiscord | <Rika> never used haxe either |
21:11:53 | FromDiscord | <Rika> let me take a look |
21:12:04 | liblq-dev | do ranges automatically use the smallest type that can fit them? eg. does a range[0..4] consume as much as an int, or uint8? |
21:12:07 | FromDiscord | <cgarciae> Newbie question: Why does Nim allow one to do this? |
21:12:07 | FromDiscord | <cgarciae> |
21:12:07 | FromDiscord | <cgarciae> ```nim |
21:12:07 | FromDiscord | <cgarciae> type A = object |
21:12:07 | FromDiscord | <cgarciae> field: int |
21:12:08 | FromDiscord | <cgarciae> |
21:12:08 | FromDiscord | <cgarciae> let a = A() # no error |
21:12:09 | FromDiscord | <cgarciae> |
21:12:09 | FromDiscord | <cgarciae> echo a.field # 0 |
21:12:11 | FromDiscord | <cgarciae> ``` |
21:12:12 | FromDiscord | <cgarciae> |
21:12:15 | FromDiscord | <cgarciae> I'd prefer if it told me I forgot an argument. Also, just notice one cannot set default values in the definition of the type. Is there a convention for defining constructors? |
21:12:32 | FromDiscord | <Yardanico> because that means that all fields in A will be set to "default" values for their types |
21:12:32 | FromDiscord | <Recruit_main707> thats because A() is not a constructor |
21:12:35 | liblq-dev | @cgarciae all arguments are initialized to default(T) |
21:12:45 | FromDiscord | <Yardanico> for value types that's zero usually, for ref types that's nil |
21:12:45 | FromDiscord | <Recruit_main707> you come from python probably? |
21:13:00 | FromDiscord | <Yardanico> convention is to create procs like initType(args): Type for value types and newType(args): Type for ref types |
21:13:06 | FromDiscord | <Rika> convention is `proc initXXX`... im late |
21:13:20 | * | lritter_ quit (Quit: Leaving) |
21:13:25 | FromDiscord | <Rika> damn you yardanico and your speedy typing |
21:13:30 | FromDiscord | <Recruit_main707> have a look at this: |
21:13:31 | FromDiscord | <Recruit_main707> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#self__init__ |
21:13:31 | liblq-dev | !eval echo sizeof(range[1..8]) |
21:13:34 | NimBot | 8 |
21:13:36 | FromDiscord | <Rika> i blame my fingernails! |
21:13:38 | FromDiscord | <cgarciae> I see, camel cased? |
21:13:49 | liblq-dev | oh noes! it's u n o p t i m i z e d |
21:13:52 | FromDiscord | <Rika> camelcase is the convention here |
21:13:57 | FromDiscord | <Rika> "convention" |
21:14:06 | FromDiscord | <Recruit_main707> not neccesary though |
21:14:11 | FromDiscord | <Rika> but since nim is case insensitive but for the first letter |
21:14:15 | FromDiscord | <Yardanico> @cgarciae well nim is partially case-insensitive, so not necessarily |
21:14:17 | liblq-dev | you can still use snake case, because nim is style insensitive |
21:14:17 | FromDiscord | <Rika> it doesnt really matter |
21:14:41 | FromDiscord | <Recruit_main707> we are 4 people spamming the same answers xD |
21:14:42 | FromDiscord | <Rika> wow, 4 people responding to the same person always looks funny |
21:14:46 | FromDiscord | <Recruit_main707> lmao |
21:14:48 | FromDiscord | <Rika> DAMN IT |
21:14:49 | FromDiscord | <Rika> NOT AGAIN |
21:14:54 | FromDiscord | <Rika> beat by recruit this time |
21:16:37 | liblq-dev | @Rika type faster!! |
21:16:52 | FromDiscord | <Rika> so does anyone here know haxe? dawkot was asking what it doesnt have that nim does |
21:16:59 | FromDiscord | <Rika> lq: no u |
21:16:59 | FromDiscord | <Recruit_main707> she has been typing since his last comment xD |
21:17:05 | FromDiscord | <Recruit_main707> her* |
21:17:06 | FromDiscord | <cgarciae> Ah right, but the community uses camel-cased them? Thanks! |
21:17:17 | FromDiscord | <Rika> yeah but as we've said it really doesnt matter |
21:17:24 | FromDiscord | <Recruit_main707> each one uses what he wants |
21:17:26 | FromDiscord | <Rika> unless you wanna contribute code to std lib |
21:17:28 | FromDiscord | <Rika> or compiler code |
21:17:30 | liblq-dev | @Rika, well, first of all, haxe doesn't have such a nice syntax ;) |
21:17:43 | liblq-dev | it also doesn't seem to have `range` types |
21:17:44 | FromDiscord | <Rika> other than that, of course |
21:17:48 | FromDiscord | <Yardanico> @cgarciae camelCase is preferred, yes |
21:17:57 | liblq-dev | but I'm not experienced enough to know |
21:17:57 | FromDiscord | <Rika> range types dont exactly work too well from my experience |
21:17:59 | FromDiscord | <cgarciae> I think for reading others code it matters |
21:18:04 | FromDiscord | <Yardanico> for types it's PascalCase, for constants either camelCase or PascalCase |
21:18:18 | liblq-dev | and for procs it's camelCase only |
21:18:22 | FromDiscord | <Rika> we mean that it doesnt matter if you use snake case uniformly on all your projects |
21:18:40 | FromDiscord | <Rika> not that "it doesnt matter if you mix them in the same project" |
21:18:54 | FromDiscord | <Rika> though thats ok too but no one would want to read your code at that point |
21:18:58 | FromDiscord | <Yardanico> @cgarciae partial insensitivity means that if you write a proc like proc new_type(): Type someone will be able to use it as newType |
21:19:08 | liblq-dev | but not NewType |
21:19:12 | FromDiscord | <Yardanico> partial because the first letter is case-sensitive, because of types |
21:19:23 | FromDiscord | <Yardanico> so type and Type are not the same |
21:19:29 | FromDiscord | <Yardanico> and let type = Type() works |
21:19:38 | liblq-dev | ^ old Nim did not support that, so sometimes you may see types prefixed with P or T |
21:19:40 | FromDiscord | <cgarciae> yeah but try searching for it `new_type` vs `newType` on vscode |
21:20:07 | FromDiscord | <Yardanico> well nim has it's own nimgrep, also nim plugin in vscode uses nimsuggest |
21:20:08 | liblq-dev | ask the extension's authors to add a setting for style preference ;) |
21:20:32 | * | thelounge joined #nim |
21:20:37 | FromDiscord | <Rika> do you use vscode lq? |
21:21:20 | FromDiscord | <Rika> heard `@Gary M#6455`'s revamping it (kinda, he only wanted to fix syntax highlighting) |
21:23:15 | FromDiscord | <Rika> hmm, haxe has pattern matching, interesting |
21:23:20 | dom96 | bah, we've got all these darn {.since annotations and the docgen doesn't show them? |
21:24:17 | Yardanico | it does though? |
21:25:05 | dom96 | where? |
21:25:54 | Yardanico | oh I thought it does |
21:27:00 | dadada | Rika: not mad :-( |
21:27:03 | * | thelounge quit (Quit: thelounge) |
21:27:04 | dadada | sad!!! |
21:28:17 | FromDiscord | <Rika> yeah |
21:28:20 | FromDiscord | <Rika> understandable |
21:29:26 | FromDiscord | <cgarciae> Weird that Haxe compiles to pure Python, it would be more useful to do something like what `nimporter` is doing: |
21:29:26 | FromDiscord | <cgarciae> |
21:29:26 | FromDiscord | <cgarciae> https://github.com/Pebaz/nimporter |
21:29:53 | FromDiscord | <Rika> it *can* compile to pure python, just like how nim *can* compile to objective c |
21:29:56 | FromDiscord | <Rika> i dont see how it is weird |
21:30:17 | Yardanico | also see https://forum.nim-lang.org/t/1880 |
21:30:39 | FromGitter | <sealmove> I have a seq[char] (not null terminated) and I want to convert it to nim string. |
21:31:36 | FromDiscord | <cgarciae> Because pure Python is slow, if you create a shared object that can be imported from Python its faster. Unless you really want the Python code for some reason. |
21:31:45 | Yardanico | also imo haxe's stdlib is much smaller since it's harder to port things between backends |
21:33:22 | FromDiscord | <Rika> Yarnanico: damn, adrianv's reply looks juicy |
21:33:37 | FromDiscord | <Rika> as in content-size wise not controversialness wise |
21:34:17 | FromDiscord | <Rika> @cgarciae *cpython* is slow, implementations are slow not languages, even if its the base implementation |
21:34:27 | FromDiscord | <Rika> also, maybe someone does want pure python |
21:34:38 | FromDiscord | <Rika> maybe its a project requirement |
21:35:02 | Yardanico | I mean you can write a python backend for nim if you want, just base it on the JS backend, I doubt it'll be THAT much work to make most of nim work for it |
21:35:03 | FromDiscord | <Rika> sealmove: i heard you can safely just cast between them but wait for someone to back my answer |
21:35:38 | Araq | Rika implementations can have a hard time though mapping the language to the hardware |
21:36:18 | * | shashlick quit (Quit: quit) |
21:36:23 | Yardanico | Araq: so about orc - is it supposed to work with async now? Because I tried the "irc" module in async mode and it fails with both arc/orc with "File descriptor not registered", although simple async httpclient code works |
21:36:40 | Araq | but indeed, give me Python that is as fast as Nim and I still wouldn't want to use it. :-) |
21:37:24 | Araq | Yardanico, the tests I did worked |
21:37:32 | FromDiscord | <Rika> Araq: that is true, hmm, i'd revise my answer to implementations are slow and language design can inhibit speed but that still does not make a language slow |
21:37:45 | FromDiscord | <Rika> or so, i'd need to put more thought into it if needed but lol |
21:38:00 | * | shashlick joined #nim |
21:38:01 | Yardanico | Araq: ah ok, I'll try to find a smaller example to reproduce this issue |
21:38:20 | Yardanico | well irc module itself is ~700 lines |
21:39:15 | Araq | Yardanico, thanks, much appreciated, I'm working on #14159 which might be related |
21:39:26 | Yardanico | oh, nice :) |
21:39:41 | Araq | Yardanico, also if you report the but, always also try --sinkInference:off my new enemy |
21:39:45 | Araq | *bug |
21:40:07 | skrylar[m] | my god. this entire error was just from forgetting a subscript |
21:40:19 | * | Jesin quit (Quit: Leaving) |
21:40:21 | * | Amun_Ra joined #nim |
21:41:57 | FromDiscord | <Rika> subscript? |
21:42:49 | Yardanico | Araq: seems like irc works in async mode with --sinkInference:off :D |
21:43:55 | FromDiscord | <Rika> what does sink inference do exactly? and how would orc work without it? 2nd question is what's baffling me |
21:44:34 | Yardanico | well it adds sink annotations or hooks automatically afaik |
21:44:45 | Yardanico | basically an optimization thing but i'm not sure :D |
21:45:06 | FromDiscord | <Rika> its just for optimization and not for orc or arc to actually work? |
21:45:30 | Yardanico | yeah, they both will work without it |
21:46:16 | Yardanico | orc is arc with a cycle collector |
21:46:48 | zacharycarter | https://nim-lang.org/docs/destructors.html#sink-parameters - Rika |
21:47:16 | zacharycarter | oh you probably already saw that |
21:48:26 | Yardanico | ah wait the 14159 works without sink inference too |
21:48:35 | FromDiscord | <Rika> i have but im unsure of how it works w/o it |
21:48:40 | Yardanico | it does copies |
21:49:34 | * | couven92 quit (Ping timeout: 240 seconds) |
21:51:06 | FromDiscord | <Rika> oh ok |
21:52:28 | Yardanico | nimes seems to work with arc (or orc) without sink inference, but it's much slower |
21:57:20 | Yardanico | and "perf" says that 70% of time is spent in __strstr_sse2 from libc |
22:03:21 | zacharycarter | hmm interesting - so I'm loading a shared lib, loading a symbol and casting it to a callback, calling that callback and passing in a var object, assigning a value to a string member of that object and then unloading the library |
22:03:39 | zacharycarter | with both the shared lib and the host program compild with `--gc:arc` the program never terminates |
22:03:47 | zacharycarter | with default gc the program terminates |
22:06:01 | shashlick | @zacharycarter so not https://github.com/nim-lang/Nim/issues/14074 |
22:06:58 | zacharycarter | shashlick: going to add asan to the picture and I'll check out generated c and stacktrace |
22:07:47 | * | solitudesf- quit (Ping timeout: 258 seconds) |
22:10:49 | * | oprypin quit (Quit: Bye) |
22:10:57 | * | oprypin joined #nim |
22:12:44 | zacharycarter | it looks different shashlick |
22:13:42 | zacharycarter | it's happening in `N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___dS1BF3Vxjg9aJMmmhVJKSpQ)(NimStringV2* dest)` |
22:13:54 | zacharycarter | in - `if ((*dest).p && !((*dest).p->cap & NIM_STRLIT_FLAG)` |
22:14:24 | zacharycarter | looks like (*dest).p->cap is causing an EXC_BAD_ACCESS |
22:21:45 | zacharycarter | I think it's because the string is being created by the code executing in the shared library |
22:21:51 | zacharycarter | and then I'm unloading the shared library |
22:22:09 | zacharycarter | and Nim is trying to free the memory allocated by the string after the library has been unloaded |
22:26:22 | * | Jesin joined #nim |
22:28:21 | * | couven92 joined #nim |
22:31:05 | Araq | zacharycarter, argh, that bug |
22:31:11 | Araq | I'm sorry I forgot about that one... |
22:31:36 | Araq | so simple to fix :-/ |
22:31:39 | zacharycarter | I wasn't even sure if it was a bug |
22:31:52 | zacharycarter | or if I was just doing something incorrectly |
22:32:04 | Araq | you're buliding a library, right? |
22:32:45 | zacharycarter | so I have a host program that loads a symbol from a shared library and passes a var object to the loaded proc |
22:33:07 | zacharycarter | the code in the library assigns a string to a member in that var object |
22:33:24 | zacharycarter | then in the host program I echo the member of the object |
22:33:37 | zacharycarter | but Nim calls the destructor on the string after I unload the library |
22:34:10 | * | couven92 quit (Ping timeout: 246 seconds) |
22:34:11 | Araq | PR coming... |
22:34:27 | Yardanico | https://github.com/nim-lang/Nim/issues/14179 lol |
22:35:03 | zacharycarter | \o/ |
22:35:48 | FromGitter | <dumjyl> do ref types work within unions (assuming I discriminate properly) for arc or must I implement my own RCed ptr type? |
22:36:05 | Yardanico | i don't think there's any reason they wouldn't work |
22:36:09 | Araq | https://github.com/nim-lang/Nim/pull/14180 |
22:38:20 | Araq | dumjyl: we have extensive tests for them fwiw |
22:40:01 | FromGitter | <gogolxdong> cmp doesn't compile with orc `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
22:41:50 | Yardanico | cmp? |
22:42:23 | * | liblq-dev quit (Quit: WeeChat 2.8) |
22:42:47 | * | NimBot joined #nim |
22:42:56 | * | dddddd quit (Quit: dddddd) |
22:43:17 | FromGitter | <dumjyl> Maybe unclear, I'm talking about the `{.union.}` pragma. |
22:44:48 | FromGitter | <gogolxdong> Our CMP project, not the cmp proc of algorithm |
22:45:46 | FromGitter | <gogolxdong> Cross-Cloud Management Platform |
22:46:19 | Yardanico | you mean the compiler segfaults? |
22:46:25 | Yardanico | or sigsegv at runtime? |
22:46:36 | Yardanico | try to compile with --sinkInference:off if it crashes on runtime |
22:46:39 | FromGitter | <gogolxdong> compile segfaults |
22:46:43 | Yardanico | oh |
22:47:02 | Yardanico | then you can get full traceback with ./koch temp c --gc:orc yourmainnimfile.nim |
22:47:10 | Yardanico | or try to make a small reproducible example :P |
22:47:54 | * | tane quit (Quit: Leaving) |
22:48:48 | * | martinium quit (Quit: Leaving) |
22:50:56 | * | abm quit (Quit: Leaving) |
22:51:38 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=2ked |
22:54:30 | zacharycarter | Araq: can confirm that PR fixes my issue - thanks! |
22:56:35 | zacharycarter | actually nevermind it doesn't, but I don't think my issue is fixable I think it just is improper use of nim strings |
22:57:03 | zacharycarter | the host program can't know that the memory assigned to the member property was allocated by the shared library |
23:04:58 | shashlick | I think Araq fixed my issue there, need to check if nimterop benefits |
23:05:07 | zacharycarter | probably |
23:10:15 | * | crem quit (Ping timeout: 240 seconds) |
23:10:34 | * | crem joined #nim |
23:13:28 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
23:14:46 | zacharycarter | using a shared pointer and calling destroy on it fixed my issue |
23:14:53 | zacharycarter | probably the right way to do it |
23:15:08 | * | ehmry joined #nim |
23:15:48 | * | PMunch quit (Quit: leaving) |
23:17:23 | * | Trustable quit (Remote host closed the connection) |
23:38:40 | * | krux02 quit (Remote host closed the connection) |
23:46:08 | skrylar[m] | what is this orc business |
23:48:18 | Yardanico | skrylar[m]: arc with a cycle collector |
23:48:36 | Yardanico | see https://forum.nim-lang.org/t/5734#38665 |
23:52:52 | FromGitter | <bung87> is there problem when writing string to image format? |
23:53:40 | FromGitter | <bung87> or seq[char], using `stream.write` |
23:55:34 | FromGitter | <bung87> https://github.com/bung87/icon/blob/master/src/iconpkg/ico.nim |
23:55:41 | FromDiscord | <KingDarBoja> Everytime I run a test (using unittest module), any proc on setup section will display a hint on the terminal about it not being used |
23:55:48 | FromDiscord | <KingDarBoja> Although I do use them on tests |
23:57:34 | skrylar[m] | Yardanico: neat, i guess. |
23:58:15 | skrylar[m] | got the pretty linebreaking to work on paragraphs today. still need to get the adobe optimization in tho :\ |
23:58:44 | skrylar[m] | they put a depth limit in K-P which guards against psychotically long paragraphs |