IRC logs for #openttd on OFTC at 2020-08-08
            
00:03:24 *** Wolf01 has quit IRC
00:52:17 <b_jonas> drat! I knew the signals at this station could cause a deadlock, but I couldn't figure out how to fix that without making it much more complicated. now it did softlock itself, so I have to figure out something.
00:54:41 <b_jonas> but I still don't know a nice general solution for this type of station
00:55:31 <b_jonas> it's a single station that two separate single lines with a single train each visit, merging only very close to the station. is that really impossible to signal correctly?
00:58:20 <b_jonas> anyway, fixed now
01:02:16 <FLHerne> b_jonas: 2-way path signal just before the junction on each branch
01:02:28 <FLHerne> No signals between the junction and station
01:02:51 <FLHerne> (doesn't work if there's more than one train per line)
01:03:30 <FLHerne> [by 2-way I mean the kind that can be passed from behind]
01:07:18 *** Progman has joined #openttd
01:10:14 <b_jonas> FLHerne: that's what I tried, it would have worked if it weren't for one train hiding in a depot so the signals didn't notice it
01:11:02 <b_jonas> I could probably have solved that by placing depots only far from that station
01:11:15 <b_jonas> but instead I solved it properly by building a bit more track
01:25:15 *** glx has joined #openttd
01:25:15 *** ChanServ sets mode: +v glx
01:54:36 <b_jonas> my game reached 2051
01:54:43 <b_jonas> (I started in 1950)
02:00:55 <Eddi|zuHause> i don't think i've ever played to 2051
02:02:25 *** Progman has quit IRC
02:04:39 *** Hobbyboy has quit IRC
02:27:06 <b_jonas> my previous game went to 2087
02:27:24 <b_jonas> there's still a lot to improve on this
02:27:55 <Eddi|zuHause> i played from 1930 to 2030 once when that was the end of the game
02:29:09 <b_jonas> I think I finally got my steel line to transport all the steel I produce, but I think I'll have to increase the capacity of the goods line too, and there's still several mines that I could connect to the steel mill but I haven't yet because already so little of the steel was transported
02:30:39 <b_jonas> so it still seems fun to develop this steel network further
03:12:21 *** Hobbyboy has joined #openttd
04:03:07 *** glx has quit IRC
04:24:56 *** D-HUND has joined #openttd
04:28:17 *** debdog has quit IRC
04:51:25 *** Flygon has joined #openttd
06:01:49 *** jhq has joined #openttd
06:03:20 *** D-HUND has quit IRC
06:03:20 *** Hobbyboy has quit IRC
06:03:20 *** b_jonas has quit IRC
06:03:20 *** Artea has quit IRC
06:03:20 *** BekJut[m] has quit IRC
06:03:20 *** karoline[m] has quit IRC
06:03:20 *** _dp_ has quit IRC
06:03:20 *** grossing has quit IRC
06:03:20 *** skrzyp has quit IRC
06:03:20 *** crem has quit IRC
06:03:20 *** milek7 has quit IRC
06:03:20 *** jback has quit IRC
06:03:20 *** moll has quit IRC
06:03:20 *** Markk has quit IRC
06:03:20 *** Heiki[m] has quit IRC
06:03:20 *** robert[m]1 has quit IRC
06:03:20 *** karl[m] has quit IRC
06:03:20 *** ciet[m] has quit IRC
06:03:20 *** ad5twoknebor[m] has quit IRC
06:05:01 *** crem has joined #openttd
06:06:06 *** debdog has joined #openttd
06:07:08 *** moll has joined #openttd
06:08:37 *** grossing has joined #openttd
06:08:43 *** Markk has joined #openttd
06:08:56 *** Hobbyboy has joined #openttd
06:09:34 *** BekJut[m] has joined #openttd
06:10:00 *** milek7 has joined #openttd
06:43:44 *** b_jonas has joined #openttd
06:43:44 *** Artea has joined #openttd
06:43:44 *** karoline[m] has joined #openttd
06:43:44 *** _dp_ has joined #openttd
06:43:44 *** skrzyp has joined #openttd
06:43:44 *** karl[m] has joined #openttd
06:43:44 *** robert[m]1 has joined #openttd
06:43:44 *** ad5twoknebor[m] has joined #openttd
06:43:44 *** Heiki[m] has joined #openttd
06:43:44 *** ciet[m] has joined #openttd
08:27:40 *** nielsm has joined #openttd
08:54:40 *** HerzogDeXtEr has joined #openttd
09:24:13 *** andythenorth has joined #openttd
09:37:22 <andythenorth> yo
09:43:45 * andythenorth logs
09:43:53 <andythenorth> my current game is 1890-2016
09:44:00 <andythenorth> unusually long
09:46:14 *** iSoSyS has joined #openttd
09:49:30 *** iSoSyS has quit IRC
09:50:49 *** iSoSyS has joined #openttd
10:13:58 *** b_jonas has quit IRC
10:18:00 <_dp_> crazy idea of the day: circuit racing in openttd
10:21:02 *** sla_ro|master has joined #openttd
10:22:49 <andythenorth> o_O
10:36:40 <_dp_> need some way to make shared waypoints though...
10:40:45 <andythenorth> I'm sure I've seen an 8 segment display done in logic
10:41:00 <andythenorth> could do lap counters :P
10:41:14 <andythenorth> https://www.youtube.com/watch?v=GTjQa70wwCc
10:41:18 <_dp_> I could do lap counters with just signs :P
10:41:34 <andythenorth> well yes, there is the easy solution :P
10:42:19 * andythenorth considers doing it by loading cargos on to ships
10:42:28 <andythenorth> then changing the sprites
10:42:52 <_dp_> for what I'm thinking that's the only solution because rail logic can't distinguish liveries :p
10:43:04 <andythenorth> for shame
10:43:26 <andythenorth> patch!
10:43:39 <TrueBrain> is andythenorth going to write a patch? :P
10:43:50 <andythenorth> maybe
10:43:59 <andythenorth> predicting the future is hard
10:44:05 <andythenorth> _probably_ not
10:44:13 <TrueBrain> some things are more likely than others :)
10:44:25 <TrueBrain> like, it is very likely it will be hot outside today
10:44:51 <TrueBrain> unless the sun exploded and we will only know in 6 minutes, that is a very likely outcome of the day
10:44:54 <_dp_> I can make track with a server company, color player trains with liveries and copy their orders from real player-owned train
10:45:00 <_dp_> only problem is shared waypoints
10:45:21 <andythenorth> _dp_ is it Train Whack 2.0?
10:45:29 <TrueBrain> hmm ... shared infrastructure ...
10:45:33 <TrueBrain> there is a patch for that, I am sure :P
10:45:50 <_dp_> nah, patch is a boring solution :p
10:45:59 <andythenorth> Train Whack: the Next Generation
10:46:07 <andythenorth> Train Whack Redemption
10:46:10 <TrueBrain> a racetrack doesn't need waypoints tbh
10:46:41 <andythenorth> one of the sillier things to do in Blitz (7 v 7 tank game) is tank racing
10:46:49 <andythenorth> hard to prevent cheating though
10:46:53 <TrueBrain> or, you know, play that game :P
10:47:09 <nielsm> hmm, an industry that accepts just one unit of cargo ever, but that unit of cargo pays out a million on delivery
10:47:09 <_dp_> well, I'm thinking to make a spaghetti of purr rails with waypoints
10:47:26 <_dp_> there isn't much point racing in openttd if that's just a circle :p
10:47:40 <TrueBrain> and ......... that is a problem?
10:48:36 *** andythenorth_ has joined #openttd
10:48:43 <andythenorth_> in tanks you can shoot each other's tracks
10:48:51 <andythenorth_> trains have tracks too....
10:48:55 <andythenorth_> also oof wifi
10:50:16 <_dp_> well, I guess I could always do some silly racing where the speed of the train is a hash or all players actions or smth...
10:51:02 <TrueBrain> make 4 identical islands and make people compete (race) to get that one cargo moved to the right place! :P
10:51:14 <andythenorth_> GS
10:51:18 <andythenorth_> research faster trains
10:51:23 <andythenorth_> make choices
10:51:25 <andythenorth_> set gear ratios
10:51:29 <andythenorth_> choose engines
10:51:35 <TrueBrain> hire crew!
10:51:37 <andythenorth_> yair
10:51:41 <TrueBrain> we are good at this :)
10:51:56 <andythenorth_> choose to shoot the other team's best driver!
10:52:04 <andythenorth_> Syndicate
10:52:40 <TrueBrain> hire disasters you mean :)
10:52:48 <_dp_> hm... buoys can be ownerless it seems...
10:53:34 <TrueBrain> _dp_: modify the server that a waypoint is appearing as owned by the player receiving that packet :)
10:53:40 <_dp_> I thought of sending some engines the other way with ignore signals jammed xD
10:53:46 <TrueBrain> does mean all clients need to be connected before they are created :P
10:54:20 <_dp_> TrueBrain, yep, and I actually thought of that already :p
10:54:45 <TrueBrain> whoho, my mindread device works again \o/
10:54:54 *** andythenorth has quit IRC
10:55:43 <_dp_> funnily enough I actually do some desync shenanigans on citymania already
10:55:48 <_dp_> it's just story book though
10:57:45 <_dp_> to add engine unlock progress on a common page with requirements
10:58:19 <_dp_> otherwise I'd have to make an owned copy
10:59:16 *** andythenorth_ has quit IRC
10:59:43 *** andythenorth has joined #openttd
11:04:23 <_dp_> I guess I could rebuild the whole track after company is created...
11:04:52 <_dp_> and don't even need to desync anything then
11:05:54 <_dp_> just significantly more work than I expected :(
11:08:12 *** andythenorth has quit IRC
11:08:43 *** andythenorth has joined #openttd
11:14:10 <TrueBrain> I love that between things you say, andythenorth reconnects
11:15:28 <TrueBrain> I really don't like Rust for "return values are the last statement IF there is no ; at the end" .. :(
11:16:34 <_dp_> yeah, it's a bit weird
11:16:36 <_dp_> but useful
11:16:42 <_dp_> also not a rust invention
11:17:07 <TrueBrain> it is not useful, it often takes time to track down in which branch you went wrong
11:17:13 <TrueBrain> and you have to look really closely to your code
11:17:17 <TrueBrain> it is not as obvious as it could be
11:17:25 <TrueBrain> which is a shame
11:17:36 <TrueBrain> I like languages where you can just read it like a book, instead of having to look for clues
11:18:48 *** Samu has joined #openttd
11:20:41 <Samu> h
11:20:42 <Samu> hi
11:20:58 <_dp_> it's a functional programming thing that blocks can return value
11:21:03 <_dp_> lets you assing ifs and stuff
11:21:14 <TrueBrain> they made it some weird hybrid now
11:21:18 <TrueBrain> as you can still use the return statement
11:21:36 <TrueBrain> in a functional language, this is done in a pure form, which is different
11:21:44 <TrueBrain> (where early-returns are impossible)
11:22:01 <TrueBrain> and, tbh, functional languages you cannot read as a book :P
11:22:17 <TrueBrain> it requires some weird brain quirks to be able to read that without thinking :D
11:22:25 <_dp_> well, yeah, but pure fp languages didn't quite take off :p
11:22:38 <TrueBrain> erlang being on top, but yeah, I agree
11:23:04 <TrueBrain> but now you constantly have to scan lines .. as in: you read something, you have to skip to the end of the statement, which can be lines away, to see if this is the return value
11:23:08 <TrueBrain> it is like reading Latin
11:23:20 <TrueBrain> (where a sentence can cross 6 pages, thank you Caesar)
11:24:20 <_dp_> TrueBrain, http://shakespearelang.sourceforge.net/report/shakespeare/#sec:hello
11:24:24 <_dp_> reads like a book! :p
11:24:31 <TrueBrain> yeah ... different kind of book :P
11:29:13 *** Progman has joined #openttd
11:29:28 *** tokai|noir has joined #openttd
11:29:28 *** ChanServ sets mode: +v tokai|noir
11:31:55 *** iSoSyS has quit IRC
11:32:34 <TrueBrain> it is funny that I know some people only of their disconnect/reconnect :P
11:33:47 <TrueBrain> " cpu.load8(cpu.reg_c, (0 << 16) + (0x9b + cpu.reg_d))" <- I always love AST Visitors, you can make it output other languages really easy
11:36:18 *** tokai has quit IRC
11:37:51 <TrueBrain> cpu.load16(cpu.reg_c, cpu.ptr24(cpu.resolve24(cpu.ptr24(cpu.resolve24(cpu.ptr16((0 << 16) + ((0x00 + cpu.reg_d) & 0xffff)))))) + cpu.reg_y)
11:37:54 <TrueBrain> aint it a beaty? :D
11:44:19 <_dp_> hm... can I do a slipstream in openttd? xD
11:44:53 <TrueBrain> if you build it, sure!
11:56:19 <TrueBrain> lol .. Rust HashMaps are not deterministic? I thought we learned that lesson with Python .. guess we are going to repeat history :)
11:56:53 <TrueBrain> "It is against Hash DoS attacks", owh, what a baloney reasoning
11:57:27 <nielsm> wasn't the issue with python's hash maps exactly that it was deterministic, and thus you could force-feed it a data set causing pathological behaviour?
11:57:57 <TrueBrain> in Python for a long time dicts ("hash maps") were seeded on startup
11:58:03 <TrueBrain> which give many many many many programming errors
11:58:11 <TrueBrain> since .. 3.8? they made it deterministic again, I believe
11:58:36 <TrueBrain> mind you, I am talking about deterministic .. I don't care how things are seeded
11:58:42 <TrueBrain> I care that if I put things in in one order
11:58:44 <TrueBrain> I get it out in the same
11:59:01 <TrueBrain> which .. is a lessen Python learnt, and Rust seems to have forgotten :P
11:59:25 <nielsm> in C++ STL it's called an unordered_map when you want a "hash map"
11:59:39 <_dp_> that's not deterministic that's ordered :p
11:59:40 <TrueBrain> I like those namings, as it makes it much more clear what it is you are using
11:59:54 <nielsm> a map is not a list or array, it's not ordered
12:00:03 <TrueBrain> _dp_: well, I don't really care about orderning, I care about getting the same result between runs ;)
12:00:21 <TrueBrain> nielsm: in Python it now is :)
12:00:26 <TrueBrain> which really helps a lot in many cases
12:00:56 <TrueBrain> but now I have a program again that behaves different between runs
12:01:02 <TrueBrain> which is always a bitch to notice ...
12:01:14 <TrueBrain> (and sucks during debugging :P)
12:01:41 <_dp_> ah, that...
12:01:53 <_dp_> isn't there some hashmap implementation that does what you want?
12:01:58 <TrueBrain> there is
12:02:04 <TrueBrain> but .. you first need to notice the default is not
12:02:17 <TrueBrain> giving it a better name would solve these things ;)
12:02:28 <TrueBrain> just a generic "HashMap" is not descriptive
12:02:32 <TrueBrain> "YES, BUT IT IS IN THE README"
12:02:33 <_dp_> default things in rust are secure-focused indeed
12:02:35 <TrueBrain> owh, sod off ..
12:02:36 <_dp_> same with random
12:02:45 <_dp_> it takes some effort to make it non-secure :p
12:03:02 <TrueBrain> that is the fun part, this has not that much to do with security .. you can have it randomly seeded AND still be deterministic .. it just takes more memory :)
12:03:13 <TrueBrain> and I am fine this is the default .. just don't name it something generic
12:03:17 <TrueBrain> it screws people over ..
12:03:24 <TrueBrain> I notice it now, which is fine. But how many people do not notice it?
12:03:43 <_dp_> how many people do even care?
12:03:49 <TrueBrain> and "consistent" might be a better word over "deterministic" btw
12:04:02 <TrueBrain> well, given the amount of bugs shown by Python applications, I would say: A LOT
12:04:11 <TrueBrain> Python has shown the horrors that can come from this :)
12:04:23 <TrueBrain> tests that randomly fail, but are never reproducible, shit like that
12:04:36 <TrueBrain> so so so so so many stackoverflow articles about that :P
12:06:20 <nielsm> and yet it's such a simple concept: a map is not a list or array, a map (from X to Y) is a data structure that lets you look up Y's based on putting in X's, it's not a thing for iteration
12:06:34 <nielsm> if you want an iterable ordered list of pairs of (X, Y) then make a list of pairs
12:06:41 <TrueBrain> nielsm: the issue is, they do allow you to iterate over it ;)
12:06:57 <TrueBrain> well, no, your solution doesn't always work
12:07:03 <TrueBrain> as that means finding X in that list is O(n)
12:07:07 <TrueBrain> which .. is rarely what you want
12:07:24 <nielsm> yes well, for small n that's typically the fastest, on modern archs :P
12:07:26 <TrueBrain> and of course, as mentioned too, it is in the readme, so strictly the world is all okay
12:07:30 <TrueBrain> but it is what you expect vs what you get :)
12:08:05 <_dp_> I kinda feel like people that assume anything about hasmap implementation never wrote one in their life :p
12:08:22 <TrueBrain> Rust gives an iter() over an HashMap .. that the order out is not the order in, I couldn't care less .. that the other out is depending on the position of the moon .. that just is a bit more troubling ;)
12:08:29 <nielsm> and that's why some basic computer science education is useful for programmers!
12:08:33 <_dp_> wtf would you assume a randomized structure be deterministic :p
12:08:38 <TrueBrain> _dp_: sadly, I wrote many, so that doesn't hold either ;)
12:09:00 <TrueBrain> nielsm: that is too easy to brush this off with :)
12:09:12 <TrueBrain> the easy comments: people should read, people should learn, people should know
12:09:31 <nielsm> but okay algorithm textbooks rarely talk about making a hashmap resistent to denial-of-service attacks
12:09:42 <TrueBrain> yet, here I am, a history in programming longer than my arm, being surprised by this. Should I have known better? Sure, I could have read. But then again .. they could have fucking picked a better name ;)
12:10:16 <TrueBrain> as one thing you learn in any CS study: nondeterministic programs are a fucking hell to debug.
12:10:24 <nielsm> anyway I have to go, out in the heat
12:10:28 <TrueBrain> enjoy :)
12:12:20 <andythenorth> oof
12:12:27 * andythenorth should have coffee
12:12:30 <_dp_> it's not like non-randomized are always nice :p
12:12:35 * _dp_ looking at openttd
12:12:48 <andythenorth> is today the day for writing an S3 uploader?
12:12:48 <TrueBrain> at least you always get the same result with the same input :)
12:14:48 <TrueBrain> funny enough, the solution a Rust crate offers, is simply keep a linked list of insertion order, on top of the HashMap
12:15:02 <TrueBrain> keeping the DoS protection too :)
12:15:21 <TrueBrain> what always strikes me as odd with the seeding between runs .. how often does a production process really roll over
12:15:40 <TrueBrain> I guess it is meant in the idea: if it does because someone did a Hash attack, he has to refind a new seed to do it again
12:15:48 <TrueBrain> bit of a poor-mans-solution, basically
12:15:49 <TrueBrain> shrug
12:15:52 <andythenorth> is rust the new thing?
12:16:00 <TrueBrain> if 2004 is new, sure
12:16:29 <andythenorth> seems we have a bit of a gap between python (any idiot can write it, bit slow, packaging is a car crash)
12:16:39 <andythenorth> and C++ (most web devs can't write it)
12:16:53 <andythenorth> we = my bit of the industry
12:16:55 <TrueBrain> Rust is mostly meant to write applications that are proven correct in some sense, I guess
12:17:12 <TrueBrain> if you don't use "unsafe", it is multithread safe and shit like that
12:17:18 <_dp_> andythenorth, that gap is for go lang
12:17:19 <TrueBrain> or claims to be .. have yet to find out if it is true :D
12:17:22 <_dp_> rust is a sane c++ :p
12:17:47 <andythenorth> oof let me know when one has won
12:17:50 <TrueBrain> they clearly took lessons from C++, yes :P
12:17:57 <andythenorth> I lived through the last war
12:18:13 <andythenorth> every 6 weeks, it was 'omfg Ruby has overtaken PHP today'
12:18:14 <andythenorth> etc etc
12:18:21 <_dp_> also wiki says rust is 2010 :P
12:18:26 *** nielsm has quit IRC
12:18:28 <TrueBrain> 2010? I thought 2004 ..
12:18:32 <andythenorth> 'you must switch now or your company is fucked'
12:18:36 <andythenorth> literally every 6 weeks
12:18:40 <_dp_> with 1.0 in smth like 2012
12:18:45 <TrueBrain> owh, 2006, my bad
12:18:46 <_dp_> TrueBrain, 2004 is like, python
12:19:01 <TrueBrain> "The language grew out of a personal project begun in 2006 by Mozilla employee Graydon Hoare"
12:19:41 <TrueBrain> _dp_: Python is a lot older .. like 1990 older
12:19:54 <_dp_> TrueBrain, yeah, nvm
12:20:01 <_dp_> 2004 is about when I learned it xD
12:20:05 <TrueBrain> guess we both suck in years :P
12:20:13 <andythenorth> we all suck at the past
12:20:34 <TrueBrain> but Rust is nice, as in, it is a bit more like a scripting language than C++, but it compiles to the speed of C
12:20:46 <andythenorth> should I write my s3 uploader in Rust? o_O
12:20:54 <TrueBrain> if you want to hurt yourself, sure
12:20:55 <andythenorth> nmlc rewrite in Rust? o_O
12:21:22 <andythenorth> TrueBrain we have to break ourselves to get stronger? :P
12:21:27 <andythenorth> oof
12:21:37 * andythenorth makes trains, for simpler life
12:21:49 <TrueBrain> for me it is like this: I love C, mostly ANSI C for some weird reason .. but writing modern things in C is difficult, because: bindings. I really really dislike C++, as ... well, you need education to do the basic things there. They really went the wrong way to keep things sane. And now you have Rust .. which allows sane humans to write applications again :)
12:21:50 <_dp_> andythenorth, rewrite TW :p
12:22:26 <andythenorth> Rust cross-compiles to JS? o_O
12:22:28 <TrueBrain> and Rust punishes you really really hard for trying to be to scripty, like trying to downcast classes :P
12:22:39 <TrueBrain> Rust can compile to anything; it is build on LLVM
12:22:50 <TrueBrain> well, it is a frontend to LLVM, is the better phrashing
12:22:59 <TrueBrain> and LLVM can output to ... a lot
12:23:39 <andythenorth> https://hacks.mozilla.org/2018/04/javascript-to-rust-and-back-again-a-wasm-bindgen-tale/
12:24:19 <TrueBrain> Rust has really nice bindings to anything .. they did that part really well
12:24:43 <TrueBrain> I am now writing a Rust application that generates Python code that is loaded in that same application to execute, where the Python code calls the Rust application to do the hard work .. :P
12:25:18 <andythenorth> that's the kind of use case I had in mind when I said there's a gap
12:25:38 <andythenorth> there are times when python is just....TBH slow
12:25:56 <TrueBrain> but Rust made some choices that are ... counter intuitive if you have been programming for more than a month :P
12:26:08 <TrueBrain> which is not always bad, just ... wrapping your head around it ..... is painful ....
12:26:42 <TrueBrain> funny enough, you can write webservers pretty easy in Rust these days :P
12:26:54 <TrueBrain> mostly because they have procmacros, which are ... insane
12:27:05 <TrueBrain> (they = Rust)
12:28:06 <TrueBrain> but yeah, given NML is mostly AST manipulation, it would be a lot quicker in Rust :P
12:28:07 <milek7> what about D? (as better C++)
12:28:11 <TrueBrain> fuck D
12:28:12 <TrueBrain> :P
12:28:30 <TrueBrain> WHY DO PROGRAMMING LANGUAGE HAVE THE NAMES OF WOMEN'S BREAST SIZES?!
12:29:04 <_dp_> imo rust is pretty much the first c/c++ replacement that not only does things better, but does them significantly better
12:29:07 <_dp_> unlike d and stuff
12:29:13 <_dp_> that are nice but no cookie :p
12:29:54 <TrueBrain> from my experience with Rust, I agree _dp_ :) I can bitch, but in general, it works a lot better than C++, and the binaries are blazingly fast
12:30:24 <TrueBrain> just the learning curve ... fucking hell :P
12:31:10 <_dp_> idk, haskel felt worse :p
12:31:19 <TrueBrain> fair; Erlang did too :P
12:31:24 <TrueBrain> but now you are just naming things on the spectrum :D
12:31:52 * andythenorth reading https://lucumr.pocoo.org/2015/5/27/rust-for-pythonistas/
12:32:29 <TrueBrain> it goes fine till you hit "borrow" :P
12:32:50 <TrueBrain> and be happy "lifetime" is only mentioned once in that document :P
12:32:58 <andythenorth> can't be worse than the first time python hits you with the need to deepcopy()
12:33:07 <andythenorth> especially if you've gone to prod with that error
12:33:08 <TrueBrain> you should never want to do that :)
12:33:20 <TrueBrain> but "borrow" is like learning pointers in C for the first time :)
12:33:36 <TrueBrain> and if you think you understand, really, you do not :P
12:33:52 <andythenorth> proving that point for you, why are pointers considered hard?
12:33:55 <andythenorth> :P
12:34:11 <andythenorth> there used to be advice to use them as a hiring question, apparently some programmers can't understand them
12:34:24 <TrueBrain> pointers are easy, the learning curve to get to that point, not so much :D
12:34:34 <TrueBrain> most Java programmers do not understand pointers
12:34:36 <andythenorth> I probably misunderstand them :)
12:34:39 <TrueBrain> so yeah, that doesn't surprise me :P
12:34:56 <TrueBrain> "memory is cheap" :)
12:35:18 <andythenorth> isn't nearly all of programming just passing pointers along?
12:35:24 <andythenorth> and some maths ops occasionally
12:35:30 <_dp_> for python programmers rust is probably just a pain in the ass
12:35:45 <_dp_> you kinda need to experience C++ to understand why it exists xD
12:35:57 <TrueBrain> haha, feel the pain first, you say? :P
12:47:21 *** andythenorth_ has joined #openttd
12:52:57 *** andythenorth has quit IRC
12:58:02 *** Progman has quit IRC
13:24:22 *** Samu has quit IRC
13:57:05 <TrueBrain> that moment you work on something for 10+ hours, to realize Python doesn't support "goto" statements .. oops, I knew that already :P (well, there is a pip package that does this, but only for Linux :P)
14:14:38 <andythenorth_> I learnt to program in Basic :P
14:15:10 <andythenorth_> at a time when the rule was becoming 'goto is evil, never use it' :D
14:15:53 <andythenorth_> hmm I just taught a child that you can guess the router will be on 192.168.1.or .254 if it stops handing out DHCP addresses
14:15:57 <andythenorth_> I hope this goes well
14:18:44 *** Wolf01 has joined #openttd
14:26:04 <TrueBrain> lol
14:29:04 *** keoz has joined #openttd
14:39:19 <andythenorth_> should I get him a port scanner?
14:52:00 <TrueBrain> free security check, why not
14:57:46 *** andythenorth_ has quit IRC
15:00:06 <TrueBrain> seems he found something :P
15:08:57 *** andythenorth has joined #openttd
15:27:21 *** andythenorth has quit IRC
15:59:21 *** andythenorth has joined #openttd
16:11:33 *** iSoSyS has joined #openttd
16:36:31 <LordAro> TrueBrain: that goto module was literally an april fools joke
16:38:02 <LordAro> personally, i think c++11(+) largely fixes the same problems rust does
16:38:45 <LordAro> and D is quite neat too
16:41:12 <TrueBrain> No, there are 2 implementations of the goto package .. one is maintained .. yes, really :p
16:41:52 <TrueBrain> And have you written anything real in Rust? As I have a hard time believing that you would think that :)
16:44:13 <_dp_> c++xx keeps piling up stuff on top of the existing language so even though that stuff it's not bad it ends up just expanding the mess
16:44:32 <_dp_> besides, with the pace it goes it will get to rust level at c++50 or smth
16:45:10 <TrueBrain> well, I guess what you consider "problems" in his statement :)
16:45:19 <TrueBrain> strongly depends on what you consider Rust fixes :D
16:45:41 <TrueBrain> cargo you can compare with vcpkg I guess, does that count? :D
16:46:06 <_dp_> vcwhat? win-smth? :p
16:46:42 <TrueBrain> I have to write a visitor that does advanced logic on what CPU flags are used .. and one that does advanced logic on where jumps go to, and create valid Python code based on that .. hmm
16:46:55 <TrueBrain> the first should be easy .. the second .. it might even be impossible without goto statements in some cases, I guess
16:47:28 <_dp_> but for example safer memory management, c++ is getting there but syntax is abysmal
16:47:41 <_dp_> are non-null smart pointers even in the standard yet?
16:48:09 <TrueBrain> I do wish some of the Rust RFCs would land in stable quicker
16:48:13 <TrueBrain> like generators ... I love generators :)
16:48:38 <TrueBrain> but the specs are not even settled on that yet .. still debate on what the syntax should be :(
16:48:54 <_dp_> at least they got rid of the lexical lifetimes finally xD
16:49:14 <TrueBrain> I am shocked I managed to avoid lifetimes in general so far
16:49:24 <TrueBrain> I had to add it in some places, but I could remove that with a simple refactor a bit later :D
16:49:43 <_dp_> well, the more you copy the less you have to deal with lifetimes
16:50:56 <TrueBrain> one thing I haven't discovered yet .. if Rust means with copy/move really a memcpy, or just a logical copy :)
16:51:12 <_dp_> idk what rust means I mean memcpy :p
16:51:16 <TrueBrain> it is .. ambiguous, in documentation :P
16:51:38 <TrueBrain> as either I am doing a lot of memcpy, which really is not needed
16:51:41 <TrueBrain> or everything just works fine :P
16:51:45 <_dp_> like, you can make a json parser that doesn't allocate strings
16:51:48 <TrueBrain> I am completely unsure, and I have no real way to figure it out :)
16:51:59 <_dp_> but it makes lifetimes tricky as lifetime of your output now depends on input
16:52:13 <TrueBrain> ghehe, yeah, that would be a bit silly :D
16:52:25 <_dp_> well, but it's bloody fast :p
16:52:50 <TrueBrain> I have these cases I am just not sure what Rust does .. like: struct A { ... }. I call a function with parameter "a: A"
16:52:56 <TrueBrain> it says it copies it (as I do not borrow it)
16:53:02 <TrueBrain> but .. I really hope it doesn't do a memcpy
16:53:10 <TrueBrain> as there really is no need :P
16:53:20 <TrueBrain> but if it is on the stack, it has to
16:53:26 <TrueBrain> so I hope it understand it should go to the heap
16:53:30 <TrueBrain> but again .. shrug
16:54:06 <TrueBrain> the compiler is really smart, I noticed; just the final decision is not really .. clear :)
16:57:08 <_dp_> I haven't written rust in a while so already forgot stuff like that
16:57:33 <TrueBrain> I have been looking if there is a command that simply tells you what Rust is doing with your variables
16:57:36 <TrueBrain> but haven't found it yet
16:57:41 <TrueBrain> feels like it is easy to mess up
16:57:49 <TrueBrain> now I am just crossing fingers and hope I am doing it right :P
16:58:03 <TrueBrain> so far the application is about 1000 times faster than Python, so I guess :P
16:59:25 <_dp_> well, 1000x is kinda expected with any compiled language tbh
16:59:31 <TrueBrain> yup
17:00:13 <_dp_> depends on what you're doing in python though
17:00:26 <_dp_> I remember it beating java on some stuff
17:00:31 <_dp_> not that java is very compiled but...
17:00:47 <TrueBrain> Python and Java work in the same manner, I guess :P
17:01:12 <_dp_> well, java has jit, python... idk anymore xD
17:01:23 <TrueBrain> PyPy! :D
17:03:39 <TrueBrain> owh, wow .. did not know about "cargo clippy"
17:03:43 <TrueBrain> lets see what it has to say :)
17:05:13 <TrueBrain> warning: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
17:05:16 <TrueBrain> it is a smart cookie
17:05:52 <TrueBrain> warning: you seem to be trying to use `&Box<T>`. Consider using just `&T` <- funny :)
17:05:56 <TrueBrain> I like how it makes tons of suggestions
17:09:48 *** Wormnest has joined #openttd
17:34:42 *** virtualrandomnumber has joined #openttd
17:38:10 *** virtualrandomnumber has quit IRC
17:53:15 <LordAro> TrueBrain: clippy is very good
17:53:45 <LordAro> did not know about the "new" goto py module though
17:55:38 <LordAro> also, 1000x faster seems quite high
17:55:46 <LordAro> even for compiled vs interpreted
17:59:31 <_dp_> python oop is very slow, if you do that a lot it's 1000x easily
17:59:38 <_dp_> also heavy math is about 100x
18:04:31 *** iSoSyS has quit IRC
18:22:15 *** andythenorth has quit IRC
18:25:17 *** andythenorth has joined #openttd
18:31:25 *** andythenorth has quit IRC
18:40:14 <TrueBrain> LordAro: mind you I am not saying Rust is 1000 faster than Python; just for my workload :) Turns out Python is terrible in spinlocking .. no real surprise there tbh :)
18:41:12 <TrueBrain> and I tried to make a piece of Python reach a 1/60 second deadline .. turns out Python is also terrible in that (shocker) .. spikes all over the place .. like: in 95% of the cases it could make it .. the other 5% were wayyyyyy out of bounds :P
18:41:28 <TrueBrain> that happens if you make Python into a hammer and try to make everything else a nail :D
18:42:23 <TrueBrain> also: http://entrian.com/goto/ <- 1st of April joke. Latest code, 2004
18:42:38 <TrueBrain> https://github.com/snoack/python-goto <- working module, with recent fixes :)
18:43:06 <TrueBrain> same syntax, wildly different implementations :P
18:44:10 <_dp_> TrueBrain, tried disabling gc? that usually makes python pretty consistent
18:45:11 <TrueBrain> I tried a few things, but mostly realized I was using the wrong tool for the tight deadlines I was going for :)
18:45:21 <TrueBrain> and it gave a nice excuse to try Rust ;)
18:46:08 <LordAro> yeah, python not good at (genuine) parallelism
18:47:19 <TrueBrain> this is more an fps kinda thing; so parallelism wouldn't have helped me here :)
18:48:08 <LordAro> so why spinlocking?
18:48:20 <TrueBrain> the parallelism issues I had, I could resolve by creating generators out of the code .. which was a nice way of solving a complex thing, as that meant I didn't need to care about thread-safety :)
18:49:03 <TrueBrain> spinlocks is code waiting for hblank and vblank
18:49:14 <TrueBrain> don't ask me why, I did not write the code I am emulating :)
18:49:18 <LordAro> i see
18:50:09 <TrueBrain> as I said, it is my workload more than Rust vs Python ;)
18:50:15 <TrueBrain> and most likely, my implementation of said workload :D
18:54:10 *** Flygon has quit IRC
19:20:43 *** andythenorth has joined #openttd
19:39:49 *** andythenorth has quit IRC
19:41:27 *** andythenorth has joined #openttd
19:51:41 *** andythenorth has quit IRC
19:52:15 *** Progman has joined #openttd
20:01:24 <TrueBrain> thread 'main' has overflowed its stack <- poor stack
20:13:35 *** andythenorth has joined #openttd
20:17:29 *** b_jonas has joined #openttd
20:42:49 *** gelignite has joined #openttd
21:27:47 <andythenorth> yo
21:27:51 <andythenorth> python sorting
21:28:25 <andythenorth> I have something like [1, 2, 3, 4, -2, -3, -1] (contents vary)
21:28:41 <andythenorth> I want to sort it to [1, -1, 2, -2, 3, -3, 4]
21:28:53 <andythenorth> specifically with the negative value after the positive, if it exists
21:28:58 <andythenorth> coolest solution
21:28:59 <andythenorth> ?
21:29:14 <andythenorth> I have a few hideous ones :P
21:30:14 <_dp_> sort(key=abs)
21:30:35 <_dp_> oh, negative after positive..
21:30:47 <TrueBrain> A range to your values?
21:30:52 <_dp_> a.sort() a.sort(key=abs) then :p
21:31:25 <_dp_> *a.sort(reverse=True) first
21:32:06 <TrueBrain> Does Python preserve order with equal? Cool ..
21:32:15 <_dp_> yep, timsort is stable
21:32:56 <TrueBrain> Funny!
21:33:05 <FLHerne> a.sort(key=lambda v: abs(v + 0.1))
21:33:28 <FLHerne> Er, sorry, - 0.1
21:33:43 <TrueBrain> I love the cheats :)
21:36:35 <_dp_> there is also key=lamda x: (abs(x), -x)
21:38:54 <TrueBrain> Now that is a lot cleaner at least :)
21:43:11 <andythenorth> result.sort(key=lambda x: (abs(x), -x)) seems pretty rad
21:43:24 <andythenorth> do I want to ask why that works? o_O
21:43:56 <_dp_> tuples are ordered element-by-element
21:46:46 <andythenorth> well it makes Horse tech tree display so much better :D
21:46:48 <andythenorth> thanks
21:50:13 *** andythenorth_ has joined #openttd
21:50:16 <andythenorth_> https://www.peterbe.com/plog/in-python-you-sort-with-a-tuple
21:50:18 <andythenorth_> so cool
21:51:16 <_dp_> it's probably the least effecient solution though
21:53:40 <andythenorth_> I buy more CPU :P
21:53:44 <andythenorth_> nah it's fine
21:55:46 *** andythenorth has quit IRC
21:58:29 <andythenorth_> hmm should I downgrade my CPU? :P
21:59:41 <andythenorth_> it's a 2.3Ghz i9 8 cores, I could have got a 2.6Ghz i7 with 6 cores for same or less money
21:59:57 <andythenorth_> most performance failures are single-threaded python, or the GPU
22:00:05 <andythenorth_> performance is pretty crap, but eh
22:13:28 <milek7> amd renoir are pretty good
22:15:35 <andythenorth_> not so performant with macos
22:15:41 <andythenorth_> as in, unsupported :)
22:22:53 <SpComb> that's the base clock, what's the turbo clock like?
22:23:58 <SpComb> my i5 is capable of sustained 5Ghz on all 6 cores, dunno if an i9 would really be stable at the same clocks on all 8 cores
22:46:05 <andythenorth_> Turbo Boost up to 4.8GHz allegedly
22:46:09 <andythenorth_> on the i9
22:46:26 <andythenorth_> Turbo Boost up to 4.5GHz on the i7
22:54:15 <_dp_> experirmenting with building ui... https://i.imgur.com/y3YesMm.png
22:55:20 <andythenorth_> auto! :D
22:55:26 <andythenorth_> I was thinking about that last week
22:55:37 <andythenorth_> orient to nearest track?
22:55:44 <andythenorth_> (matching railtype)
22:55:50 <_dp_> yep
22:56:12 <_dp_> well, auto has being in cmclient for ages, I just added ghost preview
22:56:34 <_dp_> *been
23:02:42 *** gelignite has quit IRC
23:05:33 <milek7> _dp_: does this whole window is necessary? :P
23:05:40 <milek7> default to auto on click
23:05:45 <milek7> click+drag for manual direction
23:06:32 <_dp_> I was thinking of ctrl + subtile coords for manual direction
23:06:48 <_dp_> but yeah, it may not be necessary now
23:07:16 <_dp_> though it cmclient format it still may be as it tries to keep all vanilla stuff by default