00:02:19 | I_Right_I | hey wait, none of this is going to impact "ItemList = cast[ptr array[MaxItems,ItemObj]](allocShared0(sizeof(ItemObj)*MaxItems))" is it? |
00:03:10 | Araq | I_Right_I, it kinda does, you can just use a 'seq' instead then |
00:03:38 | Araq | but your way continues to work |
00:04:27 | I_Right_I | well using a seq would have been nice |
00:07:43 | * | rnrwashere joined #nim |
00:11:07 | * | rnrwashere quit (Remote host closed the connection) |
00:12:00 | * | rnrwashere joined #nim |
00:16:31 | * | rnrwashere quit (Remote host closed the connection) |
00:18:58 | FromDiscord | <Avatarfighter> Did you guys know https://repl.it/ has a nim IDE? |
00:19:45 | FromDiscord | <Avatarfighter> That's kind of awesome tbh |
00:20:25 | sealmove | must be pretty recent |
00:20:33 | * | rnrwashere joined #nim |
00:20:36 | * | rnrwashere quit (Remote host closed the connection) |
00:21:03 | FromDiscord | <Avatarfighter> Yeah it's relatively new and it works pretty well! |
00:21:14 | * | rnrwashere joined #nim |
00:23:36 | FromDiscord | <Avatarfighter> Just a question, but do any of you guys know what the nim equivalent of `[1,2,3,4,5][::2]` would be from python? |
00:24:13 | FromDiscord | <Avatarfighter> I'm probably going to make a loop in the end, but I just wanted to know if there was another way |
00:25:27 | * | rnrwashere quit (Ping timeout: 240 seconds) |
00:29:44 | I_Right_I | Araq: Just wanted to tell you I come from "C" haven't done much programming in the last ten years. I have been looking into learning a new language, and I have tried a few(Rust,Go...etc). For my purposes nim wins out hands down. And I strongly believe as nim matures others will see that as well. |
00:31:02 | sealmove | Avatarfighter: [^2] |
00:31:24 | sealmove | [0..^2] to be precise |
00:31:37 | * | clyybber quit (Quit: WeeChat 2.4) |
00:32:45 | sealmove | sorry, forgot my python :P |
00:33:09 | FromDiscord | <Avatarfighter> What does the "^" part of that do? |
00:33:13 | sealmove | but you can do anything with `..` operator, and if you need elements counting from last one, use carot (`^`) |
00:33:20 | FromDiscord | <Avatarfighter> Ah |
00:34:14 | FromDiscord | <Avatarfighter> That solves one of my issues lol |
00:34:15 | sealmove | ah you want step |
00:34:29 | sealmove | maybe need list comprehension for this |
00:34:55 | FromDiscord | <Avatarfighter> See, I definitely would use list comprehension, but I dont fully understand how it works in nim lol |
00:35:00 | sealmove | https://github.com/alehander42/comprehension |
00:35:13 | sealmove | it's an external lib, so... |
00:35:20 | sealmove | core Nim doesn't have it |
00:35:49 | sealmove | https://github.com/nim-lang/Nim/blob/devel/tests/macros/tcollect.nim |
00:35:50 | FromDiscord | <Avatarfighter> i believe the sugar lib has a version of it |
00:35:56 | I_Right_I | I can see I am going to have to play with the iteration nim offers a bit more then I have |
00:36:08 | FromDiscord | <Avatarfighter> https://nim-lang.org/docs/sugar.html#lc |
00:36:39 | sealmove | oh nice, didn't know that |
00:36:58 | FromDiscord | <Avatarfighter> It looks really cool, but the more I fiddle with it, the less it works for me lol |
00:37:25 | sealmove | yeah, stick to the simple when you can |
00:37:34 | FromDiscord | <Avatarfighter> lmao |
00:37:48 | FromDiscord | <Avatarfighter> time to snag alehander42's lib i guess 😄 |
00:39:17 | sealmove | wait, maybe you need something difference actually |
00:40:03 | sealmove | https://nim-lang.org/docs/sequtils.html#keepItIf.t%2Cseq%2Cuntyped |
00:40:48 | sealmove | transforming seqs is done with sequtils |
00:41:34 | sealmove | and iterutils has exactly the "slicing" you are looking for https://github.com/def-/nim-iterutils/blob/master/src/iterutils.nim |
00:41:42 | sealmove | (sorry for the many links) |
00:41:56 | sealmove | https://github.com/def-/nim-iterutils/blob/master/src/iterutils.nim#L121 |
00:41:59 | FromDiscord | <Avatarfighter> it's alrighty, I enjoy looking at how it's all implemented, I'm learning a lot lol |
00:45:10 | sealmove | seems very trivial to implement using iterator keyword |
00:47:24 | * | noeontheend joined #nim |
00:51:08 | FromDiscord | <Avatarfighter> Yeah, it looks fairly simple, I just wanted to see if it was a native thing in nim 😄 |
01:02:55 | sealmove | yeah Nim doesn't have "native" stuff like this. only what's easy for the computer is native. |
01:03:19 | sealmove | and i believe this is the way to make sound abstractions |
01:05:18 | FromDiscord | <Avatarfighter> sounds good \:D thank you for the help again sealmove, you're a real lifesaver |
01:06:14 | sealmove | happy to help (but note I am a Nim beginner as well) |
01:07:19 | * | stefanos82 quit (Remote host closed the connection) |
01:11:38 | I_Right_I | Does anyone know why the change from the name nimrod to nim? |
01:13:18 | sealmove | cool language need short name? |
01:18:50 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:33:33 | * | rockcavera joined #nim |
01:41:44 | * | sealmove quit (Quit: WeeChat 2.4) |
01:46:16 | * | noeontheend quit (Ping timeout: 250 seconds) |
02:07:58 | * | MightyJoe quit (Ping timeout: 245 seconds) |
02:09:22 | * | cyraxjoe joined #nim |
02:10:20 | * | arecacea1 quit (Read error: Connection reset by peer) |
02:10:38 | * | arecacea1 joined #nim |
02:10:52 | * | theelous3_ quit (Ping timeout: 245 seconds) |
02:17:23 | * | ghidra quit (Quit: Page closed) |
02:33:27 | * | ricekrispie joined #nim |
02:34:34 | * | cgfuh quit (Quit: WeeChat 2.3) |
03:06:00 | * | banc quit (Quit: Bye) |
03:30:36 | * | banc joined #nim |
03:46:52 | * | rnrwashere joined #nim |
03:48:38 | * | I_Right_I quit (Remote host closed the connection) |
03:55:34 | * | ricekrispie2 joined #nim |
03:57:33 | * | ricekrispie quit (Ping timeout: 245 seconds) |
04:01:16 | * | rnrwashere quit (Remote host closed the connection) |
04:02:16 | FromGitter | <AmberSaber> why not n? |
04:02:35 | FromGitter | <AmberSaber> more stort |
04:02:37 | * | rnrwashere joined #nim |
04:11:44 | disruptek | here here |
04:11:55 | disruptek | hear here |
04:41:42 | * | NimBot joined #nim |
04:50:10 | * | kapil____ joined #nim |
05:14:27 | * | noeontheend joined #nim |
05:25:06 | * | noeontheend quit (Ping timeout: 250 seconds) |
05:59:47 | * | narimiran joined #nim |
06:50:48 | * | rnrwashere quit (Remote host closed the connection) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:44 | * | gmpreussner joined #nim |
07:05:46 | FromGitter | <alehander42> Araq, so single ownership would be enforced? |
07:05:58 | FromGitter | <alehander42> what would be used if we need multiple owners then |
07:10:17 | * | nsf joined #nim |
07:11:04 | Araq | some specialized solution. a seq with indexes, a GcRef[T], a SharedPtr[T] |
07:14:02 | Araq | lists, queues, async, parsers is what the stdlib consists of. As far as I can oversee it ownership is clear. |
07:15:23 | Araq | the question that I am trying to answer was what are good default semantics for 'ref' |
07:16:50 | FromGitter | <alehander42> ok, but would that specialized solution be provided by the stdlib again |
07:17:06 | FromGitter | <alehander42> or would it be expected that each project would solve this for itself |
07:21:11 | Araq | a stdlib solution will emerge, probably sooner than later just to keep people calm. |
07:21:47 | Araq | but afaik the project specific solutions would be better. |
07:22:17 | FromGitter | <alehander42> yeah, but wouldn't a project be able to also just say "i will use the gc" |
07:22:27 | FromGitter | <alehander42> and to not deal with this at all |
07:22:39 | FromGitter | <alehander42> using the same kind of code as of today |
07:22:48 | FromGitter | <alehander42> (you said mostly the libs would need to support both) |
07:22:53 | Araq | that's mostly the question of app vs lib |
07:23:25 | Araq | apps are fine with no changes, libs need to care for the lowest common denominator |
07:23:49 | * | solitudesf joined #nim |
07:24:05 | FromGitter | <alehander42> that makes sense |
07:24:14 | FromGitter | <alehander42> i was wondering if the gc is here to stay for the apps |
07:24:16 | FromGitter | <alehander42> indeed |
07:24:21 | Araq | we can also to try to infer 'owned' |
07:26:19 | Araq | the GC is here to stay for the apps but we'll probably embrace Boehm at this point |
07:28:41 | FromGitter | <alehander42> inferring would be cool, but how often would it be possible |
07:28:51 | Araq | I don't see the theoretical advantages of our non-shared heaps where allocations require no locking become practical advantages anytime soon. :-/ |
07:29:52 | Araq | Instead it brought us .gcsafe, deepcopies and hard to use threads and channels. |
07:30:51 | Araq | and a duplication of all stdlib containers, SharedTable vs Table, SharedSeq vs seq, SharedString vs string. |
07:31:10 | Araq | except that we don't have SharedSeq or SharedString |
07:32:05 | Araq | alehander42: I don't know and it's too early to think about it |
07:34:37 | FromGitter | <alehander42> ok, i am not so good at this memory stuff, so sorry that i am missing links between ideas sometimes, how does the owner-thing directly relate to the sharing of heaps between threads |
07:37:47 | * | sutke11782 joined #nim |
07:41:18 | * | sutke1178 quit (Ping timeout: 245 seconds) |
07:42:03 | Araq | well for a start if you know that RC == 0 you know there no readers so you can hand ownership over to a different thread, safely. |
07:42:30 | Araq | you don't have to copy the data. |
07:43:43 | * | dddddd quit (Remote host closed the connection) |
07:43:46 | FromGitter | <alehander42> so you are inferring the number of readers |
07:43:55 | FromGitter | <alehander42> is this on runtime or on ct |
07:45:02 | * | narimiran quit (Ping timeout: 245 seconds) |
07:45:13 | Araq | runtime. ct requires yet-anther pragma or a dedicated UniquePtr type |
07:45:51 | FromGitter | <alehander42> so if the rc != 0 |
07:45:57 | FromGitter | <alehander42> then you copy the data |
07:46:23 | Araq | nah, then I abort and tell you to fix your program |
07:46:36 | FromGitter | <alehander42> in debug mode |
07:46:52 | disruptek | klee reporting an oob pointer in nim's hello world. i wonder if i'm using this correctly. |
07:47:07 | Araq | in release mode you don't have a RC. |
07:48:33 | FromGitter | <alehander42> so what happens in release mode |
07:48:51 | Araq | it assumes you tested it and lets you get away with it |
07:48:51 | disruptek | oh, i bet it's an unterminated string. probably fine. this will be fun to play with. |
07:48:51 | FromGitter | <alehander42> hm so this is if checks:off |
07:49:16 | FromGitter | <alehander42> so actually with checks:on your server will abort |
07:49:21 | FromGitter | <alehander42> in this case |
07:49:31 | Araq | yes. |
07:49:35 | FromGitter | <alehander42> the thing i am hesitant about is |
07:49:38 | FromGitter | <alehander42> with debug mode |
07:49:42 | FromGitter | <alehander42> that some bugs and conditions |
07:49:48 | FromGitter | <alehander42> happen very rarely in very specific situations |
07:50:15 | FromGitter | <alehander42> so basically you need to have a test that catches them |
07:51:13 | FromGitter | <alehander42> and even if you catch them by accident, it might be hard to reproduce sometimes (without some kind of a recorded trace) |
07:51:38 | Araq | here is how to get reliable software (IMHO, ymmv yada yada): |
07:51:43 | FromGitter | <alehander42> especially with multithreading (where you have a lot of stuff happening non-deterministically) |
07:52:00 | Araq | - you test the shit out of your software. |
07:52:09 | Araq | here is how to get more reliable software: |
07:52:32 | Araq | - you write two independent implementations with a clever way to combine them. |
07:52:41 | Araq | here is how to get even more reliable software: |
07:52:46 | Araq | - you prove it correct. |
07:53:27 | Araq | here is what to not do: you keep on piling type theory onto the language until you're unable to express the program that you need to write. |
07:54:29 | FromGitter | <alehander42> well ok but the goal is always to make it possible to prove classes of things correct with the least amount of end-user friction |
07:55:00 | FromGitter | <alehander42> people managed to put a lot more type theory these days than 40 years ago |
07:55:06 | FromGitter | <alehander42> :D |
07:55:29 | Araq | yeah and linear and affine types are awesome |
07:55:33 | FromGitter | <Varriount> @alehander42 Those are my main concerns as well. |
07:57:29 | FromGitter | <Varriount> I've had programs that are hard to write tests for, because they depends on things like remote APIs. And there's only so much you can mock or separate |
07:58:47 | FromGitter | <alehander42> Araq: yeah and my hope is that we eventually evolve a way to make variants of those and similar (e.g. session types) ideas easy to use |
07:58:48 | Araq | here is what happened with Sqlite: they tested the shit out of it and claimed the type system is irrelevant. here is what not happened: They wrote a blog post about how 'const' in C helps with software reliability. |
07:59:15 | FromGitter | <alehander42> yeah, but sqlite's tests are literally famous because almost nobody does that |
07:59:18 | * | jjido joined #nim |
07:59:37 | FromGitter | <alehander42> (yeah airplane industry & medical software etc) |
08:00:08 | FromGitter | <alehander42> i am not disagreeing: testing a lot is great |
08:00:46 | FromGitter | <alehander42> but thats kinda the point: if you test the shit out of your software, why do you even need types |
08:01:11 | Araq | yeah you don't. the types are good for readability and the compiler's optimizer. |
08:01:13 | FromGitter | <alehander42> and owned etc, technically tests will catch even more obvious dynamic errors |
08:01:41 | FromGitter | <alehander42> nah, correctness is way more important than the optimizer |
08:03:43 | FromGitter | <alehander42> if you have A which you are sure it works correctly in 99% of the cases and has 90% speed and B which is correct in 90% cases and has 98% speed, most people would choose A : adding hw resources to improve speed is trivial, the other thing not so much (yeah in some cases errors are tollerable but those are not so interesting) |
08:07:10 | FromGitter | <mratsim> There is a big issue with SQLite and nil/option value :/ receiving NULL when you expect an int is a pain. |
08:29:06 | * | kapil____ quit (Quit: Connection closed for inactivity) |
09:12:58 | * | crem quit (Ping timeout: 258 seconds) |
09:16:14 | * | uvegbot quit (Remote host closed the connection) |
09:16:46 | * | uvegbot joined #nim |
09:50:02 | * | crem joined #nim |
10:00:31 | * | xet7 quit (Quit: Leaving) |
10:07:46 | Zevv | types are good to remind me in a year or two what the hell I was trying to do. They show intent. |
10:11:29 | Zevv | *are also*, not just :) |
10:12:59 | * | nsf quit (Quit: WeeChat 2.4) |
10:20:38 | * | solitudesf quit (Ping timeout: 250 seconds) |
10:31:25 | * | hoijui joined #nim |
11:07:44 | * | xet7 joined #nim |
11:08:52 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:16:42 | * | sutke11782 quit (*.net *.split) |
11:16:42 | * | redlegion quit (*.net *.split) |
11:16:42 | * | thomasross quit (*.net *.split) |
11:16:42 | * | shadowbane quit (*.net *.split) |
11:16:43 | * | deepend quit (*.net *.split) |
11:16:43 | * | GaveUp quit (*.net *.split) |
11:17:04 | * | GaveUp joined #nim |
11:17:33 | * | sutke11782 joined #nim |
11:17:34 | * | thomasross joined #nim |
11:17:51 | * | deepend joined #nim |
11:18:00 | * | shadowbane joined #nim |
11:19:00 | * | banc quit (Ping timeout: 246 seconds) |
11:19:00 | * | redlegion joined #nim |
11:19:01 | * | redlegion quit (Changing host) |
11:19:01 | * | redlegion joined #nim |
11:22:28 | * | banc joined #nim |
11:28:05 | * | theelous3_ joined #nim |
11:37:14 | FromDiscord | <demotomohiro> type system find error earlier. Testing a program could take longer than checking types |
11:37:38 | * | theelous3_ quit (Ping timeout: 250 seconds) |
11:40:46 | * | clyybber joined #nim |
11:43:23 | FromDiscord | <demotomohiro> When I used python, it reported a error like argument 1 must be blah blah ... after runnig my program 3 minutes. |
11:43:42 | * | kapil____ joined #nim |
11:56:26 | * | Snircle joined #nim |
12:06:22 | * | skrylar joined #nim |
12:10:04 | * | mosORadi joined #nim |
12:10:32 | skrylar | i heard rumblings that nfltk is broken these days |
12:41:54 | * | stefanos82 joined #nim |
12:45:14 | * | hoijui quit (Ping timeout: 250 seconds) |
13:01:53 | FromGitter | <mratsim> NFL toolkit? |
13:02:33 | FromGitter | <mratsim> or NLTK for natual language? or something I don't now, fltk, nltk? |
13:06:29 | * | jjido joined #nim |
13:14:21 | skrylar | it was that fltk gui binding i did yeee while ago |
13:57:15 | * | dddddd joined #nim |
14:07:33 | * | Vladar joined #nim |
14:13:30 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:19:37 | * | mosORadi quit (Quit: Connection closed for inactivity) |
14:25:00 | * | rnrwashere joined #nim |
14:46:16 | * | rnrwashere quit (Remote host closed the connection) |
14:57:27 | * | solitudesf joined #nim |
15:08:15 | * | xet7 quit (Ping timeout: 268 seconds) |
15:14:18 | * | sealmove joined #nim |
15:15:21 | clyybber | Araq: Why is `end` a keyword? |
15:15:36 | clyybber | Its only used in template filters right? |
15:16:16 | clyybber | *source code filters |
15:19:48 | FromGitter | <liquid600pgm> gosh, `end` being a keyword is really annoying |
15:20:23 | * | xet7 joined #nim |
15:20:30 | clyybber | yeah I agree |
15:20:45 | clyybber | and afaict it has no use outside of source code filters. |
15:20:48 | FromGitter | <liquid600pgm> sometimes I just want to measure time and have to use `fin` instead of `end`, and that kind of upsets me |
15:24:33 | Zevv | It was probably reserved for potential future use; better safe then sorry. it has been there since day 1 if I look back in git |
15:26:28 | * | nsf joined #nim |
15:26:40 | Zevv | Q: i have a macro generating code that calls templates. Is there a way to get a repr of the generated code with the templates fully expanded? |
15:27:09 | * | rockcavera quit (Remote host closed the connection) |
15:28:11 | * | sealmove quit (Quit: WeeChat 2.4) |
15:33:47 | * | Vladar quit (Remote host closed the connection) |
15:44:51 | * | hoijui joined #nim |
16:20:17 | FromGitter | <edrd-f> Hi! I'm new to the language and I'm trying to build a simple API client class that uses the async http client from the standard library, but I'm having an issue with the future stuff... What is wrong with my code? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c9f97417ecbdc29cacfe3a7] |
16:20:46 | FromGitter | <edrd-f> I'm getting the following message: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c9f975dbd70a40d5fc8f5b5] |
16:21:14 | FromGitter | <edrd-f> (truncated for better readability) |
16:21:51 | FromGitter | <liquid600pgm> first of all, avoid using `new` as a proc name, as it's used for creating `ref T` in the stdlib, use `newClient` instead |
16:22:32 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
16:29:30 | FromGitter | <edrd-f> right, ty :) |
16:32:13 | * | clyybber quit (Quit: WeeChat 2.4) |
16:32:23 | * | clyybber joined #nim |
16:32:35 | * | kapil____ quit (Quit: Connection closed for inactivity) |
16:48:21 | * | rnrwashere joined #nim |
16:50:38 | * | rnrwashere quit (Client Quit) |
17:09:06 | * | rnrwashere joined #nim |
17:24:49 | * | rnrwashere quit (Remote host closed the connection) |
17:25:33 | * | rnrwashere joined #nim |
17:30:09 | * | rnrwashere quit (Ping timeout: 258 seconds) |
17:34:34 | * | narimiran joined #nim |
17:58:18 | * | nsf quit (Quit: WeeChat 2.4) |
18:15:00 | * | I_Right_I joined #nim |
18:29:46 | * | theelous3_ joined #nim |
18:37:05 | FromGitter | <alehander42> You don't specify |
18:37:08 | FromGitter | <alehander42> A return type |
18:37:41 | FromGitter | <alehander42> I think k |
18:38:11 | FromGitter | <edrd-f> right... I tried this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c9fb793759abc043c3adad4] |
18:44:32 | FromGitter | <edrd-f> hmm, actually I had to remove the .async. macro |
18:44:40 | FromGitter | <edrd-f> because I'm not using await in the method |
18:44:46 | * | skrylar quit (Read error: Connection reset by peer) |
18:45:15 | Zevv | that seems ok to me |
18:48:20 | Zevv | any reason you are using methods instead of procs? |
18:51:01 | FromGitter | <edrd-f> from what I've read in the docs it's just a syntactic sugar, but idk, shouldn't I use it when working with object types? |
19:11:01 | * | luis_ joined #nim |
19:22:50 | Zevv | A nim object is not an OO-object; the nomenclature is a bit confusing |
19:23:09 | Zevv | an object in Nim is nothing more then a container, translating to a struct in C |
19:23:39 | FromGitter | <liquid600pgm> methods are used for dynamic dispatch, you should use procs whenever you don't need it |
19:24:38 | Zevv | actually, I have learned to avoid methods - there are some cases when mixing generics and methods will bite you |
19:25:54 | Zevv | basically, the only reason for using methods is if you need dynamic dispatch or inheritance. But having objects with functions acting on them require nothing special in Nim. |
19:26:15 | FromGitter | <liquid600pgm> ^ |
19:27:47 | * | solitudesf quit (Quit: Leaving) |
19:29:04 | * | hoijui quit (Remote host closed the connection) |
19:29:20 | Zevv | I wasn't there when it was born, but I guess OO was added to Nim as an afterthought, and even the author is not really sure if it works the way it should. The whole {.base.} thing is a bit odd, for example |
19:30:57 | clyybber | Any idea why this casting concats the elements? https://hastebin.com/unixarejek.md |
19:33:06 | Zevv | What output do you get? |
19:34:00 | clyybber | @[9, 205, 4, 10, 7, 2, 8, 25, 125, 107, 28, 51, 255, 212, 245, 217, 190, 107, 16, 1, 31, 40, 29, 179] |
19:34:02 | clyybber | @[9, 205, 4, 10, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
19:34:09 | clyybber | the first one is the original |
19:34:18 | clyybber | and the second one is after casting forth and back |
19:35:49 | * | solitudesf joined #nim |
19:37:30 | Zevv | 24 u32s casted to 24 u8s will give you 9 0 0 0 204 0 0 0 4 0 0 0 10 0 0 0 7 0 0 0 2 0 0 0. After that you extend the length to 96 elements, which will pad the rest to zeros. Casting back to uint32 will then only yield the original six first elements. |
19:37:41 | Zevv | does that make sense |
19:37:59 | Zevv | so this is pretty much what i'd expect? |
19:38:19 | clyybber | I thought so too, but using newSeq with seqToSort.len*4 doesnt fix it either |
19:39:17 | Zevv | I'm not sure I see what output you are trying to get. The original seq? |
19:39:22 | clyybber | yeah |
19:39:46 | Zevv | Problem is that casting to u8 needs 4 times the elements. So extend to 4*len first, then cast, truncate back and do the rest, I guess |
19:39:49 | Zevv | let me try |
19:40:08 | clyybber | yeah thats what I do with newSeq, but it doesn't change the output somehow |
19:40:41 | Zevv | http://paste.debian.net/1075335/ |
19:43:54 | FromGitter | <alehander42> Is this the line |
19:45:45 | clyybber | Zevv: Thank you, but why doesn't creating seq1 with seqToSort.len * 4 work? |
19:46:11 | clyybber | Oh, I see, because the cast interprets the len field too. |
19:46:14 | Zevv | :) |
19:46:16 | clyybber | Thanks Zevv |
19:46:19 | Zevv | np |
19:51:47 | FromGitter | <alehander42> I don't agree I think oop works fine in Nim |
19:52:09 | FromGitter | <alehander42> I don't like oop a lot but I don't see what radical is missing |
19:52:26 | FromGitter | <alehander42> Maybe there is stuff missing |
19:53:20 | * | sealmove joined #nim |
19:59:48 | Zevv | alehander42: https://forum.nim-lang.org/t/4486 |
20:04:06 | Zevv | and https://github.com/nim-lang/Nim/issues/10038 |
20:04:24 | * | rnrwashere joined #nim |
20:04:24 | Zevv | nevermind, the second does not add any information |
20:10:09 | * | rnrwashe_ joined #nim |
20:10:31 | * | nsf joined #nim |
20:10:42 | * | couven92 quit (Quit: Client disconnecting) |
20:12:34 | * | rnrwashere quit (Ping timeout: 250 seconds) |
20:20:58 | * | sealmove quit (Quit: WeeChat 2.4) |
20:28:08 | FromGitter | <alehander42> Hm |
20:28:14 | FromGitter | <alehander42> Not sure about the details |
20:28:35 | * | rnrwashe_ quit (Remote host closed the connection) |
20:28:51 | * | rnrwashere joined #nim |
20:35:17 | * | rnrwashere quit (Remote host closed the connection) |
20:37:08 | * | narimiran quit (Ping timeout: 250 seconds) |
20:39:44 | * | luis_ quit (Quit: luis_) |
20:42:02 | clyybber | Nice, got smoothsort ported... |
20:42:41 | clyybber | anyone got some sort algorithm implementations to compare to? |
20:43:06 | * | kurisu left #nim ("WeeChat 2.4") |
20:47:22 | Zevv | I can write you a bubble sort :) |
20:57:34 | clyybber | very hard to beat :D |
21:24:46 | * | xet7 quit (Ping timeout: 255 seconds) |
21:24:52 | FromGitter | <Varriount> clybber: I have a quick sort algorithm |
21:25:10 | FromGitter | <Varriount> It uses the Hoare partitioning scheme |
21:25:44 | Zevv | there is the stdlib quicksort, no? |
21:25:48 | Zevv | or is that c qsort? |
21:26:53 | Araq | mergesort |
21:31:00 | clyybber | Varriount: Have a link? |
21:32:44 | clyybber | Just compared it to the mergesort in algorithm. Looks to be 10% faster on average. Though I havent tested it extensively on big and meaningful data yet |
21:37:42 | * | vegax87 quit (Changing host) |
21:37:42 | * | vegax87 joined #nim |
21:37:42 | * | vegax87 quit (Changing host) |
21:37:42 | * | vegax87 joined #nim |
21:42:05 | Araq | is it a stable sort? |
21:46:33 | clyybber | No |
21:51:53 | clyybber | brb |
21:51:55 | * | clyybber quit (Quit: WeeChat 2.4) |
22:05:40 | * | stefanos82 quit (Remote host closed the connection) |
22:07:34 | * | xet7 joined #nim |
22:10:42 | * | solitudesf quit (Ping timeout: 246 seconds) |
22:21:34 | * | nsf quit (Quit: WeeChat 2.4) |
22:21:49 | * | noeontheend joined #nim |
22:26:02 | * | noeontheend quit (Ping timeout: 250 seconds) |
22:28:19 | Araq | a stdlib sort must be stable though |
22:36:43 | * | rnrwashe_ joined #nim |
22:39:43 | Araq | and "stable" here does not mean "solid, well tested", it means the algorith maintains the relative order of records with equal keys |
22:41:12 | * | rnrwashe_ quit (Ping timeout: 250 seconds) |
22:55:13 | * | clyybber joined #nim |
22:55:48 | clyybber | Araq: I know, I wasn't proposing to include it in the stdlib exactly because of that reason |
22:56:17 | Araq | I know you know, I wrote for the other readers who might not know |
22:59:47 | clyybber | :D |
23:10:09 | clyybber | good night |
23:10:11 | * | clyybber quit (Quit: WeeChat 2.4) |
23:26:48 | FromDiscord | <Avatarfighter> Has anyone had any success with building nim for raspbian? |
23:27:32 | FromDiscord | <Avatarfighter> I'm currently getting an error after running `./koch tools` which produces an error sadly :L |
23:29:02 | FromDiscord | <Avatarfighter> specifically this: https://hastebin.com/inonojudek.js |
23:30:33 | FromGitter | <Varriount> Araq: Stable sorts are cool under pressure. :P |