« first day (187 days earlier)      last day (459 days later) » 

00:39
Can someone confirm that this question would be on-topic for langdev? There was a request to migrate it which seems reasonable, but wanted a second opinion/some confirmation.
seems reasonable to me
that reminds me of coninductive definitions in agda actually
I would say it's on topic here
oh lol somebody has already answered it with copatterns
6
Q: Are there Haskell-like languages where equations allow for arbitrary left-hand sides?

MaiaVictorIn Haskell, you can define algorithms by equations that pattern-match on left-hand side constructors. For example: data Nat = S Nat | Z double :: Nat -> Nat double Z = Z double (S x) = S (S (double x)) Now, for a moment, imagine that the constructor restriction was lifted, and we allowed ar...

@HenryEcker you're good to migrate it imo
Ah
You did. Good stuff
Sorry I was cleaning up the comments in stuff before sending it over
Wasn't aware the new posts bot posted migrations
It might need better tags
00:57
pretty sure classes don't have companion objects unless you explicitly add one (or smth like kotlinx.serialization gets involved)
01:38
@lyxal Neither was I :p
It's based on the active page
So I guess the active page makes migrations look like new questions
02:02
CMQ: In the context of mutability, why is the antonym for "freeze" not "melt", but "thaw"?
I can't explain the reason why too well, but that is the more common use in everyday English. Like, you might freeze some food for long term storage. And then later, you would thaw it. It would sound more unusual to say "I need to melt that first" than "I need to thaw that first." I think it's because you're doing it to the thing, but I'm not sure
@DannyuNDos melting usually means taking something frozen and turning it back into a liquid (like frozen ice); thaw implies taking something frozen and making it less cold (like frozen chicken)
you wouldn't usually think of a variable as a liquid, but it's not unreasonable to think of a variable as a chicken ;)
Yeah... Just heard it from EL&U chat.
yeah fair enough
another way to think about it is you freeze your variable in a block of ice (so you can't mutate it anymore) and then thaw it out of the ice when you want to mutate it again
melt would refer to the ice itself, which isn't the important bit - the variable is
02:18
That said, I don't get why C++ introduced const_cast.
nobody understands why C++ does anything
5
more seriously, I don't either
why the hell would you ever want to un-const something
and why would you allow it
03:07
At this point, C++ seems quite bloated. I gotta learn modern C (not modern C++), because that became a thing.
OOP is inferior under FP in my perspective anyway
03:52
just learn rust, or write C like it's an FP language
unless you really need what C offers
the best thing I ever did was writing C like it's ocaml
so much more efficient
 
1 hour later…
05:20
I mean, refer to the following C code:
#include <stdio.h>

int main() {
    int n = 1;
    while (n < 10) {
        char arr[n];
        for (char j = 0; j < n - 1; ++j)
            arr[j] = 'A' + j;
        arr[n-1] = '\0';
        printf("%s\n", arr);
        ++n;
    }
    return 0;
}
Unlike C++, C allows array sizes to be dynamic.
That seems much more friendlier than C++'s std::vector or anything like that.
@DannyuNDos what you're using there is called a VLA
or variable length array
note that this is no fault of yours, this comes up quite often
but they suck
they're stack allocated, not heap allocated, so you can stack overflow real easily when using them
they're also hard to reason about and bad for compiler implementors, bad for optimisations, etc
C should not allow arrays to be dynamically sized,
because nothing should ever allow them to be dynamically sized,
because they should not be dynamically sized
@blueberry Really? I thought the stack is 4MB?
Doubt that can be overflowed that easily.
the moment you use VLAs for anything nontrival they will mess something up
they're practically only good for what you posted above
little examples
it's just another case of C presenting something "nicely" only for it to actually be quite sucky
No more pointers that I forgot to free(), at least.
05:36
...
that sort of reasoning is why VLAs haven't been removed from the language yet
because they're "easier"
they're out of the standard since C11, but almost every compiler still fully supports them
nix MSVC iirc
I bet there was a reason why they didn't deprecate it.
i don't know about you, but I wouldn't consider walking along a cliff instead of a potholed path easier
sure, the cliff might be nice and flat, but there's a lot of places to fall
or, if you want the classic metaphor, a lot of places to summon nasal demons
*Sigh* I would bet money for that you would be thrown off if I told you that my primary programming language is, in fact, Haskell.
05:40
my primary programming language is ocaml, my dude
i've written haskell quite a bit
And Haskell is stupid because it boxes literally everything.
shrug
it's fast enough
also GHC doesn't box everything
GHC's unboxing engine is actually quite incredible
i recommend you look into it sometime
it's a marvel
Yeah, even for a stupid language, there always exists a wise compiler...
05:41
is a language not defined by what it's compilers can do
we would all be writing assembly if it wasn't for the first generation of optimising C compilers
I mean, there simply exists. No guarantee when it will become reality.
Halting problem strikes again.
shrug again
languages are only defined by fast enough
haskell and ocaml are fast enough for the vast majority of software any reasonable person would want to write
if you absolutely need more speed, go write rust or something
but don't just assume you need that speed
In that regard... Do you actually hope (rather than merely wish) there will be a breakthrough for Python's optimization?
After all, it's the chairperson language for now.
05:48
the GIL removal is interesting
but I would hope that it gets replaced by better languages
any language where you can make a quiz like "what does this program do????" is a bad language
and python has about a million quiz points
Bring it on, Mojo!!!!
Reveal thyself in public, Mojo!!
mojo sounds awful
3
only fixes perf issues, not the actual issues of semantics
06:07
band-aid over a broken leg
 
9 hours later…
15:15
It makes me cringe so hard every time I see someone liking Mojo🔥💯🤣 non-ironaically
in Vyxal, 8 secs ago, by Vyxal Bot
🤣🤣😂😂🤣🤣🤣💯🔥🔥🔥🔥🔥
Like if you want a more performant Python, it exists (UNLIKE MOJO) and it's called Julia
 
3 hours later…
17:48
@RydwolfPrograms yes
@Ginger yeah i find that verry annoying since you cant define extension functions then on them
@DannyuNDos THIS
in The Nineteenth Byte, Mar 8 at 22:23, by Seggan
@ATaco thats why c++ is bad. it tries to add GP stuff to glorified assembly language
@DannyuNDos well thats debatable
@DannyuNDos i mean JS is worryingly fast for such a language, im confident python will be the same soon
 
4 hours later…
21:52
@Seggan JS is worryingly fast because it's had quite possibly the most effort ever put into optimization into it
python is not getting that anytime soon
nor should it
python is slow by design
use julia if you need speed
0
Q: What are the drawbacks of allowing implicit boolean/integer conversions?

user16217248Some languages (C, C++, JavaScript, Python) allow one to use integers as booleans and vice versa: int x; if (x) // Equivalent to: x != 0 y(); Or: int x = 10 + (y > 10); // Equivalent to: y > 10 ? 11 : 10 However, other languages such as Java, C#, and Swift disallow this. They do not even al...

22:17
python has a huge community behind it and stuff like numba and pypy exist
PyPy is poorly maintained and most packages don't work under it. Too sadge.
@Seggan tfw you use the wrong tool for the job and now everyone is locked into it
22:50
@blueberry you can say the same thing about anything else
including python itself
no that's the point
python is a good tool for shelling out to C/C++/FORTRAN libraries and webdev
backend webdev that is
not a huge amount else
23:29
I'm inclined to agree with you on that
oh, and chatbots
Hypercomputation or super-Turing computation is a set of models of computation that can provide outputs that are not Turing-computable. For example, a machine that could solve the halting problem would be a hypercomputer; so too would one that can correctly evaluate every statement in Peano arithmetic. The Church–Turing thesis states that any "computable" function that can be computed by a mathematician with a pen and paper using a finite set of simple algorithms, can be computed by a Turing machine. Hypercomputers compute functions that a Turing machine cannot and which are, hence, not computable...
Even if hypercomputation would become reality, there cannot exist a programming language compatible with it... or can there be?
After all, this would require an infinite set as the alphabet.
numbers
Programming hyperlanguage.
> infinite set
or am I misunderstanding?
23:44
Not as words, but as the alphabet.
Here's a seemingly-paradoxical proposed set of the alphabet: Line segments struck with a pen with infinitely many different kinds of lengths.
0.9cm, 0.99cm, 0.999cm, and so on.
A hypercomputer shall measure lengths of those lines exactly.
Sure, this cannot be done in our physical reality because things are made of atoms, but take this as an analog computation model.
A hypercomputer would be able to tell if a "standard" program terminates or not. You could expose this in a programming language by having two "levels": one where you can "only" write normal programs and a second level where you can write normal programs but also you get a primitive which will tell you whether an arbitrary program written in the first level halts or not
perfectly finite language
and not implementable unless it's possible to have a hypercomputer
Yeah, that works too; that is a computer equipped with an oracle.
All it needs is halts :: (a -> a) -> Bool.
halts f shall decide whether fix f would halt.

« first day (187 days earlier)      last day (459 days later) »