« first day (4443 days earlier)      last day (616 days later) » 
00:00 - 15:0015:00 - 00:00

15:00
I need to read in both directions to understand it
@Seggan by this do you mean, like, concatenate them all together?
because I'm like 99% sure that wouldn't work
@Ginger no
what do you mean then
but treat them as the same file
dont physically concat and parse or whatever
@mousetail see: python
although i do like both ways
@Seggan I still don't get it
15:04
just parse the files and resolve the symbols into the same module
but what if a file tries to use a symbol that it hasn't imported?
if I treat the whole thing as one file I wouldn't be able to detect that
check the other files in the same module
what?
well if it tries to do that, doesnt the programmer want to use a symbol in the same module, but not the same file?
ohhhhhh
I keep forgetting that Java can do that lol
so, I actually don't really like that feature
because it means that you can just use a symbol from out of nowhere without giving any indication of where it came from besides "it's in this module"
LDQ: Should files in a module be able to access other symbols in their module without explicitly importing them?
15:10
@Ginger well then just import thisModule and deal with it normally
@Seggan I'm confused
do you mean like I as the programmer should do that?
well what other option is there
that still makes it optional
and it shouldn't be optional, it should be required
i never said its optional
if I do the "treat all files as one file" thing, that makes the "implicit imports of everything else" thing unavoidable, does it not?
15:16
well dont treat them as one file then
thats what i meant by this
okay, and we're back to square one: how do I handle imports of other files in the same module?
7 mins ago, by Seggan
@Ginger well then just import thisModule and deal with it normally
that'd be a circular import, no?
it'd be importing itself, which would cause the recursive algorithm to recurse forever
@Ginger not if you temp exclude this file
okay, what about if one of the other imported files needs something that's in the file being processed right now? that'd be an error I guess
but it'd be unavoidable too
15:22
have you checked how existing langs do it
if every other file has to be loaded first then no file can depend on anything that it doesn't itself contain
@Seggan no, because they never explain it :p
and ain't no way I'm reading 2000 lines of C to figure it out myself
ask on cs.se
ask on PLDI
@hyper-neutrino If I go to vyxapedia.hyper-neutrino.xyz/elements , Ctrl-F "Print", and then click on the first instance of the word, it's a 404: vyxapedia.hyper-neutrino.xyz/elements/%2C
ah yes, ,
okay
I have decided to basically do the thing Java does, including the implicit imports, because it's the simplest option
I might change it later tho
 
1 hour later…
16:43
@Ginger I'm happy to explain how tinylisp 2 handles circular imports, but IDK if it'd be very pertinent to what you're doing
@pxeger using is weird
Usually you use imperative verbs not present tense ones
use, do, let, import, etc.
It makes sense because using doesn't do anything
It's just a assertion on the environment
Yeah it does, it says to use the definition of a thing from elsewhere
No, the other things is used no matter if you add a "using" or not
All it does is say you assume it's in scope
use isn't a descriptive statement about what you're using, it's a command says which thing for the compiler/interpreter to use in certain places
16:54
No it's a descriptive statement, you can use the thing without a using statement
You just need to type the full path
No you can't
Exactly
You literally can
You need to say which to full path to...*use*
Not which you are using
You are using things from that path
But you aren't unless you specify that, and it's not being specified
16:55
Unlike for example "import" which would actually run the module
Using doesn't do anything
It does tho. It disambiguates which of a thing you're using.
also i wanted using so i can say continue using
That's a declaration, not a action
You're reassigning something to a different name. That is an action
16:56
but thats not how it works
That's like arguing let isn't an action and should be letting
@mousetail In what sense is a declaration not an action?
you are saying that "the symbols from path are available in this file"
The state is the same before and after
fn is also a declaration
16:57
@Seggan That's not what use does
while def from python is a action
@RydwolfPrograms thats what it does in rol :P
Same in rust
No, in Rust it doesn't specify where to find the thing in the filesystem whatsoever
It just tells the compiler "I am using this name as a shorthand for this full name"
Would you call type a "declaration" too? How far does it go?
Yep
That's a declartion
See this:
Rust, 45 bytes: [`fn main() {
io::stdout();
}

use std::io;`](https://ato.pxeger.com/run?1=m72kqLS4ZMGCpaUlaboWN3XT8hRyEzPzNDQVqrkUgCAz38qquCQlv7REQ9Oaq5aLq7Q4VQEoYGWVmW8N0QTVCzMDAA)
16:59
And a declaration..._is an action_
I am telling the compiler something
Telling the compiler something is not a action
Okay, telling it to do something
use doesn't do anything
17:00
Then delete it and see if your code runs
it does something or it wouldn't exist
You just need to change the code a little and it does the same thing
binary is exactly the same
You're just drawing a meaningless distinction between things that are one thing and things that are a different thing
@RydwolfPrograms but it doesnt do anything during runtime
@mousetail That's true of all sorts of things
You criticized the word
@RydwolfPrograms Most of those things are declarations, not actions
17:01
Plenty of let statements can be optimized out. Should let be letting?
Let is a declaration
not a action
So you agree it should be letting?
no because the assignment that comes afterwards is a action
let does something at runtime, using doesnt
let x; is a bit odd grammar but let x = 5 makes sense
and it does do something at runtime
17:02
So...you're drawing a distinction between "let" and "the thing that comes after it"?
it's both a declaration and a action I guess
I mean if you do that every keyword is a "declaration" about what comes after it
@mousetail This whole declaration vs. action dichotomy is pointless
Yes
But it's why use is use
and that makes 100% sense
@Seggan Does it tho? Your code doesn't actually "let" anything equal anything. Your code at runtime doesn't contain any variables
let is both a declaration and a action, Seggan is right
17:04
@RydwolfPrograms but it does. it possibly changes (depending on optimizations) some memory/registers during runtime
@mousetail The whole point of this argument is use vs. using and I'm arguing for use. If you also think it should be use, why are we even discussing this?
IDK
I like use because it's shorter, not because it's correct
use is an imperative; it implies the compiler is doing something. An action.
It doesn't do anything
Declaring something necessarily causes the compiler to do something
17:05
No
Otherwise it would be useless
the IL is exactly the same
But the compiler still does something
Wtf are you on about, yes, it does something differently depending on whether the use exists or not
17:06
It doesn't do anything
If I delete a use and change nothing else, the code does not work
You need to use absolute paths
That's not doing anything
Thus, the use changes something. And it's not changing me, and it's not changing the rest of the world, it's changing how the compiler understands the code
It doesn't change the code at all
@mousetail But what if I don't?
The use is necessary, right?
17:07
The compiler doesn't care
It sure does, because otherwise, it errors
Yes but the exact same way as with the use
No? If the use exists it no longer errors
Not if the thing you referenced doesn't exist
Assume it does
That's not what we're talking about here
17:08
Then both with and wihout use it works
No it doesn't, because without use, it doesn't know which io is which
is it std::io? or tokio::io?
it uses the exact same import logic
just you need to pass the correct path
but that's not doing anything
which is different
AND WHAT IF I FUCKING DON'T
The use changes things
that doesn't count as an action
because the compiler does nothing
It does though, because everything is an action
17:10
and the program does nothing
no it's not
To do is to act. They are synonyms.
it's just being
not acting
But the compiler has to do in order for the library to be
that's like saying a string in a config file is an action
of course it's not
@RydwolfPrograms are text based macros the compiler doing something? bc this is technically what use does
17:51
...
@RydwolfPrograms must've been quite the headache :p
why tf is Edge asking if I want to translate chat from Vietnamese
18:15
i'm interested :P
do you just make a graph of all the imports, then smash all the nodes together and let the edges just determine visibility between them

Using use, should I use using?

1 hour ago, 19 minutes total – 125 messages, 3 users, 0 stars

Bookmarked 6 secs ago by Seggan

i couldnt resist the chance to make a pun play on words :P
the convo was the other way around, but this title is nicer lol
(I still had arguments left but school WiFi went out)
(That was a rather dumb argument so probably a good thing; I think it just came down to a different view of what counts as an "action" and given the immense vagueness of the word I don't think doing so much makes sense)
18:43
LDQ preferred prompt for a REPL?
I like ones that show some information
I like Crosshatch's prompt
@RydwolfPrograms What kind of informationg would be useful?
Depends a lot on the language I think
E.g., in one language I was working on that was heavily built around asynchronous stuff, it'd display the number of awaits waiting in the background
There's not much async stuff. It's a very high level semi-declarative language designed to read like english.
think inform 7
18:53
Make the prompt change to "yikes" whenever you start typing something syntactically questionable :p
And "based" if you use recursion or other cool stuff
lol that would be great
ChatGPT integration: the prompt changes to its response to "Is this code well-written?"
Also be sure to consider how the prompt will look with multi-line pastes
That's actually a big priority, since the language is intended for beginners they'll be asking questions lots so it would be helpful it it had some debugging info for when they ask me stuff
But what can I fit in 7 characters
return value of the last expression?
19:01
That would be printed separately above the prompt
oh, right
That'd already be right above it
Thanks chat
I actually considered that too for a moment before realizing it didn't make sense
Maybe a hash of some internal state, so you could quickly notice if someone's running some code in a different context from what's expected?
E.g., if you're teaching a group of people all at once
that should be a debugging command
19:03
Intriguing idea
maybe have it change to catch common errors, like [Did you mean print?] >>> pribt(
like clippy
Note the language is intended for quick prototyping for people with less experience, not for teaching absolute beginners. It's probably too high level for that
Think gerkin
@UnrelatedString tinylisp 2 is interpreted, so importing a file is basically equivalent to executing it. The interpreter keeps a list of the files that have been imported so far, and if you import a file that's on the list, it doesn't do it again. Since 95% of what's in the libraries is function definitions, whose bodies aren't evaluated until they're actually called, it doesn't really matter which definition gets executed first, and so everything just works.
ah, neat
that is pretty elegant
that's cool, but doesn't work for me because ✨static typing✨
19:10
Yeah, I figured it wouldn't
@mousetail >>> normally, ... for continuation lines
@mousetail definitely be careful it's not too much--ghci showing every single imported library in the prompt gets old fast
Yea I'm intending to not go over 10 characters
@DLosc yeah honestly you can't go wrong with that
Although I somewhat like the idea of [1], [2], etc. so you can reference specific lines by number. Even better if you can access the return value of a line by number.
the three-characters-then-space is nice for keeping the "feel" of a four-space indent if you end up using those within the repl
oh yeah that's smart too
19:14
again, Crosshatch's prompt is nice:
Also rant about python where there is no prompt for line continuation causing your lines to be misaligned which is a terrible choice for a language where indentation is important
yeah it would be nice if the python repl auto-indented when it prompts for a continuation line lol
@mousetail ?
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(
... "hello"
... "world"
... )
helloworld
>>>
@Ginger I don't think it changing live is a good idea
hmm, wait
0 <= `hello`
0 => 'hello'
[1] vyxal>
that's what Crosshatch's prompt looks like
19:16
What is
I see three prompts lol
Is [1] vyxal> the prompt?
the bottom is the prompt, the top is what the prompt turns into when you press enter, and the middle is the result of the expression
here's a color screenshot:
I don't think the color adds much clarity :p
@DLosc I distinctly remember not having it sometimes but testing now shows it does work. Might have been some broken shell or something
19:18
@mousetail IDLE doesn't:
>>> print(
	"hello"
	"world"
	)
helloworld
>>>
Oh that might have been it
also IDLE uses tabs for indentation >:P
rSNBATWPL used (rsnbatwpl) as the prompt which worked fine and was nice and simple
@DLosc with a tab stop of 8, no less >8P
That emoticon makes me feel new emotions
Mostly confusion and fear
19:20
Good, good
those are new emotions for you??
When mixed in these specific proportions yes
Well I just tried to do the when-you-can't-scream emoticon and got :¤ so I guess we're kissing now
There
@RydwolfPrograms tinylisp uses tl> and tinylisp 2 uses tl2>
careless_whisper.wav
the best prompt line is just nothing. embrace simplicity
19:23
And Pip uses >> and .. which I forgot that I only used 2 instead of 3. Guess that's because it's a golflang.
As long as it's between 1 and 6 dots
me on my way to make a language whose REPL prompt line is 7 dots just to spite rydwolf
@hyper-neutrino "Why do you need a prompt to tell you to type something? You've got a cursor, don't you?"
precisely
A quality REPL just overwrites /bin/sh
2
19:25
I was going to upload a gif of the prompt to make it a bit clearer what happens but it's not working so instead I'll tell you to download Crosshatch and try it out yourself :p
Currently rewriting SOCK² in Rust because the Node one participates in a little jank from time to time
Both Firefox and Chrome's JS console prompts use images instead of characters, but Firefox's prompt looks like » ( for results), while Chrome's looks like > ( for results). Neither of them has a continuation symbol.
19:47
@RydwolfPrograms sock2?
@hyper-neutrino terminals go brr
@RydwolfPrograms "you don't need sh, we have sh at home"
20:46
CMC Reverse a array in JS in the worst possible way
what have you done
function f(a) {
	b = a.map((_, i) => a[i])
	while (true) {
		x = Math.floor(Math.random() * b.length)
		y = Math.floor(Math.random() * b.length)
		if (x - y) { k = b[x]; b[x] = b[y]; b[y] = k }
		if (a.every((x, i) => a[i] == b[b.length - i - 1])) return b
	}
}
AAAAAAAAAAAAAAAAAA
BURN IT
21:05
@hyper-neutrino -1 This isn't the worst possible way; you could make it less efficient by removing the if (x - y) check /s
Though I like how all your temporary variables are globals ;P
technically speaking I believe the if (x - y) is actually worse because for larger numbers it's an almost entirely unnecessary check and for smaller numbers it runs more often thus preventing branch prediction from working
@DLosc also yes :P
@hyper-neutrino Ooh, interesting
But actually, how about if (x < y) instead?
...not using var/let makes the variable global?
not sure if that's actually true though, but if it is, even better because it looks like it adds efficiency
@Ginger Just JavaScript things, don't worry about it :P
21:07
@DLosc hm, that would be nice as well, even more branch prediction fails and it takes more iterations thus running the O(N) check even more times!
AAAAAAAA
WHY
THAT'S MY NEW LEAST FAVORITE JS FEATURE
It is one of the JS features ever, yes.
@hyper-neutrino Oh hey, I just noticed the ==
yep
also the lack of semicolons :P
i could've used a cursed bracket style but I decided not to overdo it and make it at least readable and have just the content be cringe
also the lack of useful variable names :P
Hmm, even if you use === there's still a bug: if you try to reverse an array that contains NaN, it infinite-loops because NaN === NaN is false.
JS is like a path through a swamp that doesn't have guardrails and isn't always marked very clearly. If you step off the path by accident, you might be fine, or you might be swallowed by quicksand. But as long as you stay on the path, you're good!
(Well, there are some guardrails, but you have to explicitly ask for them.)
 
2 hours later…
22:51
Isn’t Object.something() used for that?
23:21
and TIL it works correctly with NaN
JS is becoming sane, the world's end is near
23:34
Wait TIL /s is shorthand for </sarcasm>
I mean I knew the s was for sarcasm, but the / part
@RydwolfPrograms what
ain't no way this originated on tiktok
Who said anything about tiktok lol
No? those tags originated on like forums or something years before tiktok
could've sworn that's the source for that
And tone indicators have been around wayyy longer than tiktok
23:41
my source for this is a chat message posted last year by lyxal or smth
r/circlejerk has its own tags, /uj and something, for </unjerk> and whatever the other one is
Wikipedia's first citation for tone indicators is 2003
huh
TIL
I came up with my own Ω(n²) sorting alg that I don't think has been described before
template<class Iter>
void worseSelectionSort(Iter start, Iter end) {
    while (start != end) {
        std::make_heap(start, end, std::greater<>{});
        ++start;
    }
}
is this swift
23:44
C++
ok thank god
Swift doesn't have template or ::
When you see template all over the place you know you're in C++ land and should immediately turn around
if that were a modern language I would've been very sad
...what does template do
It's C++'s equivalent to generics
23:45
yup that's exactly as cursed as I expected
It is different from modern langs' generics in a few ways though
SFINAE and specialization
...what
template<class T>
void print(T val = 5) {
    std::cout << val;
}
SFINAE: the default argument can be used when T is an integer type, but doesn't cause an error in other cases. You can still say print("Hello") because you're not using the default argument as a string
template<class T>
void iDontLikeIntegers() {}

template<>
void iDontLikeIntegers<int>() {
  static_assert(false, "I said I don't like integers!");
}
specialization: because all templates are resolved at compile time, you can do things like this
source?
23:51
My first text-based programming language was C++
The original is in a cenote in like Kansas or Oklahoma
@Bbrk24 my condolences
00:00 - 15:0015:00 - 00:00

« first day (4443 days earlier)      last day (616 days later) »