00:18:51 | * | clyybber quit (Quit: WeeChat 2.6) |
00:20:20 | FromGitter | <juancarlospaco> Hi |
00:21:30 | FromGitter | <juancarlospaco> https://github.com/nim-lang/Nim/pull/12549#issuecomment-547200137 |
00:22:02 | * | Jesin quit (Quit: Leaving) |
00:25:39 | * | Jesin joined #nim |
00:29:06 | * | EA96 joined #nim |
00:31:34 | * | theelous3_ quit (Ping timeout: 268 seconds) |
01:13:43 | * | EA96 left #nim (#nim) |
01:18:44 | * | sealmove quit (Quit: WeeChat 2.6) |
01:27:02 | FromGitter | <gogolxdong> @treeform hash of Color is missing. |
01:29:18 | FromGitter | <gogolxdong> and what's the difference between dom2 and stdlib dom? |
02:02:55 | * | seni quit (Quit: Leaving) |
02:04:50 | FromGitter | <gogolxdong> according to what stdlib hashes have , suggest to define as ⏎ type ⏎ Color* = tuple[r,g,b,a:float32] ⏎ which has similiar semantics with object. [https://gitter.im/nim-lang/Nim?at=5db79e423d669b28a0f4f012] |
02:10:17 | * | kevin joined #nim |
02:10:40 | * | kevin is now known as Guest51156 |
02:13:05 | * | Guest51156 quit (Client Quit) |
02:13:25 | * | kevin_ joined #nim |
02:21:29 | kevin_ | hi, I'm new |
02:22:19 | disruptek | HI KEVIN |
02:28:58 | kevin_ | I come from Kotlin :D , just a developer not core-lang design :D |
02:29:14 | disruptek | ah, cool. |
02:30:31 | kevin_ | nowaday, alot programming languages based on LLVM, except Nim/Go ... and I'm interesting on Nim |
02:31:00 | kevin_ | I hope all you guys can grow up Nim as popular language in next time |
02:31:12 | disruptek | well, nim has an llvm backend under development. |
02:36:43 | kevin_ | I saw Nim compile to C/C++/JS ? it's another compiler isn't it ? |
02:37:58 | disruptek | https://github.com/arnetheduck/nlvm |
02:42:08 | kevin_ | look nice ! It's official ? |
02:42:31 | disruptek | it's not implemented by the same authors, if that's what you mean. |
02:42:40 | shashlick | No it isn't official |
02:44:35 | FromDiscord | <Rika> Heya |
02:44:48 | FromDiscord | <Rika> Does nim have a docstyle guideline |
02:45:15 | * | Jjp137 quit (Read error: Connection reset by peer) |
02:45:49 | FromDiscord | <Rika> Found it |
02:48:39 | * | rockcavera quit (Remote host closed the connection) |
02:48:42 | kevin_ | I hope author keep Nim still simple, programming was more complex don't want any advantage |
02:52:24 | FromDiscord | <Rika> Okay, I said found it, but I didn't find what I wanted precisely |
02:52:47 | FromDiscord | <Rika> kevin_ nim can be simple or complex, depending on what you make |
02:53:18 | FromDiscord | <k1tt3hk4t> I don't think language complexity is a bad thing at all, as long as it's not *arbitrary* complexity, like the level of boilerplate a language like Java has |
02:53:59 | FromDiscord | <k1tt3hk4t> I'm glad to use abstractions at the same level that Haskell has if it makes approaching the problem im working on much simpler-- it just requires me to learn how to use them beforehand, and from there on it's an already sunk cost and I know how it works |
02:57:04 | kevin_ | I mean 'simple' not 'simpler', language can do anything by a simple way :D |
04:15:43 | * | sagax quit (Ping timeout: 245 seconds) |
04:20:20 | * | fanta1 joined #nim |
04:27:57 | * | kungtotte quit (Ping timeout: 240 seconds) |
04:35:06 | * | nsf joined #nim |
04:41:36 | * | narimiran joined #nim |
04:42:57 | * | Jjp137 joined #nim |
04:45:04 | * | kungtotte joined #nim |
04:47:41 | * | dddddd quit (Remote host closed the connection) |
05:01:43 | * | kevin_ quit (Ping timeout: 265 seconds) |
05:02:32 | * | chemist69 quit (Ping timeout: 276 seconds) |
05:04:14 | * | chemist69 joined #nim |
05:15:15 | * | Cthalupa quit (Ping timeout: 265 seconds) |
05:43:21 | * | fanta1 quit (Quit: fanta1) |
06:08:48 | * | Cthalupa joined #nim |
06:13:50 | * | kevin_ joined #nim |
06:32:13 | * | solitudesf joined #nim |
06:39:06 | * | Cthalupa quit (Ping timeout: 268 seconds) |
06:40:58 | * | sagax joined #nim |
06:45:48 | * | Trustable joined #nim |
06:46:52 | * | kevin_ quit (Quit: Leaving) |
06:54:31 | * | Cthalupa joined #nim |
07:00:00 | * | gmpreussner_ quit (Quit: kthxbye) |
07:04:53 | * | gmpreussner joined #nim |
07:06:36 | * | fanta1 joined #nim |
07:16:06 | * | Trustable quit (Remote host closed the connection) |
07:29:04 | * | PMunch joined #nim |
07:39:17 | * | Cthalupa quit (Ping timeout: 240 seconds) |
07:44:03 | * | filcuc joined #nim |
07:49:54 | * | GordonBGood quit (Remote host closed the connection) |
07:53:02 | * | GordonBGood joined #nim |
07:54:13 | * | Cthalupa joined #nim |
07:55:57 | PMunch | Am I being an idiot here? http://ix.io/2078 |
07:56:30 | Araq | exportc? |
07:56:54 | PMunch | All the log statements prints the same information, but the caller of the DLL says that the Nim version sets the qstate to module_wait_initial (the 0 value for that enum). |
07:57:21 | PMunch | Isn't it supposed to be? |
08:00:57 | Araq | unclear question |
08:01:29 | PMunch | I mean it appears to work fine, it just doesn't seem to actually change the value of that field in the passed struct |
08:03:02 | PMunch | Oooh, wait |
08:03:15 | PMunch | The Nim enum is 1 byte, while the C enum is 4 |
08:03:28 | PMunch | Can I force an enum to be a certain backing type? |
08:03:42 | * | gmpreussner_ joined #nim |
08:03:48 | Araq | yes |
08:04:03 | PMunch | How? |
08:04:06 | Araq | type T {.size: 4.} = enum |
08:04:07 | Araq | iirc |
08:04:09 | PMunch | I tried to find it in the manual |
08:04:49 | * | gmpreussner quit (Ping timeout: 268 seconds) |
08:04:52 | PMunch | That worked fine |
08:05:08 | PMunch | Maybe that should be mentioned here? https://nim-lang.org/docs/manual.html#types-enumeration-types |
08:06:02 | PMunch | I mean the only mention I can find of it is this: https://nim-lang.org/docs/manual.html#set-type-bit-fields |
08:07:31 | Araq | it should |
08:08:53 | PMunch | Never found the docs about creating DLLs with Nim and how the GC behaves in that case by the way |
08:09:10 | * | krux02 joined #nim |
08:10:11 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
08:10:31 | * | filcuc joined #nim |
08:17:57 | * | Cthalupa quit (Ping timeout: 240 seconds) |
08:21:40 | * | Cthalupa joined #nim |
08:31:11 | * | Cthalupa quit (Ping timeout: 276 seconds) |
08:37:19 | * | theelous3_ joined #nim |
08:42:21 | * | Cthalupa joined #nim |
08:43:54 | * | kevin joined #nim |
08:44:16 | * | kevin is now known as Guest60429 |
08:52:03 | * | floppydh joined #nim |
08:54:12 | * | solitudesf quit (Ping timeout: 265 seconds) |
08:56:40 | * | Cthalupa quit (Ping timeout: 252 seconds) |
08:58:10 | * | Vladar joined #nim |
09:02:41 | * | Cthalupa joined #nim |
09:10:51 | * | Cthalupa quit (Ping timeout: 240 seconds) |
09:13:32 | * | jjido joined #nim |
09:19:05 | * | ng0 joined #nim |
09:21:53 | * | kevin_ joined #nim |
09:22:52 | * | kevin_ quit (Client Quit) |
09:29:39 | * | Cthalupa joined #nim |
09:36:11 | * | Cthalupa quit (Ping timeout: 250 seconds) |
09:39:54 | PMunch | Hmm, how do I declare that a field in an object is a pointer to a function in C? |
09:40:54 | FromDiscord | <mratsim> @Araq, @GordonBGood, what's this with non-functionning shallow? Would that break this? https://github.com/mratsim/Arraymancer/blob/a555fae806c5f795d4f664ca1eefd945d413933b/src/tensor/data_structure.nim#L21-L30 |
09:41:46 | Araq | depends on what you need the .shallow for |
09:41:58 | FromDiscord | <mratsim> for reference semantics of sequences |
09:42:25 | Araq | use a refseq[T] instead inside your object |
09:43:18 | FromDiscord | <mratsim> no way around the double indirection? |
09:43:58 | Araq | there is no double indirection, it would be dedicated container that has a refcount inside |
09:44:08 | FromDiscord | <mratsim> ah nice |
09:44:41 | FromDiscord | <mratsim> well it's not critical as the ref seq would only be used for sequences of strings in the future |
09:44:42 | Araq | but I don't want to add an RC to the standard 'seq' because most usages don't need it |
09:44:44 | FromDiscord | <mratsim> see https://github.com/numforge/laser/blob/master/laser/tensor/datatypes.nim#L24-L30 |
09:45:27 | Araq | what we are really doing here is to give you the tools to write your own seq that works as well as the current builtin one, arguably it works better |
09:45:44 | Araq | and that's why allocators.nim is a wrong design |
09:46:29 | Araq | as it does a bunch of runtime dispatches, it's easy to fall into the trap of "one container type that can do everything" |
09:46:32 | FromDiscord | <mratsim> my main issue with the current seq is the allocator 😛 |
09:47:05 | Araq | that's one way of looking at it but IMO the question is "why can't I write my own seq" |
09:48:23 | FromDiscord | <mratsim> Basically the reasons why I want to use raw pointers in the future: |
09:48:24 | FromDiscord | <mratsim> - being able to have zero-copy of NumPy buffers for python interop |
09:48:24 | FromDiscord | <mratsim> - I need a caching allocator. Nothing fancy but a deep learning training loop creates and destroy tensors a lot |
09:49:18 | Araq | as I said, if you write the seq you are free to choose the allocator anyway |
09:49:50 | * | solitudesf joined #nim |
09:51:02 | FromDiscord | <mratsim> yeah that's good for me |
09:51:02 | Araq | I'm looking forward to seqs that use an int32 or smaller for length and capacity |
09:51:48 | FromDiscord | <mratsim> for Picasso, I think I used that. |
09:52:10 | * | Cthalupa joined #nim |
09:52:29 | FromDiscord | <mratsim> I don't think anyone has 2 billions threads on their machine. |
09:52:40 | Araq | yup |
09:57:11 | FromGitter | <alehander42> one thing i dont like |
09:57:21 | FromGitter | <alehander42> is that this means one cant use custom code with his own allocator |
09:57:51 | * | Cthalupa quit (Ping timeout: 250 seconds) |
09:58:00 | FromGitter | <alehander42> e.g. can i just import a lib and run some calls in my bare metal thing telling it "just use my dummy allocator" ? |
10:00:38 | Araq | I dunno why you would want that, nor how it could work, if the library used cudaMalloc maybe it had its reasons |
10:01:43 | Araq | well you can patch the malloc in C fwiw |
10:01:46 | FromGitter | <alehander42> yeah, but most normal code doesnt really care honestly |
10:02:00 | Araq | and libraries should obey to -d:useMalloc |
10:02:13 | FromGitter | <alehander42> i mostly want to be able to somehow override the whole allocation mechanism |
10:02:18 | FromGitter | <alehander42> i dont care how a lot |
10:02:34 | FromDiscord | <mratsim> if allocation pattern i very important, the library author should provide compile-time switch |
10:02:57 | FromDiscord | <mratsim> many C lib offer a USE_JEMALLOC switch for example |
10:02:59 | FromGitter | <alehander42> ok, but e.g. on bare metal, or hobby osdev i dont even have C or malloc |
10:03:21 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:03:24 | FromGitter | <alehander42> i just want to tell nim "all of your alloc / free calls => just redirect them to my memory manager stub" |
10:03:24 | Araq | yeah and mmdisp has a mechansim to turn a globally declared buffer into a heap |
10:03:25 | FromGitter | <alehander42> or something |
10:04:00 | Araq | var heapEmulation: array[N, byte] |
10:04:16 | FromGitter | <alehander42> so i guess, using -d:useMalloc and overriding malloc/free should be the way in those cases |
10:04:19 | Araq | proc alloc(size: int): pointer = addr heapEmulation[heapPtr] |
10:04:22 | FromDiscord | <mratsim> I think however that this has value if we just want to add alloc statistics or debugging info |
10:04:55 | FromGitter | <alehander42> but can i override this in user code ? |
10:05:02 | FromGitter | <alehander42> or do i need to patch my compiler |
10:05:29 | FromGitter | <alehander42> i remember i tried to do something like that but it still didnt quite do it |
10:05:35 | FromGitter | <alehander42> but ill try again when i can |
10:07:07 | Araq | that's the usual programming mysticism |
10:07:34 | Araq | so you don't have the memory for a heap and yet you want to override code that used malloc |
10:08:06 | FromGitter | <alehander42> i do have the memory for a heap |
10:08:12 | FromGitter | <alehander42> i can just define my own malloc |
10:08:24 | FromGitter | <alehander42> i just assumed it would be easier to override stuff directly from nim |
10:09:02 | Araq | it's quite easy, but you need to get dirty and look at lib/system/mmdisp.nim |
10:09:26 | Araq | because I don't want to expose all this via global function pointers |
10:10:50 | Araq | they kill some optimizations and you need quite a few of these, alloc/allocShared/isAllocatedPtr (for the old GCs)/getTotalMem/etc etc |
10:11:54 | FromGitter | <alehander42> yes, i just imagine being able to somehow tell "use this userland module/override" even with a compiler switch, without runtime indirection |
10:11:59 | FromGitter | <alehander42> but not sure how would it work |
10:12:25 | FromGitter | <alehander42> and overally, just patching c_malloc def/mmdisp isnt a big deal of course |
10:13:22 | FromGitter | <alehander42> if it's enough to just run simple nim code with gc directly |
10:14:00 | Araq | in reality there is no alternative over compiler/linker switches |
10:14:11 | Araq | you cannot do kernel development in C without these either |
10:14:31 | Araq | but I agree we can make overriding the memory subsystem easier to do via the command line |
10:15:53 | FromGitter | <alehander42> i agree, overriding on ct is still useful, and even for other subsystems (e.g. profiling hooks etc) |
10:19:48 | * | clyybber joined #nim |
10:20:04 | FromGitter | <alehander42> https://forum.nim-lang.org/t/5421 |
10:21:11 | FromGitter | <alehander42> cool to review |
10:23:28 | clyybber | interesting |
10:23:39 | clyybber | btw alehander42: Your breeze macro is very cool |
10:23:56 | * | tklohna_ quit (Ping timeout: 252 seconds) |
10:23:56 | clyybber | We should include in the stdlib IMO |
10:24:02 | clyybber | or something akin to it |
10:24:31 | FromGitter | <alehander42> yeah, it just immitates karax, i agree it seems useful |
10:24:52 | FromGitter | <alehander42> but i have to admit i dont really use it, too lazy to install / import it |
10:25:31 | clyybber | heh |
10:26:04 | Araq | oh really? |
10:26:23 | Araq | https://github.com/nim-lang/RFCs/issues/173 |
10:26:33 | FromGitter | <alehander42> but maybe a simpler thing like https://github.com/nim-lang/Nim/pull/7508#issuecomment-434027201 |
10:26:34 | Araq | means I'm onto something here :P |
10:26:45 | FromGitter | <alehander42> i knew that you would count it |
10:26:48 | FromGitter | <alehander42> as an argument :P |
10:27:02 | Araq | it was an argument in its favor |
10:27:23 | Araq | don't you agree? |
10:27:30 | FromGitter | <alehander42> well, i often use some other libs, like chronicles, args parsing stuff, etc |
10:27:46 | FromGitter | <alehander42> so i'd say that its more like , trying to use less dependencies if i can |
10:28:25 | FromGitter | <alehander42> if a library is really worth saving me work, its no problem to add it |
10:28:27 | * | Cthalupa joined #nim |
10:28:33 | clyybber | Araq: I generally agree, but in this case it would be cooler to have it baked in the stdlib because it's just so much more handy and everyone should profit. |
10:29:43 | clyybber | Araq: Btw do you have an idea what could cause 'Error: cannot eval at compile time' for code that I transformed/generated in transf.nim? |
10:30:05 | clyybber | It works when I compile the code manually. |
10:30:08 | Araq | not really but the VM also uses transf.nim, beware |
10:30:39 | Araq | clyybber, ok, so how do we add it the stdlib? just do it and live with the fallout? |
10:30:54 | clyybber | Araq: Yeah? What fallout? |
10:31:02 | Araq | put under std/experimental so we garantee to break it eventually? |
10:31:22 | Araq | put it under std/ because it *might* become a stdlib? |
10:31:45 | clyybber | Yeah |
10:31:55 | Araq | the idea is that the stdlib adopts battle-tested code |
10:32:01 | FromGitter | <alehander42> it's quite possible to change api i agree |
10:32:08 | FromGitter | <alehander42> that it needs to be played with more |
10:32:22 | Araq | C++ does it via Boost, first it's in Boost, later on in the stdlib |
10:32:52 | FromGitter | <alehander42> but i think more that |
10:33:08 | FromGitter | <alehander42> a better solution usually is just to make "very useful" libs |
10:33:20 | FromGitter | <alehander42> e.g. i wouldnt always install breeze |
10:33:30 | Araq | that works for some code, yes, but not for others |
10:33:33 | FromGitter | <alehander42> just for 1-2 cleaner things |
10:33:43 | Araq | for example, I would love to use your for-loop-expression stuff |
10:33:46 | FromGitter | <alehander42> but i would install very often a more general "macro niceties" lib |
10:33:53 | Araq | but I don't want to depend on it |
10:34:11 | FromGitter | <alehander42> well, you cant use something without depending on it |
10:35:14 | Araq | but the dependency is exposed, I can write Karax example code that uses for loop expressions, and then karax depends on your package, but |
10:35:26 | Araq | a) it doesn't *really* depend on your package, only some example code |
10:35:27 | Araq | and |
10:35:58 | Araq | b) if everybody would take this stance we get bloat and slow 'nimble install x' commands |
10:36:07 | FromGitter | <alehander42> actually i remember https://github.com/alehander42/comprehension/pull/1/files seemed as a better impl, i just copied the idea of some araq macro and prototyped that |
10:36:22 | Araq | not too mention that the chance of Nimble failing due to networking errors increases etc etc |
10:36:35 | FromGitter | <alehander42> yeah, but thats kinda my point |
10:36:53 | FromGitter | <alehander42> it's more worth it, if those things are in bigger libs |
10:36:56 | FromGitter | <alehander42> which have more usages |
10:37:18 | * | Cthalupa quit (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in) |
10:37:23 | clyybber | Hmm, I don't agree |
10:37:33 | FromGitter | <alehander42> e.g. comprehension could be in something like "functional" or extra_sugar lib |
10:37:38 | clyybber | I much rather pull in simple small libs that do one thing and do it right |
10:37:41 | FromGitter | <alehander42> or breeze could be in macroutils |
10:37:42 | FromGitter | <alehander42> libs |
10:37:56 | FromGitter | <alehander42> interesting, so thats subjective |
10:38:16 | Araq | it's not really, count how often 'sequtils' is used in the wild |
10:38:25 | FromGitter | <alehander42> a lot? |
10:38:33 | Araq | move it into its own Nimble package and see how it's used then. |
10:38:38 | Araq | *how often |
10:39:00 | FromGitter | <alehander42> well, if a thing like sequtils was totally missing from the stdlib, it would be a pretty popular package |
10:39:11 | Araq | but the effect is real, people avoid dependencies. |
10:39:28 | FromGitter | <alehander42> look at stuff like parsing arguments, testing libs , logging libs, benchmarking libs |
10:39:28 | Araq | I do, you just admitted that you do it. |
10:39:36 | FromGitter | <alehander42> people install them |
10:40:10 | FromGitter | <alehander42> but i dont avoid dependencies: i love adding them, i avoid minimal dependencies which i can do without |
10:40:25 | clyybber | Well its the opposite for me. I don't like dependencies |
10:40:31 | FromGitter | <alehander42> which is very subjective as we saw:clybber is the opposite |
10:43:42 | clyybber | But a dependency small enough that I can just copy the file into my project is nice |
10:43:42 | clyybber | I also don't like that nimble just installs the packages into .nimble |
10:43:43 | FromGitter | <alehander42> i just dont think this is true at all: look at all ecosystems, go, java, rust, c#: package managers and dependencies are all the rage |
10:43:43 | clyybber | Instead of where I use them as dependencies |
10:43:43 | FromGitter | <alehander42> but people just try to install those that are worth it imo |
10:43:43 | * | Cthalupa joined #nim |
10:43:43 | FromGitter | <alehander42> as a pushback to the npm thing |
10:43:43 | clyybber | Yeah and worth it is IMO |
10:43:43 | * | filcuc quit (Excess Flood) |
10:43:43 | clyybber | small library that I can myself understand and because of its small size is unlikely to break or have to be updated |
10:43:44 | * | filcuc joined #nim |
10:43:44 | FromGitter | <alehander42> even in c++ people are really experimenting with improving package management somehow |
10:43:44 | Araq | you are happy with dependencies and yet your actions contribute to the effect anyway, people avoid deps. |
10:43:44 | Araq | I think it's hard to argue against it. but you can argue that we don't have to do anything about it. |
10:44:09 | FromGitter | <alehander42> but from what i see, people in all language communities like reasonable dependencies |
10:44:23 | FromGitter | <alehander42> 3rd party libs are thriving even in c++ |
10:45:32 | FromGitter | <alehander42> i think the python science distributions are the only good example |
10:45:45 | FromGitter | <alehander42> of lang specific distros i remember right now |
10:46:03 | FromGitter | <alehander42> so its good to have this mechanism, but i'd guess needs just vary a lot |
10:46:17 | FromGitter | <alehander42> e.g. even in web, you can imagine 5 teams using 5 different combos of |
10:46:24 | clyybber | alehander42: Why would I import some big lib only to use one macro from it? |
10:46:37 | FromGitter | <alehander42> template engine + orm + rest api lib |
10:47:33 | FromGitter | <alehander42> clyybber, you maybe wont, but if you have small lib a, small lib b and small lib c, imo i'd install abc which just does it all instead of |
10:47:44 | clyybber | But why? |
10:47:44 | FromGitter | <alehander42> installing only a for only one thing |
10:48:03 | FromGitter | <alehander42> because abc would do more stuff for me |
10:48:24 | FromGitter | <alehander42> in the same way, i'd use sequtils, not seqmaputils + seqfilterutils + seqcount |
10:48:33 | * | Guest60429 quit (Quit: Leaving) |
10:49:02 | clyybber | Doing more stuff as in: Requiring more maintenance, updates and in general being harder to understand |
10:49:06 | FromGitter | <alehander42> e.g. for stuff like breeze, i imagine if a macroutils has 4-5 similarly useful things |
10:49:26 | FromGitter | <alehander42> a lot more people would have at least 1-2 which are useful, so it would have more interest, more maintenance, more bugfixes |
10:49:37 | FromGitter | <alehander42> and overally it would move better |
10:49:43 | clyybber | Hmm |
10:49:55 | clyybber | I don't think so, but we are both speculating here L) |
10:50:11 | FromGitter | <alehander42> its a bit like npm: left pad is just too specific |
10:50:18 | FromGitter | <alehander42> but if it was a stringutils_plus |
10:50:31 | FromGitter | <alehander42> a lot more people would be like "ah this makes sense" |
10:50:36 | clyybber | I think the linux ecosystem perfectly shows that things that are small and simple are just more reliable |
10:50:39 | FromGitter | <alehander42> but i agree this is subjetive |
10:50:54 | FromGitter | <alehander42> oh dont use this argument in front of araq |
10:51:03 | FromGitter | <alehander42> this example* |
10:51:08 | Araq | look I don't really care how we do it, but in the end a process for PRs against the stdlib is a nice thing |
10:51:18 | clyybber | I agree |
10:51:57 | FromGitter | <alehander42> i think a distribution mechanism is useful, but maintaining the actual distros should be left to people who are interested |
10:52:06 | FromGitter | <alehander42> now if araq just likes to do it, nothing wrong with that |
10:52:22 | WilhelmVonWeiner | there's no null equivalent in Nim is there |
10:52:24 | FromGitter | <alehander42> otherwise, pr-ing against the stdlib can just be done with rfc-s |
10:52:27 | clyybber | alehander42: See the suckless tools for example |
10:52:33 | Araq | but I don't care about distribution*s* |
10:52:45 | FromGitter | <alehander42> but then rfc-s are enough |
10:52:45 | Araq | I only want a single one |
10:53:01 | Araq | I fear multiple distributions |
10:53:02 | FromGitter | <alehander42> but give an example |
10:53:05 | FromGitter | <alehander42> what would it include |
10:53:25 | Araq | cligen, comprehensions, nim-regex |
10:53:42 | FromGitter | <alehander42> because for most things you have 2-3 choices, so e.g. i want to use the distro, but i like 8/10 packages from it and dislike 2 |
10:54:08 | federico3 | what a weird conversation |
10:54:27 | FromGitter | <alehander42> ok, cligen has nim-argparse / confutils |
10:54:33 | FromGitter | <alehander42> as alternatives |
10:54:40 | Araq | maybe 'nimly' but I haven't reviewed it |
10:55:08 | FromGitter | <alehander42> nimly seems cool, but npeg is also developing ok |
10:55:19 | federico3 | alehander42, clyybber: the problem is not simply about number and size of build and runtime dependencies, rather the tradeoff between risks (vulns, other bugs, libs being abandoned) and the benefits |
10:55:31 | FromGitter | <alehander42> i just find it hard to make those decisions |
10:56:18 | FromGitter | <alehander42> federico3 well, this is again subjective: a bigger lib might be less likely to be abandoned, but a bigger risk because of its importance |
10:56:54 | clyybber | frederico3: Exactly. And a simple dependency that fits in one file and is easy to understand is just better in those regards than a big package that I have to update regularily for these things. |
10:57:00 | clyybber | IMO |
10:57:12 | FromGitter | <alehander42> but i dont understand the need of distribution: if a lib is popular, even if it gets abandoned, people can step in, fork and continue |
10:57:16 | federico3 | alehander42: it depends on where it comes from - is it one developer only or many? Does it has a track record of being maintained or just few months? |
10:57:45 | FromGitter | <alehander42> ok, so one can use some kind of metrics index or stats |
10:57:56 | clyybber | frederico3: Look at this for example: https://github.com/Earnestly/sx/blob/master/sx |
10:58:04 | federico3 | you don't measure the reliability of some hardware by simply weighting it |
10:58:10 | clyybber | this doesn't need much mainetnance because its simple |
10:58:20 | clyybber | As opposed to startx + xinit |
10:58:34 | FromGitter | <alehander42> i agree, but a better measurement is then its popularity and reviews/issues |
10:58:34 | clyybber | Which it replaces |
10:58:42 | FromGitter | <alehander42> you take a look at the people that already use it |
10:58:46 | FromGitter | <alehander42> and make your mind |
11:00:01 | clyybber | alehander42: Also look at it that way, simple small self contained packages are unlikely to add many dependencies themselves, avoiding dependency hell. |
11:00:13 | clyybber | But it depends on the people who write them of course. |
11:00:19 | FromGitter | <alehander42> but they are just not that useful |
11:00:22 | FromGitter | <alehander42> because they're small |
11:00:22 | federico3 | clyybber: obviously avoiding bloat is always a good thing but there's more to that |
11:00:34 | FromGitter | <alehander42> after all, i use dependencies to do complicated stuff instead of me |
11:00:44 | clyybber | alehander42: Breeze looks immensily useful, and its small |
11:01:04 | FromGitter | <alehander42> ok, but you cant write a fast parser generator in 50 lines |
11:01:24 | FromGitter | <alehander42> or a flexible web framework |
11:01:38 | FromGitter | <alehander42> or a physics engine etc |
11:01:39 | clyybber | alehander42: Fair enough, but I also wouldn't want to import a parser generator that does more than being a parser generator |
11:01:56 | * | jjido joined #nim |
11:01:57 | clyybber | alehander42: Similarily I want a physics engine to be a physics engine and no more. |
11:02:02 | FromGitter | <alehander42> yeah, there is a limit i agree |
11:02:07 | FromGitter | <alehander42> my point was not to overdo it |
11:02:14 | FromGitter | <alehander42> maybe the best thing is to have both |
11:02:17 | federico3 | clyybber: I wish it was so simple. They are called "libraries" because we often want a large set of tools in one package |
11:02:26 | FromGitter | <alehander42> little packages which do minimal things, and toolkits |
11:02:31 | FromGitter | <alehander42> which combine them |
11:02:32 | clyybber | Then I want books :) |
11:03:02 | clyybber | A physics engine is obviously one really large book, since all parts collide, interact with each other |
11:03:08 | federico3 | clyybber: careful: that creates the npm disaster |
11:03:42 | clyybber | frederico3: I trust in nimble to be cumbersome enough to use that this wont happen :p |
11:03:56 | federico3 | one thing that many ecosystem keep forgetting are optional dependencies |
11:03:59 | clyybber | No but really, NPM is the thing I am most afraid of. |
11:04:34 | FromGitter | <alehander42> i just think we'll have two trees of libs: ones which are more modular combining small ones |
11:04:36 | clyybber | But I think nim targets a different audience and thus we will hopefully not end up with such bs |
11:04:38 | FromGitter | <alehander42> and one which are monolithic |
11:04:40 | federico3 | clyybber: it's already happening. We have some tiny packages and nimble is still not giving warnings when publishing them |
11:04:47 | FromGitter | <alehander42> its just a different approach to stuff |
11:05:09 | FromGitter | <alehander42> federico3 but sometimes you really can do something useful in 20 line package |
11:05:10 | clyybber | frederico3: Care to give examples? |
11:05:18 | FromGitter | <alehander42> its impossible to automatically |
11:05:19 | federico3 | alehander42: optional dependencies gives you the best of both worlds |
11:05:21 | FromGitter | <alehander42> catch those |
11:05:39 | FromGitter | <alehander42> but for optional deps, you need an alternative |
11:05:52 | federico3 | alehander42: sure - and that why people put the 20 SLOC in a *library* :) |
11:06:24 | FromGitter | <alehander42> well, if they really can reuse them in 5 other projects |
11:06:25 | FromGitter | <alehander42> why not |
11:06:34 | federico3 | alehander42: huh? alternative? |
11:06:58 | FromGitter | <alehander42> well, i decide not to install my_optional_dep |
11:07:02 | FromGitter | <alehander42> how does the code work |
11:07:11 | FromGitter | <alehander42> i just dont understand this mechanism |
11:07:16 | clyybber | Yeah optional dependencies aren't the solution IMO |
11:07:21 | clyybber | If I understand that right |
11:07:31 | federico3 | they are a very good solution |
11:07:33 | FromGitter | <alehander42> i imagine i need to have another dependency which has the same api |
11:08:16 | Araq | I don't understand "optional dependencies", it's like "my wife is a little bit pregnant" |
11:08:18 | federico3 | what you want to avoid is having to pull a large tree of deps where many of the leaf nodes are not useful to you and only cost you (in terms of risk and bloat) |
11:08:46 | FromGitter | <alehander42> i agree with araq, i just dont get how they work |
11:09:06 | federico3 | now, your application A might depend on B that depend on C that depends on D,E,F,H |
11:09:10 | FromGitter | <alehander42> tree shaking? |
11:09:28 | FromGitter | <alehander42> ok |
11:09:42 | federico3 | the developer of C can set, for example, E, and H as optional, based on feature that might be needed or not |
11:09:48 | clyybber | alehander42: Actually I might have to refine my point a bit. I don't have a problem with a package like macroutils or something that includes breeze. But I would want breeze to be easily importable without importing all the other stuff I wont use. So breeze should be in its own single file. |
11:09:51 | federico3 | (for example my httpauth package) |
11:09:57 | * | vsantana joined #nim |
11:10:37 | FromGitter | <alehander42> but how does nimble knows if i would use this feature, like where do i make the decision to include them or not |
11:10:45 | clyybber | alehander42: Though then again one could just create a meta-package macroutils which includes breeze and other stuff. |
11:10:52 | federico3 | and by default E, F, H are not installed. They are controlled with a define, or even better, by a proper mechanism in Nimble that is not implemented yet |
11:10:58 | clyybber | And breeze would be its own pkg on nimble too. |
11:11:38 | clyybber | alehander42: Seems like the solution to all of this is to leverage the hierarchical tree structure of filesystems a bit more. |
11:11:43 | FromGitter | <alehander42> clyybber, but thats why a single package would be better: the maintainer still does less work, as he needs to just maitnain one repo, not several |
11:11:54 | FromGitter | <alehander42> and you can still import just one of the files |
11:11:56 | federico3 | having to mock out or replace dependencies is a common problem in distributions |
11:12:21 | FromGitter | <alehander42> federico3 makes sense, but this requires good lib author discipline |
11:12:41 | clyybber | alehander42: Hmm, but how is maintaining a single repo easier than multiple? |
11:12:47 | FromGitter | <alehander42> its one |
11:12:50 | FromGitter | <alehander42> not 5 + 1 |
11:12:50 | clyybber | I actually find its the opposite. |
11:12:53 | federico3 | alehander42: that's why some languages introduced optional dependencies in the packaging tools |
11:13:02 | clyybber | I commit a change to breeze and push it. Boom done. |
11:13:13 | FromGitter | <alehander42> well, otherwise i need to bump versions, do releases , fix nimble dependencies |
11:13:26 | FromGitter | <alehander42> yeah, but imagine bumping macroutils every time |
11:13:30 | federico3 | alehander42: and nothing could prevent Nimble from encouraging optional deps |
11:13:34 | FromGitter | <alehander42> i change any of the small libs |
11:13:37 | Araq | https://youtu.be/sBP17HQAQjk?t=1078 argues convingingly IMHO that optional deps are a bad idea |
11:13:54 | clyybber | optional dependencies are not good IMO |
11:14:54 | clyybber | In a slightly different context: Optional dependencies in linux pkg managers are also kinda annoying since they stick around forever. |
11:15:37 | federico3 | Araq: thanks I'll watch the video later |
11:15:45 | clyybber | alehander42: Yeah and I have to get the whole monorepo in a functional state before releasing |
11:16:09 | clyybber | With multiple repos I can just update the different parts seperately |
11:16:11 | federico3 | clyybber: they are usually inevitable |
11:16:34 | clyybber | federico3: Look at xbps |
11:16:41 | clyybber | It avoids them entirely |
11:16:49 | clyybber | And its just so much better than lets say pacman |
11:17:23 | clyybber | I install pkg A. It pulls in some dependencies. I uninstall it. It removes all dependencies. |
11:17:28 | federico3 | it has virtual packages in the list of features |
11:17:32 | * | abm joined #nim |
11:17:39 | clyybber | federico3: Yeah? |
11:17:48 | clyybber | But those arent optional dependencies.. |
11:18:00 | FromGitter | <alehander42> interesting talk |
11:18:07 | federico3 | it's quite similar |
11:18:17 | clyybber | federico3: No, its really not. |
11:18:21 | federico3 | (besides, pacman is not a good example) |
11:18:32 | FromGitter | <alehander42> so his point seems to be if its needed, just release a library C_ which uses the optional E + H |
11:18:39 | FromGitter | <alehander42> and depends on your C |
11:18:41 | FromGitter | <alehander42> which doesnt |
11:18:51 | federico3 | clyybber: "similar", not identical |
11:19:05 | clyybber | federico3: Not even similar. |
11:19:47 | federico3 | it allows switching between alternatives that provide the required features |
11:20:00 | clyybber | Hmm |
11:20:05 | FromDiscord | <mratsim> I want to have my libraries optionally depend on quicktest for property-based testing, cuda stuff for GPU programming, a fuzzer for fuzzing. What do I do? |
11:20:18 | federico3 | which is often used to migrate away from a dependency that has problems (e.g. bloat, vulnerable, abandoned) |
11:20:30 | clyybber | federico3: Ah, so thats the kind of optional dependencies you are talking about.. |
11:21:03 | clyybber | federico3: I was talking about optional dependencies with those options: They are installed.\ THey are not. |
11:21:14 | Araq | I suspect we're talking about separate things |
11:21:15 | federico3 | clyybber: that is one way of loosesing the dependencies |
11:21:19 | FromGitter | <alehander42> mratsim this reminds me, i wanted to stop quicktest from depending always on unittest |
11:21:35 | clyybber | federico3: IMO that only works here, because they adhere to standards |
11:21:44 | FromGitter | <alehander42> and make it depend on whatever implements the same api |
11:21:50 | clyybber | Like I can swap out my driver, but it still implements opengl |
11:21:56 | federico3 | clyybber: that's another way. The end goal is not to have a unweildy tree of dependencies |
11:22:11 | FromDiscord | <mratsim> @alehander42, I don't mind. I fear unittest putting everything in the global space creates stack overflow issue |
11:22:32 | federico3 | clyybber: in the case of the swap, yes it still implements opengl but perhaps the replacement is leaner, or better mantained, or more secure and so on |
11:22:40 | FromGitter | <alehander42> i actually wrote my own mini async unittest which just uses procs, so almost no global space stuff |
11:22:46 | FromDiscord | <mratsim> quicktest should probably autowrap everything in procs so that tests are not using global stack variables |
11:22:52 | FromGitter | <alehander42> like, it generates procs from `test` |
11:22:54 | FromDiscord | <mratsim> which is an issue with seq for example |
11:23:11 | FromGitter | <alehander42> but not sure if this breaks many unittest workflows |
11:23:28 | federico3 | clyybber: and perhaps if you had optional dependencies that you can drop with a flag you could have removed an unneded feature more easily that having to introduce an alternative |
11:23:41 | clyybber | federico3: Yeah, I am not opposed to your idea anymore. Its just that I initially thought you were referring to another kind of optional dependenies |
11:23:49 | FromGitter | <alehander42> quicktest still depends on having `check`, and i am not sure `check` would work in a proc |
11:24:14 | FromDiscord | <mratsim> check is a really basic templates though |
11:24:18 | FromGitter | <alehander42> basically, one has to either fix unittest, or use quicktest with custom unittestlike-lib (which is what i do) |
11:24:22 | clyybber | federico3: But optional dependencies are definitely much more complex and don't solve the same problems as just in general having more KISS kind of packages. |
11:24:28 | FromGitter | <alehander42> or make quicktest easy to use with a custom api |
11:24:39 | federico3 | clyybber: there are many forms of flexibility in the compile time and runtime dependencies. |
11:24:41 | FromGitter | <alehander42> mratsim it is easy to replicate in basic sense |
11:24:55 | FromGitter | <alehander42> but not so easy to do in its original idea |
11:25:12 | clyybber | alehander42: One example is laser, its a bunch of things, but I don't mind since they are seperated in a sane way. |
11:25:18 | FromGitter | <alehander42> it should be able to show you intermediate values of subexpressions in check |
11:25:36 | FromDiscord | <mratsim> well, we are considering moving away from unittest: https://github.com/stefantalpalaru/nim-unittest2 |
11:25:52 | FromGitter | <alehander42> which should be improved: overally fixing stdlib unittest should be ok |
11:25:59 | FromGitter | <alehander42> hm parallel run, awesome |
11:26:06 | FromGitter | <alehander42> we argued with araq several days ago |
11:26:14 | FromGitter | <alehander42> as he likes testamenet parallelisms |
11:26:31 | FromDiscord | <mratsim> well, the gain from parallelism in our use case was actually minimal somehow |
11:26:31 | FromGitter | <alehander42> how do you plan to do parallell runs in unittest2 ? |
11:26:42 | clyybber | Theres a PR up |
11:26:46 | clyybber | Or there was |
11:27:24 | * | Cthalupa quit (Ping timeout: 246 seconds) |
11:27:36 | FromGitter | <alehander42> mratsim but is your test cpu bound |
11:27:48 | FromGitter | <alehander42> i suspect multithreading helps mostly for io-bound tests |
11:28:01 | FromGitter | <alehander42> oh wait, multicore machines |
11:28:23 | FromGitter | <alehander42> still, threads always run on the same cpu right |
11:28:40 | FromDiscord | <mratsim> well, in our case we were running into Travis timeout |
11:28:40 | FromGitter | <alehander42> so i wondered if there is a way to directly map tests on all cores |
11:29:21 | FromGitter | <alehander42> if you think about it, usually libs have many test files, maybe just running them on each core in the same time would be easier |
11:29:24 | FromDiscord | <mratsim> and Travis machines only have 2 or 3x cores iirc, but the time consuming parts might have been alone in a file and so not parallelized |
11:29:50 | FromDiscord | <mratsim> so yes we might need to do the testament way, one file per test, easier to parallelize |
11:30:01 | * | Cthalupa joined #nim |
11:30:14 | FromGitter | <alehander42> well, you can have a "small" amount per file |
11:30:29 | FromGitter | <alehander42> keep in mind the compile time gets much slower sometimes |
11:30:34 | FromGitter | <alehander42> for 5x tests |
11:30:46 | FromDiscord | <mratsim> or maybe we can have a pragma and on compilation, a table collects all of those and create a pool of task to run |
11:30:48 | FromGitter | <alehander42> but i dont understand why multithreading would make a cpu bound test faster |
11:31:05 | FromGitter | <alehander42> yeah, something like the last one seems fun and imo fastest |
11:31:10 | FromDiscord | <mratsim> because you run multiple CPU bounds test on different cores |
11:31:10 | federico3 | alehander42: huh? |
11:31:11 | FromGitter | <alehander42> as you can still compile just once |
11:31:20 | FromGitter | <alehander42> and get parallelism |
11:31:22 | federico3 | unless you have only one core |
11:31:37 | FromGitter | <alehander42> yeah, well, i am just not good at multithreading , trying to learn |
11:31:57 | FromDiscord | <mratsim> it's IO tests that won't get faster with multicore, because you might saturate your memory or disk bandwidth |
11:32:05 | * | lritter joined #nim |
11:32:16 | FromGitter | <alehander42> so i assumed a process runs its threads on the same core |
11:32:22 | FromGitter | <alehander42> thats not true? |
11:32:26 | federico3 | not at all |
11:32:34 | federico3 | perhaps you are thinking about the GIL in python :) |
11:34:12 | FromDiscord | <mratsim> that's true for coroutines/green threads/fibers/async but that is concurrency. |
11:34:27 | FromDiscord | <mratsim> Multithreading is about distributing thread on multiple cores |
11:34:42 | * | sealmove joined #nim |
11:34:52 | FromGitter | <alehander42> ah embarrasing, i got confused because of the shared memory |
11:34:58 | sealmove | hi, is there a way to tell the compile to not print errors at stdout/stderr? |
11:35:05 | FromGitter | <alehander42> but i forgot all cores share the same memory |
11:35:26 | FromGitter | <alehander42> like, you dont have 8 RAM blocks |
11:35:29 | FromGitter | <alehander42> oh well |
11:36:11 | FromGitter | <alehander42> so yeah, in this case multithreading unittest must be cool |
11:36:40 | federico3 | alehander42: sharing memory is a different topic (e.g. multithreading on numa) |
11:37:16 | FromGitter | <alehander42> yeah, i meant i really imagined each cpu has its own memory, so when you move a thread you have to copy it |
11:37:18 | federico3 | I ended up spawning threads or processes from unittest often |
11:37:26 | FromGitter | <alehander42> but if i think about it, obviously you have one memory |
11:37:40 | FromGitter | <alehander42> i really got this confused |
11:37:58 | federico3 | but you have independent caches and locking mechanisms to sync them... |
11:38:08 | FromGitter | <alehander42> well, yeah |
11:38:17 | FromGitter | <alehander42> i guess there is a limit |
11:38:27 | FromGitter | <alehander42> for small/fast suites, it is not worth it to parallelize |
11:38:36 | FromGitter | <alehander42> so one should just benchmarks his own tests |
11:38:54 | FromGitter | <alehander42> and have a `--parallel` flag |
11:39:38 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:39:49 | federico3 | tools like pytest's xdist are clever enough to decide what to do |
11:42:29 | federico3 | but Nim's effect system could be even used to track test relations and "cache" successful unit tests |
11:48:47 | * | vsantana quit (Remote host closed the connection) |
11:49:00 | * | rockcavera joined #nim |
11:52:38 | * | nc-x joined #nim |
11:53:51 | nc-x | looks like haxe is planning to implement the z3 idea as well https://github.com/HaxeFoundation/haxe/issues/8905 |
11:54:25 | * | drewr quit (Ping timeout: 250 seconds) |
12:04:14 | * | seni joined #nim |
12:04:55 | * | nc-x quit (Ping timeout: 260 seconds) |
12:05:56 | clyybber | Araq: This is the difference: The left side fails to evaluate in the VM, the right doesn't. |
12:08:08 | clyybber | It's not obvious to me what causes this difference.. |
12:08:16 | * | tklohna_ joined #nim |
12:09:14 | federico3 | nc-x[m]: very nice |
12:14:27 | clyybber | nc-x[m]: Btw: https://github.com/RapidFingers/Craxe |
12:15:15 | Araq | sealmove, --verbosity:0 maybe |
12:24:59 | * | sealmove quit (Quit: WeeChat 2.6) |
12:40:53 | * | jjido joined #nim |
12:48:43 | clyybber | Araq: I'm all for a template that allows us to use inplace operations as non-destructive procs. |
12:49:03 | clyybber | I would love to have it in a dot-operator |
12:49:55 | clyybber | .~ or .> or .& or some other variant |
12:50:22 | clyybber | alehander42: Wdyt fits/looks best? |
12:52:13 | clyybber | or .* |
12:53:17 | * | Hideki_ joined #nim |
12:53:47 | FromDiscord | <mratsim> I already use the dot .* notation in Arraymancer |
12:54:05 | FromDiscord | <mratsim> however I don't know the context |
12:54:59 | clyybber | mratsim: Its about using inplace procs like `shuffle(var seq)` like so `echo someseq.~shuffle |
13:02:04 | narimiran | @mratsim yes you do, you incompetent idiot!! :D :D |
13:03:13 | narimiran | (people who don't read forum frequently won't get that reference) |
13:03:39 | clyybber | (i don't know that reference, and won't sleep tonight) |
13:03:44 | clyybber | (thanks narimiran) |
13:03:50 | narimiran | clyybber: :D |
13:04:16 | narimiran | congrats, you just received the meta-referencing badge |
13:05:24 | FromDiscord | <mratsim> lua uses ":" for chaining that |
13:06:31 | FromDiscord | <mratsim> yeah tough luck, I didn't get .* precedence right so I'm incompetent. |
13:16:19 | federico3 | Araq: saw the video: the speaker recommends not making many different builds but rather "provide optional features as separate libraries with separate builds" with really sounds like optional runtime dependencies |
13:20:30 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:25:34 | Araq | federico3, I suspected it's a matter of definitions |
13:26:41 | Araq | *. has *'s precedence, it's a pretty simple system |
13:27:31 | federico3 | optional [build|runtime] dependency: a library that is not always present at [build|runtime] (respectively) :) |
13:28:04 | Araq | package A' uses package A and B. |
13:28:07 | Araq | instead of: |
13:28:23 | Araq | package A depends on B, optionally. |
13:28:32 | Araq | seems to me quite a difference tbh |
13:30:56 | * | jjido joined #nim |
13:32:00 | federico3 | in your example you imagine generating a binary with A' that uses A and B |
13:32:47 | federico3 | and perhaps have another A" that shares the same codebase as A' and uses only A? |
13:34:15 | Araq | I'm not following you. |
13:35:02 | Araq | the point is that when you have 1 (!) "optional" thing, you get a multiplier by 2 (you need to test it with and without) and the "option" is exposed via some flag |
13:35:14 | Araq | this flag can then bubble up |
13:35:30 | federico3 | sure |
13:35:36 | Araq | and so does the multiplier and soon you have x 2 x 3 x 2 x 2 and the test matrix explodes |
13:35:43 | federico3 | sure |
13:36:19 | Araq | and when you say "optional packages are really good, let's have them", it seems like you're advocating for these multipliers but it's intractable |
13:36:27 | federico3 | ...but there is no free lunch here |
13:38:27 | * | EvilKhaosKat joined #nim |
13:39:53 | clyybber | Araq: I figured out the problem. The VM successfully generates the snippet if I flag the :tmpO sym as sfGlobal.. |
13:40:01 | federico3 | if you want to allow pruning the dependency tree either at compile time or at runtime using dinamic linking you end up having the 2^n configurations in the worst case. Yet you usually restrict the problem space and refuse to compile unneded combinations |
13:40:26 | * | dddddd joined #nim |
13:40:27 | FromGitter | <deech> Can anyone point me to documentation on the best way to do `ref` copying? So for example given some `ref` `r` and a field `intLists: seq[seq[int]]` and a new `ref`, `r1`, does `r1.intLists = r.intLists` do a deep copy? |
13:41:47 | federico3 | Instead of flags you can have a different, alternative metapackagages that provide the same tool or lib with different dependencies, but that's just another way of picking subsets of 2^n |
13:41:59 | * | Cthalupa quit (Read error: Connection reset by peer) |
13:42:24 | * | Cthalupa joined #nim |
13:43:05 | FromGitter | <alehander42> clyybber cool idea |
13:43:11 | FromGitter | <alehander42> but not sure how often this comes up |
13:43:53 | clyybber | Araq: But thats kinda bad, because now all temps are global.. https://github.com/nim-lang/Nim/blob/e0d13abaff1192ae6b1f4ae5cd89ae742627b680/compiler/vmgen.nim#L1646 this is where it fails without the sfGlobal flag. |
13:44:12 | clyybber | Should I instead change that condition? |
13:44:37 | clyybber | Not sure what logic the VM is following there, so I need some advice |
13:44:46 | Araq | clyybber, unfortunately I don't understand your problem |
13:45:15 | Araq | deech: refs are pointers and so only the pointers are copied, 'x = y' vs 'x[] = y[]' |
13:45:31 | Araq | (where [] is Nim's pointer deref syntax, it's rarely used) |
13:46:17 | Araq | it's very much like in C except that we write x.f instead of x->f (thouh x[].f also works) |
13:47:35 | * | Cthalupa quit (Ping timeout: 265 seconds) |
13:47:41 | federico3 | besides, the 2^n problem is almost a subset of the much larger space when building your package against dependencies at different versions |
13:48:42 | Araq | the 2^n problem can be mitigated by "make up your mind, don't try to depend on X, either do depent or don't" |
13:49:09 | Araq | and that's precisely what Nimble does by not supporting "optional dependencies" |
13:49:21 | clyybber | Araq: I made a small showcase: https://hastebin.com/okuhukagow.m |
13:49:30 | Araq | though actually I would argue that it does support them already because you can use an 'if' in your nimble file |
13:49:34 | clyybber | The code is from times.nim |
13:49:39 | FromGitter | <deech> Araq, in this example the `seq`'s do seem to be copied: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db843729825bd6bacec5d4b] |
13:50:02 | clyybber | deech: seqs act like value types |
13:50:23 | clyybber | Except for some rare cases (which are bugs afaik) |
13:50:37 | FromGitter | <deech> What are value types? |
13:51:05 | clyybber | Value types are types that are copied when assigned. |
13:51:31 | clyybber | With their contents. |
13:51:39 | clyybber | Like objects |
13:51:50 | clyybber | The "opposite" are ref objects |
13:51:58 | Araq | aha |
13:52:10 | Araq | yeah the logic shouldn't care about skTemp, clyybber |
13:52:23 | Araq | use skTemp, not skVar |
13:52:31 | Araq | and then it should be fine |
13:52:46 | clyybber | Araq: I do use skTemp. |
13:53:04 | clyybber | So I need to patch vmgen? |
13:54:11 | Araq | looks like it |
13:55:08 | clyybber | Hmm, I'll have no idea what I am doing, but I'll try :D |
13:55:14 | FromGitter | <deech> clyybber, is there documentation on what types are copied on assignment? |
13:55:30 | clyybber | deech: Everything except ref |
13:55:43 | clyybber | And ptr |
13:55:49 | clyybber | Because they point to something. |
13:55:59 | FromGitter | <deech> clybber: nice, thanks! |
13:56:04 | clyybber | np |
13:56:40 | * | Cthalupa joined #nim |
13:56:47 | planetis[m] | pretty incompetent to relealize that these are open source projects and i am trying to attract contributors that will help. Instead all i get are a#$%%s asking for "measuring perf regression between java and c", asking to implement generics "right now" and comparing performance between vmulpd and vmulsd... |
13:57:15 | lqdev[m] | oh man |
13:57:44 | clyybber | planetis[m]: What project? |
13:57:44 | lqdev[m] | seriously tho, comparing java's performance to c feels pretty retarded |
13:58:46 | planetis[m] | a linear algebra library |
13:59:04 | planetis[m] | Doesnt matter |
13:59:27 | clyybber | planetis[m]: snail? |
13:59:49 | Araq | Java's performance can actually be quite good, even when compared to C (Fortran beats C anyway) |
13:59:50 | narimiran | lqdev[m]: seriously tho, creating a linear algebra library and not care about its performance, feels.... how exactly? |
13:59:52 | planetis[m] | Could be an alt name for it |
14:00:36 | planetis[m] | Narimiran: contributions welcome |
14:00:58 | clyybber | planetis[m]: Where is the reop though? |
14:01:01 | clyybber | repo? |
14:01:03 | narimiran | i use the existing solution: Neo from @andreaferetti |
14:01:15 | narimiran | planetis[m]: ^ |
14:01:28 | narimiran | and i did some contributions there in the past |
14:01:39 | clyybber | planetis[m]: "snail?" was intended as a question since I saw it today on nimble.directory |
14:01:59 | planetis[m] | Then if you need matrix inverse FIRGET IT |
14:02:14 | planetis[m] | *Forget |
14:02:25 | FromGitter | <alehander42> how is it called |
14:02:32 | narimiran | https://github.com/b3liever/manu |
14:02:38 | planetis[m] | At least its fast! Right |
14:02:42 | narimiran | https://forum.nim-lang.org/t/5348 |
14:03:05 | planetis[m] | Whatever |
14:03:14 | narimiran | planetis[m]: https://github.com/unicredit/neo#solving-linear-systems |
14:03:37 | FromGitter | <alehander42> ok you got one guy thats a bit rude |
14:03:42 | FromGitter | <alehander42> this happens |
14:04:35 | FromGitter | <alehander42> however i dont agree with "One library is written in Java, other in Nim, you can't compare apples to oranges." |
14:04:38 | planetis[m] | Narimiran: your point is bro? |
14:04:42 | FromGitter | <alehander42> this is literally how all people benchmark |
14:05:08 | FromGitter | <alehander42> they take similar libs in different lang and compare them, as very often there are additional bottlenecks which arent the language-generated code itself |
14:05:11 | narimiran | planetis[m]: my point is that "Then if you need matrix inverse FORGET IT" is not true when it comes to neo. (which i thought it was aimed at) |
14:05:56 | planetis[m] | And what about svd does it have too? |
14:06:09 | Zevv | narimiran: where do I find the Nim CI builds with important packages included? |
14:06:26 | narimiran | planetis[m]: are we gonna play a whack-a-mole until there is something that neo doesn't include? |
14:06:33 | lqdev[m] | narimiran: I'm talking about comparing *overall* performance, not specifically this library |
14:07:10 | narimiran | neo has everything i needed, and i find it simpler than arraymancer, so i use(d) neo because it was best *for me* and my usecase |
14:07:18 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:07:53 | Araq | neo has an interface to Fortran iirc |
14:07:54 | planetis[m] | Right from the start i get people saying me (you actually) "use neo" how about no? You dont like my answer? |
14:08:30 | narimiran | Zevv: e.g. https://ci.appveyor.com/project/dom96/nim/builds/28442597/job/3wjucw03akd2jy4l/tests ? |
14:08:32 | Araq | Zevv, fixed the VM regression |
14:08:41 | Zevv | sweet, thanks! |
14:08:44 | FromGitter | <alehander42> it was an answer to your request "contributions welcome" planetis[m] |
14:08:48 | FromGitter | <alehander42> please, calm down a bit |
14:09:11 | FromGitter | <alehander42> otherwise i think the "no external dependencies to BLAS frameworks." |
14:09:15 | FromGitter | <alehander42> is very cool |
14:09:25 | narimiran | planetis[m]: right from the start people give you the advice because they are enthusiastic about what you have done, but you react like they're attacking you |
14:09:57 | planetis[m] | Far from the truth |
14:10:11 | narimiran | planetis[m]: so you have a package that is more correct (than arraymancer) and more featured (than neo). now is the time to make it fast so it becomes usable |
14:10:18 | FromGitter | <alehander42> what are your plans for it planetis? |
14:10:19 | planetis[m] | Far from making a valid point |
14:10:29 | FromGitter | <alehander42> do you use it in some project |
14:10:48 | narimiran | planetis[m]: "this is my truth, tell me yours" |
14:10:57 | planetis[m] | I use it in my scripts |
14:10:57 | narimiran | clyybber: know the reference ^ ? |
14:11:35 | FromGitter | <alehander42> but what are they for |
14:11:41 | FromGitter | <alehander42> i am interested in how people use actual math |
14:11:45 | planetis[m] | I will post on the forum later |
14:11:49 | FromGitter | <alehander42> as i rarely do advanced math in my own code |
14:12:01 | FromGitter | <alehander42> i used some symbolic math in a compiler toy once |
14:12:05 | clyybber | narimiran: The 90s are calling :) |
14:12:11 | FromGitter | <alehander42> very far from algebra : |
14:12:32 | narimiran | clyybber: glad you know about it :) i listen it quite frequently :) |
14:13:27 | clyybber | Quite the coincidence D |
14:13:54 | narimiran | @alehander42 i used Neo for some non-linear dynamics where you simulate some physics phenomena and you have time-steps of size of a fraction of a second. for each time-step you will (multiple times) need matrix multiplications and similar operations — it better be fast! |
14:14:32 | planetis[m] | alehander42: civil engineering stuff stiffness matrices and ... i dont really know how the rest are called in english |
14:14:52 | narimiran | and if package A is 1000 times (or even 100 times) slower than package B, guess which one will be used? |
14:15:07 | planetis[m] | All i ask is this |
14:15:32 | planetis[m] | Instead of belittling my efforts |
14:15:43 | planetis[m] | Help me out make it fast |
14:15:54 | narimiran | "Instead of belittling my efforts" -- nobody is doing that, we're trying to tell you that but you don't listen |
14:15:57 | clyybber | planetis[m]: First comes the problem, then the solution |
14:16:27 | Araq | narimiran, keep it civilized |
14:16:43 | narimiran | ? |
14:16:48 | planetis[m] | instead he post comparisons between laser and manu in github and says its 1000x % slower, thanks a lot |
14:17:34 | narimiran | "I inferred from your original post that what you wanted was a pure nim library, I even provided you with a suggestion, by using Laser code, to reach BLAS performance without depending on BLAS." |
14:17:34 | Araq | he is asking for help so either help or be quiet. "package X over there is fast already, everybody uses that instead" is not helpful |
14:17:48 | clyybber | planetis[m]: Huh, how should he help you when he isn't even allowed to phrase the problem first? |
14:18:12 | solitudesf | so? why are you upset about it tho? he shoudve instantly submit you a pr rewriting everything for top performance? |
14:18:15 | FromGitter | <alehander42> love you all |
14:18:17 | planetis[m] | Its open source if it doesnt fit you dont use it |
14:18:29 | FromGitter | <alehander42> perf hints are indeed hard to come by |
14:18:29 | clyybber | planetis[m]: And we have free speech |
14:18:33 | narimiran | Araq: he already received the help, but he translated it to "mratsim is attacking me" |
14:18:44 | FromGitter | <alehander42> often non-obvious things help with performance, good to get help |
14:19:18 | Araq | narimiran, maybe, maybe not. no reason to add to the confusion. |
14:19:35 | narimiran | ok, lets talk about transpiling then |
14:19:36 | planetis[m] | Whe he said that |
14:20:25 | narimiran | @mratsim you should join the conversation, to clarify the confusion i'm causing :) |
14:20:41 | Araq | simply shut up and go back to work |
14:20:42 | planetis[m] | where was the suggestion? |
14:20:49 | * | narimiran left #nim ("Leaving") |
14:22:10 | clyybber | planetis[m]: It wasn't there. But it also doesn't have to be there. But you also don't have to let that get to you. |
14:22:28 | clyybber | You don't have to implement the fastest thing ever. |
14:23:21 | clyybber | But you also have to deal with the fact that people might choose something because its fast. |
14:23:45 | clyybber | Nobody ever said that producing technology/code is a rewarding thing. |
14:24:22 | clyybber | I spent a lot of time understanding and implementing smoothsort only for it to be much slower than quicksort and mergesort. |
14:24:40 | clyybber | (Though at extremely high element counts it starts to win) |
14:25:34 | planetis[m] | Alehander42: i strongly believe that arguing is better than trying hard not to |
14:26:51 | FromGitter | <alehander42> planetis a lot of "arguing" is really leading nowhere |
14:26:52 | planetis[m] | Its even more productive and depending on the context and how civilized it is has many benefits |
14:26:58 | FromGitter | <alehander42> i bikeshed a lot, so i know :P |
14:27:22 | FromGitter | <alehander42> of course, reasonable discussion usually makes sense |
14:29:24 | Araq | smoothsort busts a move. |
14:30:15 | planetis[m] | Clybber: thanks for your insight, really love your default fields pr! |
14:30:40 | planetis[m] | I have to go, love you all |
14:30:44 | clyybber | planetis[m]: Np, love your zip macro |
14:30:48 | clyybber | Bb :) |
14:31:15 | * | GordonBGood quit (Ping timeout: 240 seconds) |
14:31:16 | clyybber | Araq: I wonder how tf djikstra came up with it |
14:33:23 | * | nsf quit (Quit: WeeChat 2.6) |
14:34:43 | shashlick | @planetis[m] - have you already tried nimprof to profile? i found it helpful for a few simple optimizations |
14:38:28 | * | LargeEpsilon joined #nim |
14:41:43 | clyybber | planetis[m]: Thanks, still have a bit to go tho. Fixing bootstrapping rn |
14:42:08 | shashlick | @Araq - how do i profile compile time stuff? |
14:43:26 | clyybber | shashlick: With cpuTime https://github.com/nim-lang/Nim/pull/12346 |
14:43:29 | clyybber | hidden behind a flag |
14:43:52 | clyybber | optBenchmarkVm |
14:44:13 | clyybber | sorry I mean --benchmarkvm:on |
14:45:05 | shashlick | so i'll need to measure manually by inserting calls in appropriate places? |
14:47:35 | clyybber | I think so yeah |
14:47:53 | shashlick | ok well until people complain more about nimterop, i'll hold off for now |
14:53:37 | FromDiscord | <kodkuce> make nim greate again |
14:53:51 | clyybber | Araq: https://github.com/nim-lang/Nim/pull/12378/commits/67acfdbd38cdcb5f05b3ecb75ada092d9d3a8e77 |
14:54:55 | clyybber | kodkuce: how to prounce? |
14:57:18 | FromDiscord | <kodkuce> what |
14:58:34 | * | EvilKhaosKat quit (Quit: This computer has gone to sleep) |
14:59:39 | * | EvilKhaosKat joined #nim |
15:01:36 | clyybber | kodkuce: proncication |
15:02:03 | FromDiscord | <kodkuce> what? kodkuce how it sounds? |
15:02:32 | clyybber | nah, I'm just messin with ya :D |
15:04:44 | FromDiscord | <kodkuce> kod kuće << google translate set to serbian and play it |
15:05:36 | FromDiscord | <kodkuce> https://translate.google.com/#view=home&op=translate&sl=sr&tl=en&text=kod%20ku%C4%87e |
15:05:49 | FromDiscord | <kodkuce> aprox, make nim greate again xD |
15:11:44 | FromDiscord | <mratsim> @narimiran, @planetis: I'm there. People were asking for performance of Manu, I expressed my concerns that the code will be slow. I then came back with an actual benchmark to back my claim. |
15:12:09 | FromDiscord | <mratsim> Regarding the ergonomics, I said that using *. instead of .* was a good idea |
15:12:38 | FromDiscord | <mratsim> I provided suggestions to improve the performance of Manu up to BLAS speed without introducing a new dependency on BLAS |
15:13:29 | FromDiscord | <mratsim> Saying that I'm not helpful and spend my time showing off is completely misrepresenting what I'm doing. |
15:13:55 | FromDiscord | <mratsim> `*.` instead of `.*` |
15:19:09 | FromGitter | <zetashift> I also didn't read any ill intentions in that post, but I do think this escalated a bit unnessecary? Keeping that discussion in that thread if best imo |
15:30:37 | Araq | clyybber: good enough |
15:30:48 | clyybber | nice |
15:35:34 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
15:36:50 | FromGitter | <zaphodef> hi! is there a way i can force Nim to include all the functions from a module (even if not used) when compiling with --app:staticlib? |
15:40:37 | Araq | I doubt it, the compiler is aggressively throwing stuff away |
15:41:03 | FromGitter | <zaphodef> arf |
15:41:39 | FromGitter | <zaphodef> i want to create Nim signatures for IDA (haven't found any yet) |
15:41:50 | FromGitter | <zaphodef> and that was the easy way to do it ahah |
15:42:00 | FromDiscord | <mratsim> you need to tag everything with exportc |
15:42:17 | FromDiscord | <mratsim> in the past Nim didn't do deadcodeelim by default but now it does. |
15:42:44 | FromDiscord | <mratsim> you can probably push exportc pragma to all proc within a module though |
15:42:45 | FromGitter | <zaphodef> ok, gonna try this |
15:43:18 | FromGitter | <zaphodef> i can push pragmas to procs in imported modules? |
15:43:33 | FromGitter | <zaphodef> or you mean rather "as a header thing" in the modules |
15:44:41 | FromDiscord | <mratsim> See https://github.com/nim-lang/Nim/issues/10824#issue-419678613 to push the inline pragma on several proc definition |
15:45:30 | FromDiscord | <mratsim> more precisely: https://nim-lang.org/docs/manual.html#pragmas-push-and-pop-pragmas |
15:45:50 | FromGitter | <zaphodef> cool thx! |
15:49:27 | * | letto_ joined #nim |
15:51:53 | * | letto quit (Ping timeout: 276 seconds) |
15:57:29 | FromGitter | <zaphodef> it doesn't look to work with the import statement, i'm using include instead, but still some issues (eg. https://github.com/nim-lang/Nim/blob/5ba932e43c9c971555d8fdc9e25e2edcdcdd70b4/lib/pure/asyncdispatch.nim#L188 doesn't except the `exportc` pragma) |
15:58:05 | FromGitter | <zaphodef> i guess i'll have to do something dirtier and add pragmas directly to .nim lib file |
16:01:15 | FromDiscord | <mratsim> ah you want to add that to the stdlib, mmm |
16:01:16 | Araq | you could try to patch incrtl.nim |
16:01:42 | Araq | the stdlib uses .rtl |
16:01:54 | Araq | and quite consistently |
16:02:07 | Araq | incrtl.nim defines what .rtl actually means |
16:04:23 | FromGitter | <zaphodef> ok gonna have a look at it |
16:06:04 | Araq | and if you have to add more .rtl pragmas via a PR it's likely to be accepted |
16:06:29 | FromGitter | <zaphodef> noted :) |
16:06:30 | Araq | because it already exists |
16:07:44 | FromDiscord | <exelotl> lmao I was tweaking a glsl fragment shader and I saw the word 'discard' in a branch... So I assumed it did the same thing as in Nim, and started using it myself |
16:08:43 | FromDiscord | <exelotl> Then suddenly my mesh was full of holes because I was actually discarding pixels xD |
16:09:32 | * | Hideki_ quit (Remote host closed the connection) |
16:10:18 | * | Hideki_ joined #nim |
16:15:00 | * | Hideki_ quit (Ping timeout: 265 seconds) |
16:19:03 | * | EvilKhaosKat quit (Quit: This computer has gone to sleep) |
16:27:19 | clyybber | lol |
16:30:15 | * | abm quit (Quit: Leaving) |
16:30:31 | * | Kaivo quit (Quit: WeeChat 2.6) |
16:33:22 | * | LargeEpsilon quit (Ping timeout: 265 seconds) |
16:35:55 | zedeus | exelotl: what are you working on? i noticed you've been star'ing a lot of game dev related repos |
16:53:05 | FromGitter | <zacharycarter> yes - discard actually discards the fragment |
16:56:54 | FromDiscord | <mratsim> @Araq, were unsigned included by mistake in range changes? https://github.com/nim-lang/Nim/issues/12554 |
16:59:16 | FromDiscord | <mratsim> Seems like it's a side-effect of this: https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_1_0_0.md#breaking-changes-in-the-compiler |
16:59:40 | * | ng0 joined #nim |
17:24:19 | * | shashlick quit (Remote host closed the connection) |
17:36:24 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
17:38:15 | * | Hideki_ joined #nim |
17:39:05 | * | shashlick joined #nim |
17:42:13 | * | letto joined #nim |
17:43:41 | * | letto_ quit (Ping timeout: 250 seconds) |
17:48:05 | lqdev[m] | this is so nice: https://play.nim-lang.org/#ix=208V |
17:48:51 | * | ng0 joined #nim |
17:49:06 | FromDiscord | <exelotl> zedeus: well I'm currently doing threejs stuff in my day job. But besides that I'm working on a GBA game in Nim |
17:49:43 | clyybber | lqdev[m]: Whats that? |
17:49:51 | FromDiscord | <exelotl> here's a (kinda old) gif https://twitter.com/hot_pengu/status/1137819284246323203 |
17:49:55 | clyybber | Do you mean dumptree in general? |
17:50:46 | lqdev[m] | clyybber: no, I mean the `Bracket` syntax and the fact it's parsed correctly |
17:50:59 | lqdev[m] | I don't know if it's used anywhere in the language, but it's nice |
17:51:04 | FromDiscord | <kodkuce> SDL2 or using some engine, i plan to use Godot + Nim or if must C++ |
17:51:29 | clyybber | lqdev[m]: Yeah thats cool |
17:51:43 | clyybber | exelotl: Damn thats fucking awesome |
17:51:55 | clyybber | Do you have a git repo? |
17:52:15 | clyybber | I love the GBA |
17:52:23 | lqdev[m] | I plan on using it for my Wren wrapper for annotating special procs, like `[new]`, `[init]`, `[get]`, and maybe others |
17:52:40 | FromDiscord | <exelotl> I do but it's currently private :x |
17:53:10 | FromDiscord | <exelotl> tho I made libtonc bindings which are here https://github.com/exelotl/nim-tonc |
17:53:43 | lqdev[m] | @exelotl: damn, your animations are so fluid in this game |
17:53:47 | FromDiscord | <exelotl> makes it easy to get up and running if you want to try nim gba dev for yourself ;) |
17:53:55 | clyybber | exelotl: Thanks thats really all I wanted |
17:53:57 | clyybber | awesome |
17:54:17 | lqdev[m] | I love the sprites |
17:54:26 | zedeus | exelotl: that's really cool, good job! |
17:54:33 | * | LargeEpsilon joined #nim |
17:54:51 | FromDiscord | <exelotl> thanks :) I'm lucky and teamed up with a really great artist who I met through work |
17:55:03 | FromDiscord | <exelotl> (guy who did the tweet) |
17:55:49 | clyybber | congrats to you both! |
17:56:00 | clyybber | thats really slick looking |
17:56:17 | zedeus | replace twitter.com with nitter.net to see my project :) |
17:57:34 | clyybber | zedeus: Oh, nice |
17:57:39 | clyybber | A twitter frontend? |
17:57:55 | zedeus | yeah, click the i logo in the top right for more info |
17:58:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
18:02:39 | clyybber | cool |
18:03:43 | clyybber | https://www.youtube.com/watch?v=atcKO15YVD8 this is interesting |
18:04:02 | * | fanta1 quit (Quit: fanta1) |
18:07:30 | * | jjido joined #nim |
18:07:44 | clyybber | exelotl: Ha, you're coming from LOVE too? |
18:08:38 | * | EvilKhaosKat joined #nim |
18:11:03 | * | NimBot joined #nim |
18:11:47 | FromDiscord | <exelotl> Yeah! Done quite a bit with it over the years :) |
18:12:13 | clyybber | exelotl: I always wanted to replicate luas coroutines in nim |
18:13:24 | clyybber | because lua + love was really fucking perfect |
18:13:44 | clyybber | but too slow, so I switched to nim. Now I love both |
18:14:48 | FromDiscord | <exelotl> yeah I get what you mean, I made this but it's more like a super crippled async/await https://github.com/exelotl/ecolo |
18:15:33 | disruptek | love has a nim version? |
18:15:37 | FromDiscord | <exelotl> it doesn't do any allocation though so it's suitable for implementing a dialogue/cutscene system on the GBA |
18:16:45 | FromDiscord | <exelotl> disruptek: I wish x) |
18:20:01 | clyybber | disruptek: Nope |
18:20:19 | * | Trustable joined #nim |
18:22:06 | clyybber | disruptek: But it has a rust version.. |
18:22:10 | clyybber | In some way. |
18:22:28 | clyybber | One should in theory be able to call rust from nim |
18:28:35 | FromDiscord | <Chiqqum_Ngbata> Nim rulez |
18:29:57 | clyybber | heck yeah |
18:32:22 | clyybber | Araq: Somehow `high(int)` ends up in cgen |
18:32:42 | clyybber | It should have gotten rid of in semfold right? |
18:33:05 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:38:00 | * | EvilKhaosKat quit (Quit: Leaving) |
18:38:17 | * | LargeEpsilon quit (Ping timeout: 276 seconds) |
18:40:06 | lqdev[m] | clyybber, disruptek: it should be relatively easy to make a LOVE wrapper for Nim using importcpp |
18:40:20 | lqdev[m] | the implementation is separate from the Lua wrapper |
18:45:41 | clyybber | Yeah |
18:49:22 | * | nsf joined #nim |
19:15:39 | * | floppydh quit (Quit: WeeChat 2.6) |
19:27:33 | FromGitter | <Julioevm> Hey everybody, can I specify in a for loop the increment of each iteration? |
19:27:39 | FromGitter | <Julioevm> I dont see it in any example |
19:27:53 | zedeus | https://nim-lang.org/docs/system.html#countup.i%2CT%2CT%2CPositive |
19:28:34 | FromGitter | <Julioevm> thanks! |
19:30:44 | Araq | clyybber: yes |
19:30:51 | clyybber | Araq: Fixed it just now. |
19:31:24 | clyybber | Bootstrapping *almost* works now :) |
19:31:39 | disruptek | good enough. |
19:32:09 | clyybber | disruptek: gcc errors are good enough, I agree :p |
19:34:45 | * | sacredfrog joined #nim |
19:41:18 | FromGitter | <mratsim> At one point the selling point of Clang was better errors than GCC |
19:42:46 | disruptek | nothin' quite like a good compiler error to warm the cockles on a cold, cold night. |
19:42:50 | zedeus | having some macro troubles with object variants |
19:42:52 | zedeus | https://play.nim-lang.org/#ix=209t |
19:43:26 | zedeus | if the `of select` branch is moved below `checkbox` in the type definition, it works |
19:43:46 | zedeus | i have no idea what's going on here |
19:49:07 | Araq | clyybber: read my ideas about 'lent T'? |
19:49:45 | clyybber | Araq: Nope, where? |
19:50:05 | clyybber | Or do you mean the idea that it's a good idea in general, not just for nrt? |
19:50:56 | clyybber | zedeus: Your snippet works for me as is.. |
19:51:17 | zedeus | defaultOption gets set to "\x00", but I can make a stronger case, one second |
19:53:03 | Araq | no I mean there is no reason to implement 'lent T' as a pointer |
19:53:03 | clyybber | k, (be aware that case objects don't really work at ct/as consts) |
19:53:12 | clyybber | Araq: Ah |
19:53:15 | clyybber | Yeah, I agree. |
19:53:26 | zedeus | https://play.nim-lang.org/#ix=209z |
19:53:28 | Araq | it can simply copyMem the object and it doesn't have a destructor |
19:53:46 | zedeus | defaultInput and placeholder are empty here, if the select branch is moved up that one is affected instead |
19:54:01 | zedeus | they don't? if i type it manually (still for ct) it works fine |
19:54:44 | clyybber | Araq: Yeah. |
19:57:03 | clyybber | Araq: We should probably the already implemented heuristics. |
19:57:43 | clyybber | zedeus: Yeah, as you can see its unreliable. |
19:58:01 | clyybber | So better not rely on it. According to Araq they are not supposed to work |
20:00:25 | zedeus | alright, it works fine as a normal object with empty fields so it's not really an issue |
20:00:29 | zedeus | thanks |
20:00:52 | clyybber | np |
20:02:28 | Araq | const `name` = toOrderedTable() --> let `name` = toOrderedTable() |
20:02:45 | Araq | we should really have fixed this for 1.0 |
20:03:16 | Araq | and tell people to rewrite their code, it never worked reliably |
20:03:19 | Araq | oh well |
20:03:28 | zedeus | the table is used during compile-time only, does that work? |
20:05:30 | Araq | use a .compileTime pragma too then |
20:07:14 | zedeus | that caused some uh, errors https://play.nim-lang.org/#ix=209D |
20:08:11 | clyybber | Araq: Why not make lent default then? |
20:08:25 | Araq | default for what? |
20:08:35 | clyybber | Return type |
20:08:45 | clyybber | Make it copy when it would outlive its origin |
20:09:42 | Araq | hmmm |
20:10:12 | Araq | I doubt it's sound, the borrowing rule currently requires we derive the location from the first parameter |
20:11:03 | Araq | and a shallowcopy still requires a borrowing rule |
20:12:43 | Araq | yeah, don't change that, proc p(): T means it returns a fresh T, proc p(): lent T means it returned a view into the T |
20:13:02 | Araq | and given that Nim doesn't have C++styled constructions the defaults fit |
20:13:12 | Araq | *constructors |
20:22:05 | * | tiorock joined #nim |
20:22:05 | * | rockcavera is now known as Guest4114 |
20:22:05 | * | Guest4114 quit (Killed (sinisalo.freenode.net (Nickname regained by services))) |
20:22:05 | * | tiorock is now known as rockcavera |
20:24:46 | * | d-nice2[m] joined #nim |
20:27:01 | stefantalpalaru | Araq: Fortran lost its advantage over C since C99 introduced the "restrict" keyword that tells the compiler that a pointer will not be aliased: https://en.wikipedia.org/wiki/Restrict |
20:27:37 | Araq | that's what you think, yes. |
20:27:41 | * | nsf quit (Quit: WeeChat 2.6) |
20:27:50 | * | Hideki_ joined #nim |
20:28:05 | Araq | in practice there is some value in builtin matrix operations you don't have to extract from nested for loops |
20:29:05 | * | filcuc quit (Ping timeout: 264 seconds) |
20:31:04 | FromGitter | <Julioevm> what should be used instead of isDigit, since its deprecated? |
20:32:57 | * | Hideki_ quit (Ping timeout: 240 seconds) |
20:33:00 | stefantalpalaru | Julioevm: https://github.com/status-im/nim-chronicles/pull/64/files |
20:44:17 | * | jjido joined #nim |
20:47:31 | * | Trustable quit (Remote host closed the connection) |
20:53:19 | clyybber | Araq: What types should I skip to check wether the type is and obj or ref obj type in transf? |
20:53:38 | clyybber | Anything more than tyGenericInst? |
20:56:07 | clyybber | Probably the whole abstractInst, right? |
20:56:09 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:59:14 | * | jjido joined #nim |
21:01:14 | * | kungtotte quit (Ping timeout: 240 seconds) |
21:04:32 | FromGitter | <mratsim> @Araq I agree with @stefantalpalaru, restrict allowed C to bridge the perf gap with Fortran |
21:07:46 | Araq | good for you, I explained my reasoning though |
21:10:03 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:10:28 | Araq | Fortran compilers optimize Fortran code, C compilers fail at advanced common subexpression elimination ;-) |
21:18:25 | Araq | clyybber: abstractInst |
21:21:44 | * | letto_ joined #nim |
21:23:23 | * | letto quit (Ping timeout: 276 seconds) |
21:24:00 | clyybber | Araq: Done |
21:24:09 | clyybber | And finally bootstraps now \o/ |
21:25:18 | * | GordonBGood joined #nim |
21:30:30 | GordonBGood | Araq: would you consider making `shallow` and `shallowCopy` depreciated in light of seqsv2 in version 1.1? |
21:31:04 | Araq | that's your concern? still? |
21:31:39 | GordonBGood | No, not a concern, it's already nooped, just they don't make sense anymore |
21:32:36 | GordonBGood | The deeper into this I get the more I realize how ugly legacy seqs and strings are any the more I want to erase any signs they were ever there ASAP |
21:33:00 | FromGitter | <nixfreakz_twitter> trying to cross compile to windows from osx and it compiles but no exe output ? nim c -d:mingw-w64 control1.nim |
21:33:29 | GordonBGood | Also, part of what you have given me needs to be updating the docs to reflect how it now works |
21:34:09 | Araq | check out my araq-refcounting branch |
21:34:28 | GordonBGood | Okay, will do |
21:35:45 | FromGitter | <nixfreakz_twitter> am I missing an output flag ? |
21:36:55 | GordonBGood | Also, deep into getting rid of bypassing PGenericSeq and realized the having a len in the outer object with cap, etc in the payload is kind of redundant, that it would actually make more sense for len to be part of the payload |
21:37:56 | GordonBGood | it would work because there is already code to check if the payload ref is nil, in which case len (and cap) need to be zero anyway |
21:38:53 | GordonBGood | In other words, put the special case code handling the ambiguity between zero len and nil payload pointer into one place |
21:42:04 | Araq | len is not in the payload |
21:42:09 | * | nif quit (Quit: ...) |
21:42:13 | Araq | there is no redundancy |
21:42:20 | * | nif_ joined #nim |
21:47:07 | GordonBGood | Yes, I know len is not in the payload, I'm saying that with v2 there doesn't seem to be a reason it couldn't be in the payload? |
21:48:33 | GordonBGood | the code allows for nil payload pointer as it needs to for default seqs, which will automatically have zero len and nil pointer |
21:49:09 | GordonBGood | I'm saying nil payload pointer is enough |
21:49:43 | * | superbia joined #nim |
21:51:04 | GordonBGood | On the other side of ref counting, I am looking at your araq-refcounting branch and see you have gone ahead with the gchooks and simplifying gcdestructors - I like it |
21:52:35 | GordonBGood | Once seqv2 is totally disassociated with gchooks, there isn't much left (if anything) of destructors in gchooks |
21:53:18 | FromGitter | <nixfreakz_twitter> Hint: operation successful (15436 lines compiled; 3.133 sec total; 15.977MiB peakmem; Debug Build) [SuccessX] no exe file though ? |
21:58:00 | clyybber | GordonBGood: I'm not opposed to the idea, I guess it saves some bytes. But I wonder if it has any impact I'm not aware of. |
22:00:43 | GordonBGood | There are still a couple of places in system.nim in your refcounting branch where usesDestructors is used as the switch when it should be nimSeqV2: in the two places getting rid of system/assign and deepCopy |
22:02:29 | GordonBGood | clyybber: if I thought it had much of an impact, I wouldn't suggest it; I'm asking for permission to pursue it, but if it turns out to have a big impact I'll back off |
22:03:19 | clyybber | Cool, then go ahead! It's a really great idea. |
22:03:34 | GordonBGood | There needs to be some logic to do with len when the pointer payload is nil, but that is minimum |
22:03:52 | clyybber | pointer payload? |
22:03:59 | clyybber | You mean the pointer to the payload? |
22:04:04 | GordonBGood | and much of it is already there, the payload pointer needs to be checked anyway |
22:04:42 | clyybber | If its nil, treat it like len = 0, I'd say. |
22:04:44 | GordonBGood | Yes, payload pointer = pointer payload ;-) |
22:05:02 | clyybber | k :) |
22:05:02 | GordonBGood | Yup, that's my thinking |
22:05:49 | GordonBGood | You okay on it, but I want to see what Araq thinks before doing anything |
22:06:20 | GordonBGood | seqv2 is a new structure anyway, and as long as the seq/string API stays the same? |
22:09:00 | Araq | that means x.len is translated into a conditional as before |
22:09:20 | Araq | I don't think it's wise |
22:11:37 | GordonBGood | Araq, OK, I suppose the advantage of a len field in the outer object is that as long as we make sure it's always valid, it can be accessed without a proc? |
22:12:06 | GordonBGood | Where cap is a field that is not accessible to the user |
22:12:26 | GordonBGood | And if it were, would need a proc |
22:13:26 | GordonBGood | Okay, I'll leave it, it was just an idea |
22:14:35 | * | shadowbane quit (Ping timeout: 268 seconds) |
22:15:01 | * | shadowbane joined #nim |
22:15:05 | GordonBGood | Araq, on your refcounting branch, note the two places I note above that should be switched on nimSeqsV2 not usesDestructors - to do with seqs changes, not destructors |
22:16:31 | GordonBGood | I'm in process of doing that, seqsv2 won't work with system/assign or deepCopy, of course, which is why we like them :) |
22:16:58 | GordonBGood | assign and deepCopy are UGLY |
22:18:18 | Araq | sure |
22:19:03 | GordonBGood | OK, you can change your branch, I am working based on devel |
22:19:40 | Araq | alright, but I need to sleep, good night |
22:20:02 | clyybber | gn8 |
22:20:15 | GordonBGood | Yeah, I need to sleep, too, get up in the middle of the night to catch everybody, good night |
22:22:37 | * | shadowbane quit (Ping timeout: 240 seconds) |
22:24:03 | FromGitter | <mratsim> I naively prefer not having to dereference the seq to know it's length |
22:25:07 | FromDiscord | <kodkuce> so you solved nim becoming magic |
22:26:48 | superbia | is there a list of javascript supported modules? |
22:31:38 | * | tklohna_ quit (Ping timeout: 276 seconds) |
22:36:37 | * | solitudesf quit (Ping timeout: 250 seconds) |
22:38:44 | FromGitter | <mratsim> I think when they are unsupported it's mentioned in the docs |
22:39:10 | FromGitter | <mratsim> But basically it's the low-level stuff like endians, bitops |
22:40:36 | clyybber | GordonBGood: Good night |
22:46:39 | * | letto_ quit (Ping timeout: 268 seconds) |
22:55:36 | * | nif_ quit (Quit: ...) |
22:55:45 | * | nif joined #nim |
22:59:01 | * | LargeEpsilon joined #nim |
23:17:20 | clyybber | krux02: This is what I'm testing defaultfields with currently: https://hastebin.com/utofalatof.php |
23:20:05 | krux02 | why isn't it in the PR yet? |
23:20:19 | clyybber | krux02: No particular reason |
23:20:29 | clyybber | Mainly because I still have some things to do. |
23:20:36 | krux02 | ok |
23:20:50 | clyybber | Like making `case b: bool = true` actually parse |
23:20:58 | krux02 | I constantly get these notification that you do something there, like two line changes and stuff like that |
23:21:16 | clyybber | Oh, sorry. I think you can unwatch the PR |
23:21:19 | krux02 | I have no clue what you are actually doing, but I see that some activity is tthere |
23:21:56 | clyybber | krux02: Heh, yeah my commit messages were a bit wonky. I fixed bootstrapping basically. Skipped some types here and there. |
23:22:07 | krux02 | yes I can, but I don't want to, because this is a feature that I see particularly dangerous if it is implemented too openly. |
23:22:36 | clyybber | krux02: Hehe, I'm eager to recieve your critique |
23:22:44 | krux02 | I honestly think that good intentions with too much thinking in this PR can make the language accidentally much worse |
23:22:52 | clyybber | I agree. |
23:23:21 | krux02 | I still say strogly no to all default values that would require an allocation. |
23:23:36 | krux02 | And that is what I want to see reflected in the test cases as well. |
23:24:04 | krux02 | A test that ensures an error message when somebody tries to default a seq/string member. |
23:24:13 | clyybber | krux02: Sure |
23:25:01 | krux02 | By now I also know how people tick, so I want to ensure people gen an idea of the reasoning why those default values would not be allowed. |
23:25:19 | clyybber | krux02: Btw, wdyt: Should the discriminator in case-object constructors be required to be a const? |
23:25:29 | clyybber | Because currently my PR doesn't rely on it. |
23:26:05 | krux02 | When people see "not implemented" it triggers them, and they might just implement that missing feature, and worst case it migt be accidentally ber merged, because it won't break existing code. |
23:26:24 | * | lritter quit (Ping timeout: 252 seconds) |
23:26:42 | krux02 | but currently I am really worried a lot that Nim will allow too much because people request and implement it without thinking oubt oth consequences of it. |
23:27:03 | krux02 | I don't want Nim to become this horrible mess that C++ is right now. |
23:27:06 | clyybber | krux02: Not to worry, I am thinking about my stuff :) |
23:29:24 | clyybber | krux02: Wdyt about my above question? |
23:32:32 | * | Vladar quit (Quit: Leaving) |
23:33:00 | * | LargeEpsilon quit (Ping timeout: 252 seconds) |
23:35:40 | * | lritter joined #nim |
23:35:58 | clyybber | disruptek: I might have to disappoint you, |
23:36:03 | disruptek | oh? |
23:36:08 | disruptek | no more errors? |
23:36:19 | clyybber | while currently my PR supports non-constant discriminators |
23:36:26 | clyybber | I'm thinking about changing it back |
23:36:32 | * | nif quit (Quit: ...) |
23:36:43 | * | nif joined #nim |
23:36:57 | clyybber | because look at it that way: with forcing that const condition we guarantee that object construction will work. |
23:37:11 | clyybber | and cannot fail. |
23:37:26 | clyybber | which also seems to be what krux02 is wary of to preserve |
23:38:06 | clyybber | disruptek: Also it makes the implementation much more simple :p |
23:38:30 | disruptek | for the compiler, but not for the user. |
23:38:44 | clyybber | I'd argue perhaps also for the user. |
23:39:02 | disruptek | it needs to be fixed with dfa, i think. then everyone wins. |
23:39:15 | clyybber | Because 1. Slightly better warnings with --newruntime 2. Object construction can't fail |
23:39:16 | krux02 | It is also important that the implementation is maintainable. The team of the Nim maintainers isn't big. |
23:39:35 | clyybber | krux02: No worries. It is very simple. |
23:39:46 | disruptek | hey, i didn't demand that it was impl. i just said i was sad about boilerplate. |
23:42:08 | clyybber | Hmm. I'll ask Araq tomorrow what he thinks. |
23:42:10 | krux02 | well, if `memset(&t, sizeof(t), 0)` can be replaced logically with a `memcpy(&t, defaultT, sizeof(t))`, I am happy. |
23:43:03 | clyybber | I don't think we should go that deep. If people want to memset their stuff let them do. |
23:43:17 | * | lritter quit (Ping timeout: 240 seconds) |
23:43:23 | krux02 | I don't literally mean memset |
23:43:36 | clyybber | Good |
23:43:36 | krux02 | I mean the code that Nim generates |
23:43:49 | clyybber | krux02: I'm transforming the object contructors. |
23:43:49 | krux02 | default values should be set somehow |
23:44:07 | krux02 | if that "somehow" can be "memset" I am heppy. I don't demand it to be memset. |
23:44:15 | clyybber | krux02: In an earlier implementation I was doing it in the backend, now I'm doing it in transf.nim |
23:44:46 | krux02 | well, you need to test it for at least, js c++ C and the vm. |
23:45:16 | clyybber | krux02: Do that already. |
23:45:23 | clyybber | But it still isn't finished |
23:45:28 | krux02 | yea |
23:45:34 | clyybber | And I don't really like the current implementation |
23:46:09 | krux02 | yea I can see that. I see code punching that is happening ;) |
23:46:20 | clyybber | Yeah :D |
23:48:04 | rayman22201 | "code punching" lol. I like that phrase :-P |
23:50:48 | * | krux02 quit (Remote host closed the connection) |
23:53:14 | clyybber | Good night y'all |
23:53:16 | * | clyybber quit (Quit: WeeChat 2.6) |
23:53:45 | * | clyybber joined #nim |
23:54:01 | clyybber | Forgot to say: good morning rayman :p |
23:54:02 | * | clyybber quit (Client Quit) |
23:55:09 | rayman22201 | lol. It's afternoon for me, but thanks anyway. have a good sleep :-) |
23:59:51 | * | Hideki_ joined #nim |