←2021-10-06 2021-10-07 2021-10-08→ ↑2021 ↑all
00:11:38 -!- asteriska has joined.
00:12:02 <asteriska> i died was there any developments
00:12:20 <asteriska> cant remember who it was i spoke to
00:15:53 <asteriska> wanted some help making a sane interpreter for hanoi love, or a way to run original quickbasic code in a browser
00:16:11 <asteriska> https://esolangs.org/wiki/Hanoi_Love is the link
00:17:17 <asteriska> any good base languages to start in? i see rust, cpp, java, and ruby fairly frequently used, along with javascript
00:17:47 <asteriska> realistically i havent really programmed before, want something to jump into and figure out, but also didnt want to doom myself
00:22:07 -!- oerjan has joined.
00:26:22 <sknebel> if you've dabbled with python, that's totally viable to make a small interpreter like that too
00:30:56 <asteriska> true, but id like to hear your opinions as well. what would you use, and why
00:34:28 <asteriska> hanoi love is stack based, and pretty close to the idealogy of brainfuck
00:34:40 <asteriska> simplistic and a small number of commands
00:35:08 <asteriska> well, sort of
00:42:35 <zzo38> Much of the computer programming I do is written in C
00:44:50 <asteriska> anything that draws you to c specifically? how long did it take you to learn?
00:46:40 <zzo38> About learning it, I don't remember.
00:47:14 <zzo38> About using it, well, it is common and also many other programming languages don't do some things as well
00:47:33 <asteriska> fair
00:48:22 <asteriska> what all do you tend to use it on? id like to know general use cases, from a real person instead of a broad spectrum on some wikipedia entry
00:51:04 <zzo38> Well, I wrote many programs (including some are incomplete), including NNTP client, picture processing, game, etc.
00:51:27 <zzo38> Sometimes I also use PostScript, and sometimes other programming languages, but mainly C
00:51:47 <asteriska> any experience with ruby? ive heard good things about it
00:52:41 <zzo38> I have not used Ruby (except maybe once to modify an existing program, although I don't really remember)
00:53:37 <asteriska> ah, i see
00:54:29 <asteriska> any opinion of java?
00:55:12 <zzo38> I don't really like Java, although I had used it once to read a Microsoft Compound file, although now 7-Zip does that so I can just use 7-Zip instead
00:55:51 <asteriska> any specific reason? ive heard java was indesirable elsewhere, but i dont remember why and whatfor
01:06:56 -!- asteriska has quit (Quit: Client closed).
01:21:34 <esolangs> [[Truth-machine]] https://esolangs.org/w/index.php?diff=88607&oldid=88569 * GoodCoderBBoy * (+319) /* Implementations */ added AutomataF
01:27:45 <esolangs> [[User:Dlosc]] https://esolangs.org/w/index.php?diff=88608&oldid=85384 * Dlosc * (-32) Changed Pip link to point to Esolangs page
01:46:07 -!- Sgeo has quit (Read error: Connection reset by peer).
01:48:41 -!- Sgeo has joined.
01:59:25 -!- scjosh has quit (Quit: The Lounge - https://thelounge.chat).
02:00:44 <sknebel> Python IMHO is a good first language to learn, unless you are specifically after low-level projects it's not suited for. lots of intro material, easy-ish to grok, tools and libraries for many different things.
02:07:00 -!- src has quit (Quit: Leaving).
02:11:52 -!- scjosh has joined.
02:28:44 -!- moony has changed nick to cd.
02:53:21 -!- dutch has quit (Quit: WeeChat 3.3).
03:27:40 -!- cd has quit (Quit: leaving).
04:15:38 <esolangs> [[Special:Log/newusers]] create * Asteriska * New user account
04:20:37 <esolangs> [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=88609&oldid=88605 * Asteriska * (+374) exist - asteriska
04:23:37 -!- cd has joined.
04:29:17 <esolangs> [[User:Asteriska]] N https://esolangs.org/w/index.php?oldid=88610 * Asteriska * (+220) Created page with "'''Welcome!''' This is the user page for Asteriska ( That's me! Hi. :> ) I am currently venturing into the programming language Ruby, on a quest to make a modern interpreter f..."
05:26:11 -!- delta23 has quit (Quit: Leaving).
06:47:33 <b_jonas> fizzie: re DOS VM bot, yes, that was my termbot. I never let it on #esolangs proper, but it was in #esolangs-blah . but it can't really run QBASIC – in theory it can, but the console i/o doesn't work, because QBASIC direct accesses the keyboard and video, while my bot uses serial console, so you can only use QBASIC programs if they read and write to regular files
06:47:52 <b_jonas> or perhaps if you edit the program to read and write serial port
06:49:46 <b_jonas> I agree with Python being a good first language to learn programming with, but also in its current form you can't write one-liners on it, and as such it's a bit hard to teach on IRC and especially with bots.
06:50:24 <b_jonas> as for Java, I don't know too much about it, you'll have to ask ais523 about how suitable it is in principle, and someone might be able to tell how much learning material there is available
06:50:54 <b_jonas> asteriska: it might help if you tell what kind of toy projects you want to try
06:51:57 -!- hendursaga has quit (Remote host closed the connection).
06:52:27 -!- hendursaga has joined.
07:06:27 -!- hendursaga has quit (Ping timeout: 276 seconds).
07:07:55 -!- oerjan has quit (Quit: Nite).
07:08:49 -!- hendursaga has joined.
07:26:30 -!- ais523 has joined.
07:27:51 <ais523> asteriska (for when you get back): I've taught Java as a first language to students, there are good learning resources around and it's a good starting point if you're looking for a job in Java or C# (and might also help if you're planning to go into C++ eventually)
07:28:20 <ais523> but, I don't think it's an ideal place to start with programming – it requires you to learn some concepts from Java-era object-oriented programming that won't be much use to you outside the three languages I listed
07:29:12 <ais523> and they're a) fairly hard to figure out relative to certain other programming concepts, although not terrible; and b) not actually a good way to think about programming
07:29:50 <ais523> I don't like Python, but it was invented as a teaching language and won't be horrible for that purpose; I'd recommend moving onto something else once you've got the basics figured out
07:30:04 -!- Sgeo has quit (Read error: Connection reset by peer).
07:30:37 <ais523> Rust is kind-of a high-risk option: it really forces you to learn and get comfortable with a number of low-level programming concepts, so the learning curve is very steep, but if you do manage to learn it the knowledge will be helpful in other low-level languages
07:30:46 <ais523> I didn't really understand C++ until after I learned Rust
07:31:43 <ais523> but my recommendation is to a) work out what sort of programming paradigm you want to be programming with in future (e.g. the Java/C#ish languages are good for getting jobs at big companies with)
07:31:57 <ais523> and b) work out what sort of knowledge about programming you want to gain
07:32:00 <ais523> and then pick an appropriate language
07:32:32 <ais523> if you want to be working fairly difficult or low-level languages, for example, you should probably pick one to start with – it'll be harder to learn but you'll have to learn that information anyway
07:33:01 <ais523> I think I would recommend against starting with C or C++, though, because they don't give good feedback when you do something wrong and thus it's hard to learn what mistakes you're making
07:35:02 <ais523> actually, now I'm wondering about good options for general-purpose languages which will help you get the basics of modern-ish programming down
07:35:48 <ais523> maybe Lua? that seems to have all the features I'd want in a teaching language, and it's fairly small and simple, in addition to being easy to get started with and somewhat robust due to the situations where it's used
07:35:53 <ais523> although I'm not sure what the teaching materials are like
07:36:36 <ais523> that said, I've heard that Lua got worse since I last looked at it (although I heard this from a somewhat unreliable source so I'm not sure whether it's true)
07:45:06 <b_jonas> ais523: about when (what year) have you last thought Java as a first language?
07:46:17 <ais523> last taught? hmm, probably around 2014
07:46:44 <ais523> it's been changing rapidly since then, with lots of new features added, although last time I checked most Java-based companies were wary of using them
07:46:50 <ais523> but, programming doesn't change that much in small spans of time
07:47:02 <b_jonas> thanks
07:47:17 <b_jonas> and yes, that is a small timespan, I thought it might be more
07:47:55 <ais523> it feels like longer
07:48:22 <ais523> my most recent job was writing Java, though, so my Java skills are more recent than that
07:53:11 <b_jonas> I personally like lua from the implementation perspective, they have a solid interpreter and are one of the very few interpreters with a moving garbage collector that defines a documented C API that lets you refer to objects in the language. (the other is mzscheme or PLT-scheme or whatever they renamed it now). but I hate it from the language user's perspective. Mostly hate it because of the 1-based
07:53:18 <b_jonas> indexes; but also because of the syntax: the implicit semicolon lets you make mistakes, and the clumsy syntax makes you express easy things with long keywords.
07:53:47 <b_jonas> so lua is decent for someone who wants to add a macro/modding language to their video game, but not for the people who write mods mostly in lua
07:54:27 <ais523> Lua doesn't have implicit semicolons (in the JavaScript sense) – the syntax is unambiguous
07:54:42 <ais523> like, you can shuffle around the whitespace and a program still has the same meaning
07:55:12 <ais523> I actually used to write code like «x = x + dx y = y + dy» until someone told me it was legal to put a semicolon there to make it easier to read
07:55:51 <Riviera> x ;= dx y;= dy
07:56:07 <ais523> I think the semicolons do have to go between statements if you use them
07:56:36 <ais523> anyway, I agree that Lua doesn't really scale to large programs, but that isn't a property you need in a teaching language
07:56:36 <b_jonas> ais523: yes, it's not the same as javascript where the newlines matter. but that and no semicolons exactly means you can make costly mistakes.
07:56:37 <Riviera> :;)
07:57:25 <ais523> for a language I'm working on I'm considering a compromise, in which the language would be ambiguous without semicolons or newlines, but you still need to place a semicolon or a newline between statements anyway
07:57:31 <ais523> * would be unambiguous
07:57:48 <ais523> maybe even with a backslash when you split a statement across multiple lines
07:58:08 <ais523> (and perhaps with an option to automatically fix files in which the whitespace has become mangled)
07:58:49 <b_jonas> ais523: is it an alternate syntax for a yacc extension?
07:58:53 <b_jonas> :-)
07:59:14 <ais523> b_jonas: actually no; I *am* working on one of those, but the language I was talking about a few lines ago is a different one
07:59:47 <ais523> or, not so much yacc extension
07:59:55 <b_jonas> ok. I hope it's also not an alternate syntax for Analogia :-)
08:00:13 <b_jonas> (the "x = x + dx" above reminded me of that)
08:00:17 <ais523> I've been going through about 4 or 5 attempts at writing a good input language for parser generators recently
08:01:23 <ais523> because I've become fed up with the existing parser generators, it's clearly possible to do better, yet people have mostly either a) dropped the idea entirely or b) moved onto combinator-based parsing which is a little nicer for the programmer but can produce very inefficient parsers
08:02:38 <ais523> parser generators seem to be split into three groups nowadays: a) generalised parsers that handle any grammer, even ambiguous ones; b) LR-alikes where you need a grammar that the parser-generator can prove unambiguous; and c) PEG-based parsers, which use an input format in which all grammars are inherently unambiguous but often don't do what you meant them to
08:02:47 <ais523> s/grammer/grammar/
08:03:48 <ais523> group a) is sort of the parser-generator equivalent of a scripting language; the language doesn't give you much help in debugging because anything is expected, but if you do write the program correctly you can write it very quickly, but the runtime performance is often bad
08:04:16 -!- imode has quit (Ping timeout: 245 seconds).
08:04:21 <ais523> (most of these generators are O(n) best case and O(n³) or O(n⁴) worst case, and aim to hit the best case as often as possible but don't give you much guidance in doing that)
08:05:12 <ais523> and group c) is universally O(n) worst case but often with a terrible constant factor, and *also* doesn't give you much help in writing correct programs because PEG is a language that makes subtle errors really easy to make (and basically only exists because it's guaranteed to be unambiguous and O(n)-parseable)
08:05:35 -!- hendursa1 has joined.
08:05:37 <nakilon> did you try ragel? I see it often recently
08:05:58 <ais523> group b) is my favourite but it's been mostly abandoned at this point, so I was hoping to make something modern and widely usable that's more powerful than LR(1) and just as efficient
08:06:37 <ais523> nakilon: that appears to be a lexer, rather than a parser?
08:06:43 <nakilon> idk
08:07:41 <ais523> good lexers aren't as hard to find as good parsers because it's a fundamentally easier problem, there aren't tradeoffs to make between efficiency and generality
08:08:24 <ais523> although, what I've really been focusing on is scannerless parsers that don't need a separate lexer
08:08:51 -!- hendursaga has quit (Ping timeout: 276 seconds).
08:09:13 <ais523> I proved that LR(*) can be evaluated in O(n) time (i.e. LR but with regular-expression lookahead), and that's sufficient to write a scannerless LR parser, although I'm leaning towards a different algorithm
08:09:59 <ais523> because my proof involves first running a state machine backwards across the input and recording the history of states, which is O(n) but likely to be quite slow in practice, especially if the state machine is very large
08:11:58 <ais523> if anyone's interested, here's where I've got to so far: http://nethack4.org/pastebin/burlGaQaD3.html
08:12:30 <ais523> the automaton is provably O(n), and capable of simulating the combined effect a lexer followed by an LR(k) parser for any k
08:12:36 <ais523> but I haven't worked out how to calculate the states for the automaton yet
08:34:29 <nakilon> support says I'm being billed for an instance that utilizes >100% CPU core 24/7
08:34:38 <nakilon> but I only have one and it's at 20%
08:34:44 <nakilon> am I going crazy
08:38:06 <nakilon> will be funny if that's that glitched Chromium OS that is shown as disabled in my interface but is still running because of that lack of RAM
08:53:25 -!- brettgilio7 has joined.
08:54:27 -!- brettgilio has quit (Ping timeout: 240 seconds).
08:54:27 -!- brettgilio7 has changed nick to brettgilio.
08:55:39 -!- hendursa1 has quit (Ping timeout: 276 seconds).
08:56:17 -!- hendursa1 has joined.
09:06:58 -!- wib_jonas has joined.
09:08:23 <wib_jonas> "combinator-based parsing [...] can produce very inefficient parsers" => that, but I'm more worried that it can cause ambiguous grammars without anyone noticing, and then hard to debug problems when it parses an ambiguous input in the other of two possibilities
09:10:22 <wib_jonas> ais523: "LR(*) can be evaluated in O(n) time" => do you mean with the constant factor in the O independent of the lookahead length of the LR?
09:10:35 <wib_jonas> wait, "LR but with regular expression lookahead"
09:10:41 <wib_jonas> I didn't look ahead reading your statement apparently
09:12:14 <wib_jonas> as for the previous problem of parsers, LR(1) is a good start, but I think it can help a lot if you have extensions over the BNF-like grammar. yacc already provides one very useful one, for operators with precedence, but I was kind of thinking of other potential extensions.
09:13:40 <wib_jonas> by which I mean extensions for how to specify the grammar, the one that you'll then generate an LR(1) parser for
09:14:05 <wib_jonas> (or an optimized LR(1) parser)
09:14:16 -!- op_4 has quit (Ping timeout: 245 seconds).
09:14:37 -!- op_4 has joined.
09:16:37 <wib_jonas> I was wondering on an extension for when some rules have an optional terminator token. So in a rule, if the last symbol is a terminal, you could mark it as optional, claiming that this may cause LR(1) ambiguities, which you want to resolve against applying that rule without the terminator token, but importantly, you ask the parser generator to
09:16:37 <wib_jonas> prove you that if all those optional terminators were mandatory, then the grammar has no LR(1) ambiguities.
09:17:44 <wib_jonas> It seems like this could be done with a preprocessor that runs yacc twice, once with all the terminators mandatory to prove that the grammar has no ambiguities as yacc understands it (or at least only has a few ambiguities that you as the grammar writer know of), then generate the parser with those tokens optional.
09:18:00 <wib_jonas> but I'm not entirely sure if this makes sense.
09:19:52 <wib_jonas> plus I'm not sure if just making single terminals optional is enough, because rust has those weird syntax cases where it tries to find out which left brace after the "if" keyword ends the condition and starts the body, and you might want something to prove eg. that if you parenthisize the condition then it's unambiguous
09:20:23 <wib_jonas> to be clear I mean unambiguous as yacc understands it, not just theoretically unambiguous as a grammar, though in practice the difference rarely comes up.
09:22:29 <wib_jonas> "LR but with regular-expression lookahead [... is] sufficient to write a scannerless LR parser" => *sigh* not always. some languages like C++ allow custom multi-byte terminators for a string, where the lexer has to scan for the matching terminator sequence.
09:22:51 <wib_jonas> but I also agree that you usually want a separate lexer, even just for clarity
09:23:47 <wib_jonas> and then there's of course the classical C problem where you have to know if an identifier is a typename or not to parse
09:24:50 <wib_jonas> although I kind of wonder if that can be worked around by parsing with some modified yacc grammar despite that, then later fixing up the cases that involve a typename vs other identifier ambiguity, like (a)(b) and (a)*(b)
09:25:27 <wib_jonas> I'm not sure if C allows that, and if it does, does C++ too?
09:26:01 <wib_jonas> there are some weird cases with declarations and function type names and whatnot
09:26:13 <ais523> <wib_jonas> "combinator-based parsing [...] can produce very inefficient parsers" => that, but I'm more worried that it can cause ambiguous grammars without anyone noticing, and then hard to debug problems when it parses an ambiguous input in the other of two possibilities ← I agree with this
09:26:56 <ais523> in terms of precedence, I think it's an important feature to have but don't like the way that yacc does it – precedence can be implemented as sugar but yacc lets it affect the grammar directly, which can be confusing
09:27:05 <ais523> err, affect the algorithm, rather than the grammar
09:28:07 <ais523> re: C++'s custom multi-byte terminators, I don't consider those to have an effect on scannerless parsing because they can't be lexed with a normal lexer
09:28:50 <ais523> so it has no impact on the difference between scannerless parsing and a parser+separate lexer (although, scannerless parsers should in theory be better at them, as they can do CFG-based lexing rather than regular expressions)
09:29:06 <wib_jonas> as much as I like rust's semantics, I think their syntax is terrible, though mostly not because of the parser ambiguities, but because of the terrible identifier scoping rules, and because of the ambiguity between constructors vs bindings in patterns. that latter would be really easy to improve if they just allowed empty parenthesis after any
09:29:06 <wib_jonas> 0-argument constructor, because that let you disambiguate both ways. but there's hope, because they started to allow multiple incompatible syntaxes now in the same compiler, so they can improve some of the syntax later.
09:29:57 <wib_jonas> ais523: that depends on what you mean by "normal lexer". if you mean a regular expression lexer, then sure. but we're not limited to that when using yacc.
09:30:00 <ais523> I agree that constructor vs. binding is a bad ambiguity (interestingly, you could mostly fix it using Rust's normal conventions for identifier case, but it only enforces them with warnings rather than at the syntax level)
09:30:10 <ais523> wib_jonas: right, regular expression lexer
09:30:44 <ais523> I don't know what you mean by the identifier scoping rules, though: do you have an example of what it does wrong there?
09:30:49 <wib_jonas> ais523: rust already enforces identifier case as warnings, but there are also lots of wrong-cased type names in the standard library, so that's not enough.
09:31:27 <ais523> wait, why?
09:32:06 <wib_jonas> ais523: for the identifier scoping rules ... let me try to get an example, I think it was something about multiple identifiers of different kinds coming from different scopes, where the one closer to your scope should really shadow the other, but instead rust disambiguates based on which kind is valid when using it
09:32:17 <wib_jonas> ais523: mostly to match the name of C types
09:32:23 <ais523> oh, u8 and friends
09:32:45 <wib_jonas> no, I can take `u8`, I actually thought that was a keyword
09:32:46 <ais523> I guess i've internalised "u8" as being a keyword, and thus being able to use any case it wants, but it probably isn't
09:32:56 <wib_jonas> this isn't about u8
09:33:07 <ais523> c_void and friends?
09:33:34 <ais523> actually, that's really weird, why wouldn't it be called C_void?
09:33:45 <ais523> the "c_" at the start isn't part of the name in C
09:33:54 <wib_jonas> those, and even worse ones in the libc crate IIRC
09:34:22 <wib_jonas> you can say that c_void is fine because the set of builtin types in C and C++ is growing slowly
09:34:36 <wib_jonas> (it's not closed; we have wchar16_t and wchar32_t as builtins now I think)
09:34:42 <wib_jonas> (and nullptr_t and more)
09:35:00 <ais523> oddly, the _t suffix is reserved by POSIX but not, IIRC, by C itself
09:35:03 <wib_jonas> but I think the libc crates wraps types that are identifiers
09:35:18 <ais523> at least libc isn't technically part of Rust itself
09:35:31 <wib_jonas> yes, it's not
09:39:21 <ais523> u8 is not a keyword, I just looked it up
09:39:53 <wib_jonas> I know
09:39:59 <wib_jonas> I thoguht it was a keyword too
09:40:08 <wib_jonas> but later found it isn't
09:40:14 <ais523> I wasn't sure until I checked
09:40:40 <ais523> one thing that's been paining me with this parser generator work is trying to avoid clashes, in generated code, with keywords in the target language
09:40:48 <ais523> namespacing can solve most problems, but not that one
09:41:12 <ais523> my current hacky workaround is to append an underscore to identifiers, on the basis that most languages don't have keywords that end with an underscore but don't start with one
09:46:18 <wib_jonas> ais523: here's an example on what I don't like about the scoping rules: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=45fe7999658232760b1fd3ce7c578cf4
09:46:39 <nakilon> `factor 992654469589
09:46:40 <HackEso> 992654469589: 993319 999331
09:47:04 <wib_jonas> note that if you define the outer struct K as a parenthisized struct rather than a braced struct, this no longer works, so it's not like structs and consts are in an entirely different namespace and you can always tell from usage which one to use
09:47:25 * ais523 looks
09:47:56 <nakilon> `factor 41758540882408627201
09:47:57 <HackEso> 41758540882408627201: 479001599 87178291199
09:48:15 <ais523> wib_jonas: I think that behaviour was probably borrowed from C? shadowing is separated into different lexical categories
09:48:42 <ais523> but the "this isn't an entirely different namespace" is interesting
09:49:38 <wib_jonas> for posterity in the channel logs, pointed example was: #[derive(Debug)] struct K{ x: i32, } fn main() { const K: i32 = 20; println!("k = {:?}", K); let b: K = K{x: 13}; println!("b = {:?}", b); }
09:49:42 <nakilon> `factor 3858055874062761829426214599
09:49:43 <HackEso> 3858055874062761829426214599: 5600748293801 688846502588399
09:50:14 <wib_jonas> ais523: yes, but in C you don't get things like parenthisized structs that apparently shadow multiple lexical kinds
09:50:30 <wib_jonas> and I'm not sure C is a good example in first place
09:50:45 <ais523> I can't find the shadowing rules in the reference
09:50:48 <wib_jonas> Haskell might be better, that has three entirely separate lexical categories clear from the syntax
09:50:48 <nakilon> `factor 137438953490360560825792535807496799
09:51:00 <wib_jonas> or maybe just two
09:51:01 <nakilon> oh finally
09:51:04 <HackEso> 137438953490360560825792535807496799: 59604644783353249 2305843009213693951
09:51:07 <nakilon> damn
09:51:52 <ais523> nakilon: if you're just looking for primality or not, I recommend a primality tester rather than a factoriser, the numbers are starting to reach the range where factorisation is slow
09:51:56 <ais523> but I'm not sure that HackEgo has one
09:52:49 <nakilon> I'm searching for its limits
09:52:57 <wib_jonas> let me try to see if there's an example that involves mod versus trait
09:53:03 <nakilon> `factor 928510396424831231988564183404743747335769
09:53:04 <HackEso> factor: ‘928510396424831231988564183404743747335769’ is too large
09:53:09 <nakilon> yeeeeee
09:53:13 <ais523> `` perl -Mntheory -E 'say is_prime("137438953490360560825792535807496799")'
09:53:14 <HackEso> Can't locate ntheory.pm in @INC (you may need to install the ntheory module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base). \ BEGIN failed--compilation aborted.
09:53:53 <nakilon> \wa factorize 928510396424831231988564183404743747335769
09:53:55 <velik> Result: 68480406462161287469×13558774610046711780701 (2 distinct prime factors)
09:55:17 <ais523> needs to be -Mntheory=is_prime, it seems (based on my local testing)
09:57:51 <wib_jonas> ais523: C++ has both a function and a variable named clog in the std namespace, and I still don't understand how it does that
09:58:24 <ais523> complex logarithm and standard logging handle, respectively?
09:58:33 <wib_jonas> yes
09:58:41 <wib_jonas> but maybe the function is never in std, it's only in the global namespace?
09:58:44 <ais523> I wonder if the function is actually a macro
09:58:46 <wib_jonas> I really don't understand
09:58:48 <nakilon> in ruby you have both and interpreter checks if you are appending the "()" to identifier to resolve the ambiguity
09:59:21 <ais523> Perl has an ambiguity between function calls and string literals, which is a fun one
09:59:30 <wib_jonas> I think maybe the function is never in the std namespace
09:59:39 <ais523> e.g. $x{shift} versus $x{+shift}
10:00:05 <ais523> (works even under use strict)
10:02:32 <wib_jonas> on the other hand, I have to appreciate the rustc compiler, which is really well made and gives high quality warning/error messages that usually point you to the right issue
10:02:40 <wib_jonas> they clearly put a lot of work in that
10:03:02 <wib_jonas> well yes, perl has weird syntax
10:03:19 <nakilon> ``` ruby -rprime -e "p Prime.prime? 992654469589"
10:03:21 <HackEso> false
10:03:25 <ais523> wib_jonas: in your Rust scoping example, you can actually give basically everything the same name: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=45fe7999658232760b1fd3ce7c578cf4
10:03:29 <nakilon> ``` ruby -rprime -e "p Prime.prime? 41758540882408627201"
10:03:39 <wib_jonas> ruby too but I gave up trying to understand that when they changed the syntax significantly between ruby 1.8 and 2.0
10:03:58 <ais523> or, hmm, that somehow reverted to your version?
10:04:05 <HackEso> No output.
10:04:12 <wib_jonas> ais523: that looks like my version, yes. you have to click on the share button.
10:04:23 <ais523> I did
10:04:33 <ais523> but I basically just changed the struct field to K too, and used the const to initialise it
10:04:44 <ais523> so it becomes let b: K = K{K: K};
10:05:33 <wib_jonas> ais523: yes, but struct fields are clearly scoped, sort of like in C, so that doesn't matter as much
10:05:46 <ais523> right, and scoped to the struct they belong to
10:05:53 <wib_jonas> ais523: also I think you can just write K{K} or K{...} instead of K{K: K} but I'm not certain
10:05:54 <nakilon> ``` ruby -rprime -e "p Prime.methods.grep /div/"
10:05:55 <HackEso> ​[:int_from_prime_division, :prime_division]
10:06:12 <nakilon> ``` ruby -rprime -e "p Prime.prime_division 992654469589"
10:06:14 <HackEso> ​[[993319, 1], [999331, 1]]
10:07:10 <ais523> wib_jonas: you can write the former, at leats
10:07:14 <ais523> * least
10:07:37 <ais523> neither .. nor ... works though
10:08:09 <ais523> anyway, when I define a tuple struct and brace struct with the same name, I get "note: `K` must be defined only once in the type namespace of this module"
10:08:31 <ais523> which seems to be a big indication as to what Rust is doing
10:08:37 <nakilon> `factor -12
10:08:38 <HackEso> factor: invalid option -- '1' \ Try 'factor --help' for more information.
10:08:40 <ais523> (that's in addition to an error)
10:08:42 <nakilon> haha
10:08:45 <ais523> `factor -- -12
10:08:46 <HackEso> factor: unrecognized option '-- -12' \ Try 'factor --help' for more information.
10:08:51 <ais523> `` factor -- -12
10:08:52 <HackEso> factor: ‘-12’ is not a valid positive integer
10:08:58 <ais523> that looks better
10:09:04 <nakilon> ``` ruby -rprime -e "p Prime.prime_division -12"
10:09:06 <HackEso> ​[[-1, 1], [2, 2], [3, 1]]
10:09:23 <ais523> …also, it's kind-of amazing that -- syntax works there, there's no reason for factor to be able to support it; probably the consequence of some library for command-line options parsing
10:09:37 <wib_jonas> ``` factor --help
10:09:38 <HackEso> Usage: factor [NUMBER]... \ or: factor OPTION \ Print the prime factors of each specified integer NUMBER. If none \ are specified on the command line, read them from standard input. \ \ --help display this help and exit \ --version output version information and exit \ \ GNU coreutils online help: <https://www.gnu.org/software/coreutils/> \ Report factor translation bugs to <https://translationproject.org/team/> \ Full documentation
10:10:14 <wib_jonas> ais523: it's in GNU coreutils, so it must support --help and --version , so it uses GNU getopt_long
10:10:15 <nakilon> \wa factorize -12
10:10:17 <velik> Result: -2^2×3 (3 prime factors, 2 distinct)
10:10:30 <ais523> wib_jonas: I'm thinking about the semantics of non-hyphen-prefixed arguments
10:10:34 <ais523> the -- convention only makes sense when those are filenames
10:10:46 <ais523> or, hmm, maybe in cases like yes?
10:10:53 <ais523> `` yes -- -yes | head
10:10:54 <HackEso> ​-yes \ -yes \ -yes \ -yes \ -yes \ -yes \ -yes \ -yes \ -yes \ -yes
10:11:01 <ais523> right, so echo-alikes too
10:11:06 <ais523> `` echo -- -test
10:11:06 <wib_jonas> but it doesn't hurt to just support the -- syntax everywhere
10:11:07 <HackEso> ​-- -test
10:11:14 <ais523> (this is what I expected echo to do)
10:11:17 <ais523> `` echo --help
10:11:18 <HackEso> ​--help
10:11:22 <ais523> `` /usr/bin/echo --help
10:11:23 <HackEso> ​/hackenv/bin/`: line 5: /usr/bin/echo: No such file or directory
10:11:26 <wib_jonas> at least everywhere that takes options starting with a hyphen
10:11:29 <ais523> `` /bin/echo --help
10:11:30 <HackEso> Usage: /bin/echo [SHORT-OPTION]... [STRING]... \ or: /bin/echo LONG-OPTION \ Echo the STRING(s) to standard output. \ \ -n do not output the trailing newline \ -e enable interpretation of backslash escapes \ -E disable interpretation of backslash escapes (default) \ --help display this help and exit \ --version output version information and exit \ \ If -e is in effect, the following sequences
10:11:35 <ais523> ooh
10:11:42 <ais523> `` /bin/echo -- --help
10:11:43 <HackEso> ​-- --help
10:11:52 <wib_jonas> hehe
10:11:57 <ais523> `` /bin/echo -E --help
10:11:59 <HackEso> ​--help
10:12:10 <ais523> `` /bin/echo -E -E
10:12:11 <HackEso> No output.
10:12:37 <ais523> this isn't doing a great job as an echo command
10:13:06 <wib_jonas> also if REGEX may start with a minus, then it's (grep -e REGEX) but (grep -eREGEX) or (grep -- REGEX) also work, and so do workarounds like (grep -E "(REGEX)") if it's an egrep
10:13:17 <ais523> I don't think there's any sequence of options that's guaranteed to echo the remaining arguments literally?
10:13:45 <wib_jonas> no idea about /bin/echo , I don't really use that. you'd have to look it up in the info documentation how that works.
10:14:08 <ais523> `` POSIXLY_CORRECT=1 /bin/echo --help
10:14:09 <HackEso> ​--help
10:14:23 <wib_jonas> it's in coreutils too, so the syntax is probably documented
10:14:39 <ais523> I know, I'm looking at the info page right now
10:14:40 <nakilon> so there are three ways to factorize numbers here: 1) factor can't negative 2) ruby is slower and harder to invoke 3) velik
10:14:57 <ais523> nakilon: if you support negative inputs than the output is ambiguous
10:15:14 <wib_jonas> ais523: I think (/bin/printf %s "$yourstring") should work
10:15:18 <ais523> is the factorisation of 6 (-2, 3) or (-3, 2)? (or (-1, 2, 3)?)
10:15:32 <ais523> wib_jonas: yes, that's the workaround suggested on echo's info page
10:15:40 <wib_jonas> oh great
10:15:47 <nakilon> it's ambigous in \wa I would say
10:15:51 <ais523> although the format string should actually be '%s\n'
10:15:58 <nakilon> but [-1, 1] is pretty much straight forward
10:16:09 <nakilon> though -1 isn't a prime
10:16:49 <wib_jonas> newline, right
10:17:36 <nakilon> \wp prime number
10:17:39 <velik> prime number -- positive integer with exactly two divisors, 1 and itself https://en.wikipedia.org/wiki/Prime_number
10:17:52 <ais523> oh, man -s1posix echo suggests using printf too, and says that the only reason echo hasn't "been made obsolescent" is that it's widely used
10:18:26 <ais523> (the spec allows -n to have implementation-defined behaviour)
10:18:45 <ais523> printf "%s\n" isn't a drop-in replacement for echo though
10:18:51 <ais523> `` echo 1 2 3
10:18:52 <HackEso> 1 2 3
10:18:57 <ais523> `` printf "%s\n" 1 2 3
10:18:58 <HackEso> 1 \ 2 \ 3
10:19:28 <wib_jonas> and then of course there's all the workarounds like (perl -e'print"@ARGV\n"' "$yourstring") , the links of which I used on Windows
10:20:15 <Riviera> it being a drop-in replacement would be silly though, 'cause that would have to have all the same undefined behaviours :)
10:21:08 <ais523> Riviera: well, the usual intended behaviour of `echo` is "join the arguments with spaces, then print them followed by a newline"
10:21:09 <Riviera> `` printf -----%s---- hehe
10:21:10 <HackEso> ​/hackenv/bin/`: line 5: printf: --: invalid option \ printf: usage: printf [-v var] format [arguments]
10:21:13 <Riviera> xD
10:21:38 <ais523> and I'm not sure there's actually a standard POSIX command that does that exactly, not even echo or printf with options
10:21:51 <ais523> (as wib_jonas posted above, perl can do it)
10:22:00 <Riviera> la () ( IFS=' '; printf '%s\n' "$*" )
10:22:01 <ais523> actually no
10:22:05 <Riviera> i guess, but meh
10:22:08 <wib_jonas> ais523: maybe a small shell script could do it?
10:22:13 <ais523> `` perl -e'print"@ARGV\n"' -45
10:22:14 <HackEso> Unrecognized switch: -45 (-h will show valid options).
10:22:18 <Riviera> not quite sure what the problem is, you can't use the same syntax, but there's no actual problem
10:22:18 <wib_jonas> yeah, what Riviera says
10:22:20 <ais523> `` perl -e'print"@ARGV\n"' -- -45
10:22:21 <HackEso> ​-45
10:22:31 <ais523> I think Perl will treat that -- consistently though
10:22:36 <wib_jonas> huh
10:22:56 <wib_jonas> I thought perl treated -e as the last option. maybe not, because it accepts two -e strings?
10:23:00 <Riviera> (i'm not sure if function definitions with ( .. ) is posix, but then just nest () within {})
10:23:05 <wib_jonas> ``` perl -e'print' -e' "hello"'
10:23:06 <HackEso> hello
10:23:09 <wib_jonas> yeah :(
10:23:13 <wib_jonas> that's worse
10:23:46 <ais523> anyway, this is starting to convince me that -- makes sense with things other than filenames
10:27:34 <ais523> `` /bin/true --version
10:27:35 <HackEso> true (GNU coreutils) 8.30 \ Copyright (C) 2018 Free Software Foundation, Inc. \ License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. \ This is free software: you are free to change and redistribute it. \ There is NO WARRANTY, to the extent permitted by law. \ \ Written by Jim Meyering.
10:27:37 <ais523> `` /bin/true -- --version
10:27:38 <HackEso> No output.
10:27:42 <ais523> there's another potential use
10:41:25 -!- velik has quit (Remote host closed the connection).
10:41:57 -!- velik has joined.
10:42:49 -!- velik has quit (Remote host closed the connection).
10:43:11 -!- velik has joined.
10:43:20 <wib_jonas> while we're at silly syntax. in HTML in the srcset attribute of an img element, given https://html.spec.whatwg.org/multipage/images.html#srcset-attribute , how are you supposed to quote an URL if its last character is comma?
10:43:56 <esolangs> [[BracketsLang]] https://esolangs.org/w/index.php?diff=88611&oldid=88603 * PoetLuchnik * (+13) block to subcode in c-like
10:45:32 <ais523> wib_jonas: replace the comma with %2C?
10:46:12 <wib_jonas> is that guaranteed to never change the semantics actually?
10:48:37 <wib_jonas> maybe you could append a ? if there's no query segment, or a & if there is a query segment. that's not perfect either, but might work better.
10:49:23 <fizzie> "URIs that differ in the replacement of an unreserved character with its corresponding percent-encoded US-ASCII octet are equivalent: they identify the same resource." (RFC 3986)
10:50:19 <wib_jonas> fizzie: is comma one of those unreserved characters?
10:50:21 <ais523> oh wow, I think that might answer a question I've been stuck on for a while
10:50:47 <ais523> wib_jonas: appending an & isn't safe, there are multiple possible encodings for query segments and & can be semantically important with some of them
10:51:09 -!- velik has quit (Remote host closed the connection).
10:51:15 <ais523> (although it's a no-op in the most common encoding, that isn't the only one in use and isn't enforced by the standard)
10:51:27 -!- velik has joined.
10:51:43 <fizzie> Actually, the comma is not in the set of entirely unreserved characters; that's only ALPHA / DIGIT / "-" / "." / "_" / "~".
10:51:56 <wib_jonas> ais523: yes, I know, plus I'm not even sure if all schemes of URI allow a query part when there's no question mark
10:52:08 <fizzie> Comma is in the "sub-delims" set, which means it depends on where the comma is, I guess.
10:53:56 <wib_jonas> who-ever invented that syntax for srcset should get a swift kick in the hindside. they could have chosen the vertical bar as a separator or something
10:54:02 <nakilon> \wa random 20 digit prime number
10:54:04 <velik> Result: 92847417466922372783 | Scientific notation: 9.2847417466922372783 × 10^19 | Properties: 92847417466922372783 is an odd number., 92847417466922372783 is a number that cannot be written as a sum of 3 squares. | Number length: 20 decimal digits | Number names: 92 quintillion ..., 92 billion billion ... | Prime factorization: 92847417466922372783 is a prime number. | Comparison: ≈ 2.1 × the number of arrangements of a 3×3×3 Rubik's cube (...
10:54:11 <wib_jonas> no awit, vertical bar might not be good
10:54:27 <wib_jonas> hmm
10:55:07 <nakilon> gotta make a shorter variant of the \wa, maybe \was
10:55:12 <fizzie> I guess what the RFC means is, it's possible a specific URI scheme uses ',' as a component delimiter, which means it cannot necessarily be always percent-encoded without changing the meaning.
10:55:13 <nakilon> though it sounds cryptic
11:02:10 <wib_jonas> I wonder if that could occur in a data: URI, with an escaped comma occuring in one of the key-value parameters after the media type
11:02:58 <wib_jonas> although that wouldn't matter for the srcset thing, where you only escape the *last* comma, since that last comma must be part of the data proper
11:04:21 <ais523> data:text/html,a%2C appears to be an HTML document consisting of "a,"
11:04:48 <ais523> whereas data:text/html%2Ca%2C is a bad URL
11:05:00 <ais523> so this does appear to be an inescapable comma
11:05:15 <fizzie> Actually, I'm not 100% sure whether that spec allows for an unescaped comma at all.
11:05:17 <fizzie> The description is: "one or more image candidate strings, each separated from the next by a U+002C COMMA character (,). If an image candidate string contains no descriptors and no ASCII whitespace after the URL, the following image candidate string, if there is one, must begin with one or more ASCII whitespace."
11:05:20 <fizzie> Which you *could* read to mean "if there's a comma not surrounded by whitespace, it's not actually separating two strings", but you could *also* read as saying "a comma *always* separates two strings, and it's just invalid to not have whitespace there".
11:05:57 <wib_jonas> fizzie: huh
11:06:05 <wib_jonas> that's even more scary
11:06:22 <ais523> it makes more sense to check the parsing algorithm rather than the description of valid syntax for this sort of thing, IMO
11:06:57 <fizzie> Wouldn't that only work if there is a canonical algorithm?
11:07:21 <fizzie> Oh, there is one, I see.
11:08:19 <fizzie> Yeah, an embedded comma with no surrounding whitespace will be just collected as part of the URL.
11:09:18 <wib_jonas> fizzie: how about a comma before (the separator comma after an URL)?
11:09:19 <ais523> there's always a canonical algorithm in HTML5
11:09:40 <ais523> I found the spec really creepy the first time I read it
11:09:45 <wib_jonas> although that won't help
11:09:50 <ais523> it's basically an entire web browser implementation in pseudocode
11:10:10 <wib_jonas> because you usually want a scale thingy between the URL and the separator comma
11:10:36 <wib_jonas> ais523: yep.
11:10:45 <wib_jonas> the HTML5 spec is like that
11:10:54 <wib_jonas> and it has an entire javascript API in it too
11:10:54 -!- velik has quit (Remote host closed the connection).
11:11:22 -!- velik has joined.
11:11:36 <wib_jonas> as in an api from (the javascript running client-side in the webpage) to the webpage content
11:12:20 <nakilon> \was pi
11:12:24 <velik> Decimal approximation: 3.1415926535897932384626433832795028841971693993751058209749445923...
11:14:31 <nakilon> ``` ruby -e "p Math::PI"
11:14:32 <HackEso> 3.141592653589793
11:14:57 <ais523> somewhat difficult Prolog question: is there a way to write a predicate for which, e.g., p(f(A,B,C), [A,C], X, Y) on input becomes p(f(A,B,C), [A,C], f(D,B,E), [D,E]) on output?
11:15:09 <ais523> i.e. I want something like copy_term, but it only copies some of the variables, not all of them
11:15:23 <ais523> I was hoping it would be a builtin, but I can't find one
11:15:42 <ais523> so either there's some way to abuse a degenerate case of bagof, or else I'll have to write it manually
11:18:35 <wib_jonas> ais523: didn't one of the prolog implementations have a builtin for either that, or for when you specify the compliment set of variables?
11:19:18 <ais523> I guess I'll have to write it manually, by iterating over it to find the free variables, then doing copy_term(f(A,B,C)-[A,C]-[B], f(D,B,E)-[A,C]-[B])) as the final step (with the [B]s unified earlier)
11:19:38 <ais523> err, copy_term(f(A,B,C)-[A,C]-[B], f(D,B,E)-[D,E]-[B])), obviously
11:20:01 <ais523> wib_jonas: bag_of is close but doesn't seem to be close enough
11:20:49 -!- arseniiv_ has joined.
11:20:59 -!- Thelie has joined.
11:23:05 <wib_jonas> hmm, I don't find such a builtin at a quick look
11:23:49 <wib_jonas> I think I looked for something like that when I made olvashato, and perhaps even before, to implement functions with upvalues, but then just decided I'll use copy_term and say that the upvalues must be ground terms
11:24:35 <wib_jonas> not quite ground terms, but terms with no free variables -- bound variables that are used only inside them, such as in referenced functions with upvalues, those are fine, they're renamed harmlessly by copy_term
11:25:03 <ais523> right
11:26:06 <wib_jonas> can you do something like temporarily define a perdicate with asserta, with variables that you don't want to copy mentioned in the head?
11:26:42 -!- dutch has joined.
11:27:21 <ais523> the iterate-to-find-free-variables approach is almost working
11:27:40 <ais523> the main difficulty is just that call/9 doesn't exist, so I'm needing to create temporary structures to hold some of my arguments
11:28:34 <ais523> (I'm already iterating over the structure anyway so I threw in some free variable extraction while I was there)
11:31:53 -!- velik has quit (Remote host closed the connection).
11:32:20 -!- velik has joined.
11:33:09 <nakilon> \wa e
11:33:13 <velik> Upper case: E (U+0045) | Name: Latin small letter E | Phonetic alphabet: Echo (ECK·OH) | "e" on a US English keyboard: (left middle finger) | Similar characters: ℮ (estimated symbol) | ℯ (script small E)
11:33:19 <nakilon> \was e constant
11:33:22 <velik> Decimal approximation: 2.7182818284590452353602874713526624977572470936999595749669676277...
11:33:27 <nakilon> \wa ꙮ
11:33:28 <velik> Name: Cyrillic letter multiocular O | Unicode block: Cyrillic Extended-B (42560 through 42655) (96 characters)
11:34:45 <nakilon> weird that it said it's upper case e, anyway
11:36:33 <nakilon> velik ꙮ
11:36:57 <nakilon> scared
11:37:31 <fizzie> It doesn't really say it's uppercase, it tells you what the uppercase equivalent is.
11:37:58 <fizzie> The wobsite goes "Input interpretation: e (character)", "Name: Latin small letter E", "Upper case: E", "Similar characters: ..." and so on.
11:38:11 <nakilon> oh indeed
11:40:47 <nakilon> \was random 100 digit prime number
11:40:49 <velik> Decimal approximation: 6.97799599080530032728805445398475807079187919778470343445802... × 10^99 | Result: 6977995990805300327288054453984758070791879197784703434458023173697519646764322440809193108195240417
11:42:37 <nakilon> \was factorize random 100 digit prime number
11:42:46 <velik> thread error
11:43:25 <nakilon> (parser fault)
11:45:48 <nakilon> ah, nope, it's because of the trailing space in my message, gotta fix
11:49:06 -!- velik has quit (Remote host closed the connection).
11:49:35 -!- velik has joined.
11:54:59 -!- velik has quit (Remote host closed the connection).
11:55:24 -!- velik has joined.
13:04:23 -!- Thelie has quit (Remote host closed the connection).
13:10:40 <nakilon> twitch is now opensource /s
14:13:14 -!- Sgeo has joined.
14:13:44 -!- ais523 has quit (Quit: quit).
14:34:35 <int-e> yeah, the terrible kind where you can see the code but not touch it with a ten foot pole
14:35:19 <int-e> (except for the 80% (I suppose) that are free software)
15:16:58 -!- Thelie has joined.
15:23:49 -!- InfiniteDonuts has joined.
15:24:32 -!- InfiniteDonuts has quit (Client Quit).
15:30:47 -!- delta23 has joined.
15:45:25 -!- Thelie has quit (Remote host closed the connection).
15:45:33 -!- arseniiv_ has quit (Ping timeout: 265 seconds).
15:58:34 -!- wib_jonas has quit (Quit: Client closed).
16:07:17 <esolangs> [[FlipJump]] https://esolangs.org/w/index.php?diff=88612&oldid=88579 * Tomhe * (+38) /* The Standard Library */
16:10:23 -!- arseniiv_ has joined.
16:19:36 -!- chiselfuse has quit (Ping timeout: 276 seconds).
16:20:01 -!- benji_ has joined.
16:20:09 -!- chiselfuse has joined.
16:20:56 -!- benji has quit (Ping timeout: 246 seconds).
16:20:56 -!- benji_ has changed nick to benji.
16:21:56 -!- xylochoron[m] has quit (Ping timeout: 260 seconds).
16:21:57 -!- craigo[m] has quit (Ping timeout: 260 seconds).
16:22:57 <esolangs> [[Talk:Hanoi Love]] N https://esolangs.org/w/index.php?oldid=88613 * Asteriska * (+227) Created page with "I am working on an interpreter for this language in ruby. Any news on it will go here. ~~~~"
16:31:43 <esolangs> [[OISC]] M https://esolangs.org/w/index.php?diff=88614&oldid=87268 * Tomhe * (+86) more info on FlipJump
16:34:51 -!- src has joined.
16:38:38 -!- src has quit (Client Quit).
16:38:49 -!- src has joined.
16:44:35 -!- xylochoron[m] has joined.
16:45:39 -!- craigo[m] has joined.
16:48:52 -!- arseniiv_ has quit (Quit: gone too far).
16:51:34 -!- sprock has quit (Ping timeout: 245 seconds).
16:52:57 -!- arseniiv has joined.
17:05:56 -!- imode has joined.
17:24:46 <b_jonas> ais523: probably doesn't help you but just in case: there's a built-in predicate term_variables/2 that gives you a list of all variables in a term.
17:28:51 <nakilon> Google keeps disappointing me
17:30:17 <nakilon> dude says I have exceeded the 720 hours month CPU quota
17:30:40 <nakilon> I show him CPU graph in their GUI that shows I'm <25% for at least a months already
17:30:48 <nakilon> and guess what
17:31:14 <nakilon> he says "yes, 720 = 24 * 30 but some months have more days"
17:31:37 <nakilon> *more than 30
17:32:10 <nakilon> so I've already paid for two 120 days long months in some alternative reality
17:43:24 <int-e> > 360/365.2422 -- uptime
17:43:26 <lambdabot> 0.9856473320990837
17:43:34 <int-e> hmm, not true actually
17:43:56 <int-e> > 358.2422/365.2422 -- uptime, corrected for february always having fewer than 30 days
17:43:57 <lambdabot> 0.9808346352091845
17:46:55 <int-e> So how does that really work... you buy a CPU-month of computation? And the fine print says that if you use a CPU in a particular minute, they will bill you for that minute? :P
17:47:52 <int-e> (That 25% number is great but is that really what they bill you for? If you keep the VM busy it'll mean more hot data in memory which is a real cost.)
17:48:19 <int-e> Or the CPU may be idle while data for your VM is swapped in.
17:48:38 <int-e> Lots of reasons why this might actually end up with you being billed for 100% of that time.
17:48:53 <int-e> <3 speculation
17:50:39 <nakilon> in the Billing interface when I chose the time span of the last half of the month I see that it applies a "360 hours discount"
17:51:09 <nakilon> but I'm already exceeding it because in some freaking way I've used 470 hours
17:51:41 -!- delta23_ has joined.
17:51:49 -!- delta23 has quit (Killed (NickServ (GHOST command used by delta23_))).
17:51:49 <nakilon> and so it already has few dollars to bill to the time of the next invoice, and the prediction is even higher for this month than for the previous one
17:51:53 -!- delta23_ has changed nick to delta23.
17:52:40 <nakilon> so I've migrated half of the services to another cloud and switrched the machine type to pay ZERO but in fact I've got billed in August even more than usually, even more in September and even MORE in October according to the current extrapolation
17:56:18 <nakilon> their Free Tier does not separate CPU from RAM -- it says "one e2-micro instance per month"
17:57:47 <esolangs> [[Scroll]] https://esolangs.org/w/index.php?diff=88615&oldid=87568 * MathR * (+118)
18:00:51 <nakilon> I'm 80% sure they are billing me for the instance that has glitched and isn't under my control
18:00:58 -!- sprock has joined.
18:01:24 <nakilon> so I've provided screenshot of my Compute Engine panel
18:05:51 <nakilon> but it would explain only a September anyway, but I was billed for August for no reason too...
18:06:12 <b_jonas> I haven't heard of a virtual server provider that charges extra for CPU usage yet. only ones that charge extra for the amount of data through net connection. it's how they can offer such a low base price then catch you unaware. more honest model would just limit the net access (or CPU respectively) to very slow when you exceed the quota, with an option to pay for more, rather than charge you
18:06:18 <b_jonas> automatically.
18:06:30 <b_jonas> but the providers with the more honest models seem to have higher base prices. no surprise there.
18:06:57 <nakilon> GCP instead does not have charges for traffic
18:07:47 <esolangs> [[Scroll]] https://esolangs.org/w/index.php?diff=88616&oldid=88615 * MathR * (+4)
18:07:52 <b_jonas> the same distinction exists for mobile internet service too. slow your internet access when you exceed the quota, versus automatically charge a horrendous price for each byte that you go over the quota.
18:09:04 <nakilon> there are only some bucket storage traffic limits that I won't ever exceed even if I try
18:09:52 <nakilon> you'd rather reach the limits of operations count if doing it carelessly
18:12:30 <nakilon> in fact I guess it's even impossible to utilize 720 for me because https://cloud.google.com/compute/vm-instance-pricing according to this e2-micro is limited to 25% load
18:12:57 <nakilon> it's another reason why it all makes no sense
18:24:26 <b_jonas> I guess an even more evil virtual server provider could charge you extra if you accidentally allocate more hard disk capacity than is in the base price, or have more hard disk access traffic, or allocate more RAM.
18:24:32 <int-e> So what's that context, this? https://cloud.google.com/free/docs/gcp-free-tier#compute
18:26:09 <int-e> which is different in that 1) it sounds like 0.25 CPU-hours per hour because that's what the e2-micro instance gives you and 2) it takes the actual length of the month into account. so... weird
18:26:58 <int-e> love how the egress excludes China and Australia, I wonder why.
18:27:56 <b_jonas> int-e: probably because those have slow internet connections to the outside world
18:28:06 <int-e> b_jonas: this is the difference between cloud and vps providers ;)
18:28:22 <int-e> "this" being the resource-use-centric billing
19:05:59 <esolangs> [[Category:Stack-based]] https://esolangs.org/w/index.php?diff=88617&oldid=7904 * AceKiron * (+29)
19:06:05 <esolangs> [[Category:Queue-based]] https://esolangs.org/w/index.php?diff=88618&oldid=7927 * AceKiron * (+29)
19:11:12 <nakilon> there are websites with popular language runtimes working via webasm or smth like that
19:11:29 <nakilon> and there are websites to edit the code in coop, for job interviews, etc.
19:11:43 <nakilon> why the hell there is no website with coop editing AND the runtime?
19:13:25 <zzo38> Apple has "Uniform Type Identifier", I had my own idea of "Structured Type Identifier" which allows specifying multiple types and also allows parameters (e.g. to specify code page). It is not fully defined and may be changed later or abandoned, but for example "text:postscript:paged:document", "text:postscript:program", "postscript:paged:document", and "postscript:program" are distinguished. (Terms can be in any order.)
19:13:30 -!- hendursa1 has quit (Quit: hendursa1).
19:14:01 -!- hendursaga has joined.
19:14:51 <zzo38> It is a similar idea but I think that UTI has a few problems, such as I think it is unable to describe things like this example
19:51:17 <nakilon> oh wait, people say repl.it has both things at the same time
19:58:48 -!- earendel has joined.
20:26:35 -!- dutch has quit (Quit: WeeChat 3.3).
20:30:54 -!- dutch has joined.
20:57:34 -!- src has quit (Quit: Leaving).
20:58:46 -!- sprout_ has joined.
21:02:17 -!- sprout has quit (Ping timeout: 265 seconds).
21:20:31 -!- Lord_of_Life has quit (Ping timeout: 245 seconds).
21:23:01 -!- earendel has quit (Ping timeout: 252 seconds).
21:23:36 -!- Lord_of_Life has joined.
21:24:08 -!- ProofTechnique has quit (Ping timeout: 250 seconds).
21:24:08 -!- integral has quit (Ping timeout: 250 seconds).
21:24:13 -!- yuu_ has quit (Ping timeout: 252 seconds).
21:24:15 -!- j4cbo has quit (Ping timeout: 250 seconds).
21:24:32 -!- Argorok has quit (Ping timeout: 268 seconds).
21:24:32 -!- pikhq has quit (Ping timeout: 268 seconds).
21:24:46 -!- dnm has quit (Ping timeout: 260 seconds).
21:24:56 -!- mich181189 has quit (Ping timeout: 268 seconds).
21:25:05 -!- mich181189_ has joined.
21:25:09 -!- aarchi has quit (Ping timeout: 268 seconds).
21:25:33 -!- earendel has joined.
21:25:37 -!- dnm has joined.
21:26:32 -!- Argorok has joined.
21:27:38 -!- j4cbo has joined.
21:27:55 -!- yuu_ has joined.
21:28:42 -!- pikhq has joined.
21:29:18 -!- ProofTechnique has joined.
21:29:58 -!- integral has joined.
21:30:20 -!- aarchi has joined.
21:33:14 -!- sprock has quit (Ping timeout: 245 seconds).
22:37:46 -!- Asteriska has joined.
22:38:04 <Asteriska> hello esolangs irc
22:38:18 <Asteriska> oops i pinged the bot
22:39:44 <Asteriska> im trying to make an interpreter for hanoi love, in ruby, on replit.com, and im running into a point where i have no clue how to get it working
22:41:21 <Corbin> Cool.
22:41:32 <Asteriska> this is the spec sheet http://kidsquid.com:443/files/hanoilove/hanoi.txt
22:42:12 <Asteriska> and this is what ive got so far https://replit.com/@foxsouns/HanoiL-Intp
22:42:33 <Asteriska> just trying to wrap my head around it is hurting
22:42:55 <Asteriska> this is my first project
22:44:13 <Asteriska> maybe not the easiest haha
22:44:42 <Asteriska> anybody have any experience to give me a hand?
22:46:46 <nakilon> Asteriska what does stop you?
22:47:42 <Asteriska> logic, i guess: i cant think of a way to handle and express the stacks
22:52:45 <nakilon> woah, basic
22:53:23 <Asteriska> i know: wanted to bring it to a modern lang when i first saw it
22:54:12 <Asteriska> quickbasic runs on dos only, afaik: nobody wants to port it to js or anything haha
22:54:21 <nakilon> what is cleaned?
22:54:40 <nakilon> quick basic worked fine on Win XP at least
22:54:57 <nakilon> pretty sure it's supported even today, just named diffrently maybe
22:55:03 <Asteriska> its just the proper instructions, with all else removed
22:56:01 <Asteriska> basically i take out these: . ' , ; ` " : !
22:56:02 <nakilon> so cleaned is the code?
22:56:06 <Asteriska> yeah
22:56:23 <nakilon> how does stack D work?
22:56:30 <nakilon> *supposed to work
22:56:56 <Asteriska> its something like the code being ran? im lost on it tbh
22:56:58 <nakilon> I guses you don't need \ in lines 41 and 45
22:57:52 <Asteriska> and line 58 of reference.txt explains stack d
22:58:37 <Asteriska> its a weird self-editing clusterfuck thing, supposedly what loops are based upon
22:59:05 <nakilon> I guess D is like addresses of call stack
22:59:45 <nakilon> but you control it manually...
23:00:45 <Asteriska> yeah: i was hoping it'd be one of those things where its easy to implement, but hard to use, but that is not the case
23:00:54 <Asteriska> its just hard all around
23:01:14 <Asteriska> and basic isnt very legible, so i dont really know how he pulled it off
23:01:18 <nakilon> so D is like a storage of addresses for manual GOTO
23:02:06 <Asteriska> that would make sense; if it helps ive got some of the sample programs i found in the progs/ folder
23:03:06 <nakilon> as I understood you ahve to store indices in D but you assign cleaned to it that is wrong
23:03:53 <Asteriska> dang, now i have to refigure out how arrays work
23:05:27 <zzo38> QuickBasic works on DOSBOX on Linux
23:05:30 <nakilon> I don't see where is the instruction of goto, how does it loop?
23:05:39 <Asteriska> supposedly d
23:09:24 <nakilon> \wa ascii 34
23:09:27 <velik> Name: quotation mark | Similar characters: ʺ (modifier letter double prime) | ̋ (combining double acute accent) | ̎ (combining double vertical line above) | ״ (Hebrew punctuation Gershayim) | , , (double prime) | 〃 (ditto mark)
23:11:19 <Asteriska> ?
23:11:36 <Asteriska> oh
23:11:43 <Asteriska> thats a bot, duh
23:12:48 <Asteriska> zzo38: i dont always have access to a linux system, and dont want a programming language's only implementation to be via a vm
23:13:04 <nakilon> from the basic code I suppose that , isn't fully described I don't see it
23:13:12 <fizzie> Using WolframAlpha to look up an ASCII character feels a little like using an <insert big thing> to do an <insert small task>.
23:13:28 <nakilon> , is goto when we are on stack D
23:13:32 <nakilon> I suppose
23:13:52 <fizzie> That's under the "stacks" part of the spec.
23:13:59 <nakilon> fizzie how would you look up ascii with HackEso?
23:15:06 <nakilon> oh indeed
23:16:52 <Asteriska> im figuring, have sd set to an array from 0 to the code length - 1, and go from there
23:17:45 <nakilon> aren't all stacks emotry from start?
23:17:49 <nakilon> *empty
23:18:38 <Asteriska> excluding d, and when stacks abc are empty, they pop 1,0,0 respectively
23:19:43 <Asteriska> one sec ive got an idea
23:19:46 <fizzie> Re the ASCII lookup, that's actually surprisingly nontrivial when it's a decimal number. There's many many ways to do it by hex or octal because those are available as escape sequences, but decimal usually isn't.
23:19:50 <fizzie> `` unidecode $(printf '\x'$(printf %02x 34)) # silly but works
23:19:51 <HackEso> ​[U+0022 QUOTATION MARK]
23:20:34 <fizzie> Of course shelling out to some oneliner-friendly programming language (awk, perl, ...) is probably the way to go on HackEso.
23:20:46 <fizzie> `forth 34 emit
23:20:47 <HackEso> ​"
23:23:43 <Asteriska> according to the spec, the following should be equivalent to bf .[+.]
23:23:47 <Asteriska> . , ' " ' . . . . . . ' . . , ' . . . : , . ; ' . . . . , ' " ' . . . . . . , ! . . . ; .
23:24:15 <Asteriska> that means theres a loop there, somehow
23:25:00 <Asteriska> let me cut it down a bit
23:25:38 <Asteriska> . , ' " ' . . ' . . , ' . . . : , . ; ' , ' " ' . . , ! . . . ; .
23:26:49 <fizzie> You could say the loop part is the ..., right before the !.
23:27:54 <nakilon> what does it do when it reaches the last character? the .
23:28:17 <Asteriska> thats unneeded, but it switches stacks
23:28:23 <Asteriska> forgot to take it out
23:28:42 <Asteriska> i just took out the bits that had 4 .'s in a row because thats redundant
23:29:36 <fizzie> Yeah, that trailing . would be just a leftover from the BF translation, so that the next translated instruction would have a predictable stack (A).
23:31:27 <Asteriska> it moves to B, pops to the register, copies to stack b, pops to stdout, modes to D, copies to D, moves to B, pops to register, copies reg to b, moves to a, starts "loop", (cont soon)
23:33:39 <Asteriska> fuck this is confusing to keep ahold of
23:34:05 <fizzie> The loop really started from the "copies to D" instruction.
23:34:10 <Asteriska> yeah
23:34:33 <Asteriska> and i assume next read from d is the goto
23:35:57 <nakilon> I don't understand what does ` do in Echo program
23:37:39 <Asteriska> i assume its a part of the check for the "end at 255" claim it makes
23:38:09 <Asteriska> because ` is sub current stack from register
23:38:25 <nakilon> I thought : is check for \x00
23:38:52 <Asteriska> makes sense
23:39:16 <fizzie> "If a stack is empty when asked to pop a value, the value returned will be 1 for A, --"
23:39:45 <Asteriska> for b and c, it pops 0, and d never pops
23:39:48 <fizzie> So the initial , from A will give 1, and then the "; will *add* the input character to that 1.
23:40:05 <nakilon> omg
23:40:05 <fizzie> So the : will be a check for 255 or -1, whichever way you want to look at it.
23:41:13 <fizzie> And then the ` subtracts that 1 back out so you get to print the original character.
23:41:31 <Asteriska> in the reference, this is the comment "Echo: (Outputs back any input received. Enter char 255 to end) "
23:41:44 <fizzie> (The 1 is still on the stack at that point, because the ,' pushed it on there.)
23:42:25 <Asteriska> and the program stacks only store 8bit
23:42:28 <nakilon> oh so ` subtracts -1 after the exit check
23:42:29 <nakilon> ok
23:42:35 <nakilon> *1
23:43:08 <Asteriska> im assuming that the default behaviour should be loop back to 0 from 255, and vice versa
23:43:18 <Asteriska> at least, thats the way i would make it
23:44:16 <Asteriska> im going to stare at the basic code for a while
23:45:25 <nakilon> so you have sa, sb, sc, sd = [], [], [], []; instead of storing a number in it you can do something like.... st = [sa, sb, sc, sd] and then st.rotate!(1) and st.rotate!(-1) and then access the current stack as st[0]
23:45:41 <Asteriska> its settled: i dont understand basic
23:45:57 <Asteriska> nakilon: thats smart, im going to impliment that rq
23:46:28 -!- arseniiv has quit (Ping timeout: 265 seconds).
23:46:47 <fizzie> Here's an annotated echo: https://0x0.st/-EsA.txt
23:47:02 <nakilon> though it becomes harder to check which stack you are on to implement those different behaviours for a, b, c, d...; you would need .eql? or .equal? instead of == I suppose
23:48:08 -!- oerjan has joined.
23:49:04 <nakilon> or you could even store the whole instruction handler lambda attached to the stack object as the "OOP style" would suggest
23:49:32 <nakilon> but it would make your code deeper into ruby though
23:50:13 <fizzie> I imagine the choice of .',;`":! as instructions must've been a deliberate choice to be as non-mnemonic as possible.
23:50:42 <nakilon> I mean imagine classes A, B, C, D that are all inherited from something the same for all instrucitions but those few that are different for D are declared additionally for it
23:51:54 <nakilon> fizzie do you have an idea why does A pop 1?
23:52:12 <fizzie> So that the echo program could be so short and sweet? ;)
23:52:33 <nakilon> yeah that's the only eplanation I see so far
23:52:39 <Asteriska> naikilon: theres no other way to get a 1 other than from user input
23:52:42 <fizzie> Oh, maybe more seriously, so that you have *something* nonzero other than the isntruction offsets.
23:52:44 <nakilon> that it's somehow ralated
23:53:09 <nakilon> oh
23:53:11 <fizzie> Right, you can't pop from D to the register either.
23:53:13 <nakilon> indeed, no literals
23:53:54 <Asteriska> theres basically an add, a minus, a pop, a push, a switch, a modifier, and start skip and end skip
23:54:36 <nakilon> Asteriska forget about the rotate(), I guess it does not give a profit
23:56:14 <Asteriska> nakilon i meant that with the "switch" term
23:56:15 <nakilon> line 40 will be: when ?. then st = (st + 1) % 4
23:57:16 <nakilon> and declare some ss = [sa, sb, sc, sd] so ss[st] will be current stack
23:59:00 <Asteriska> nakilon: refresh, i think youre looking at an older version
23:59:09 <Asteriska> because as it sits, 40 is a comment
23:59:25 <nakilon> you can take a look at RASEL implementation -- it has tests; if you throw out 99% of code ..) you could reuse it to put those ./progs into test.rb and see when they'll start passing
23:59:45 <nakilon> oops
←2021-10-06 2021-10-07 2021-10-08→ ↑2021 ↑all