« first day (350 days earlier)      last day (16 days later) » 

12:00 AM
@blueberry wait…people put all identifiers under one token?
you can…do that?
 
yeah??
were you planning to make a token for every possible identifier
 
…yeah, kinda
 
that would be unpleasant, seeing as there's an infinite number of them
 
oh
like var identifiers
that…changes things a bit
 
oh, i'm using identifier to mean "variable name"
 
12:02 AM
I thought you were talking about keywords like for, while, etc.
 
that's generally what they're called
 
OH NO LYXAL'S HERE
I'M ABOUT TO GET ROASTED TO OBLIVION
 
yeah you make a token for each keyword
keyword = let, for, while, if
identifier = variable name
 
makes sense
 
@Someone not for the reason you'd think :p
 
12:03 AM
I mean, everyone compares Java vs C#, but what about Rust vs Swift?
 
@lyxal uh oh
 
make a token for each keyword, make one token that contains a string for identifier
 
that's terrifying
 
I need y'all to keep a keen eye on the users in room list
 
@DannyuNDos why compare rust and swift
 
12:03 AM
Star spammer is back
 
do they even have similar goals
 
uh oh
star spammer
 
If anyone suspicious is in the user list, and stars start flooding in, ping me and tell me who it is
 
@blueberry now that I know the vernacular, everything makes sense
 
@blueberry Because they both are better C++.
 
12:04 AM
The Nineteenth Byte got hit as did a few other rooms
 
uh oh
 
@DannyuNDos doesn't mean you should compare them though
 
do we have an automod system for preventing the flood from actually happening?
 
prolog and ocaml are both better then c++ in their domains, comparing them is nonsense
 
@Someone no
 
12:05 AM
that's unfortunate
 
womp womp
why do people do that btw?
like, what do they stand to gain from it?
 
shrug
they enjoy it
 
No clue
 
I don't get it
why do some people do stuff that harms everyone, including themselves?
 
doesn't really harm them
 
12:06 AM
well, it kinda does
 
@blueberry Not just better than C++, but better C++. Unlike C++, they successfully incorporated OOP into C.
 
I use C++ for its fancy containers and stream syntax :shrug:
 
@DannyuNDos saying rust is OOP is interesting
 
Aw.
 
rust is wack imo
 
12:08 AM
very broad definition of OOP
@Someone why so
 
idk
it's very strange in terms of syntax
 
not really
 
at least compared to what I know/similar langs
and cargo/crates also feel different from other module/package solutions
 
there we go
 
Few months ago, I learnt that Unix and Linux do I/O by exposing devices in /dev, but what the heck about Windows?
 
12:10 AM
@Someone they're not that different from, say, python packages, they're just significantly better organized
better tooling too
 
I/O is one major reason that prevents me from designing my own lang, so
 
not to mention the fact that it was a lang specifically to suit one person's tastes, and then a whole cult formed around it for some reason, obsessed with the idea that it could replace all other code forever (or maybe just c(++))
 
> a lang specifically to suit one person's tastes
... like C++?
 
idk about cpp
it's not as cultish as crablang is
 
in any case, just like every other time this kicks off for some reason, there's probably not going to be anything constructive come of it
 
12:18 AM
As a wise man once said, C++ is bloated.
 
again, I just use it because stream syntax and std::string go brrr
and also because I don't like Rust as much
 
That said, in Haskell, String is defined as a typedef for [Char]. It was a mistake, IMO.
Should've been newtype String = String [Char], or something like that.
 
wait
what
how does that work???
 
I mean, just because of that mistake, the Show typeclass has showList :: [a] -> ShowS. That's a bad interface design.
 
what is ShowS?
 
12:25 AM
ShowS is a typedef for String -> String. It was introduced so the showing functions would compose conveniently.
 
huh
interesting
 
12:42 AM
what's the best way to actually process the AST once finished? a member function named something like execute?
 
That is a reasonable way to build an interpreter, yes
You could also use a visitor or build some sort of tree-walker
 
visitor?
 
Often there will be multiple layers of transformation from the initial parse tree to the final result, so it might not be "execute" straight away, for example if you are going to build a compiler and you need to lower the semantics of the input language to generate machine code. For an initial interpreter, whatever is the easiest way for you to get something to happen within the structure will be good
 
@DannyuNDos massive mistake
imo it should have just been an abstract builtin
not even a newtype
linked lists of chars are hilariously inefficient
 
so if I had an AST node type for floats, and one for strings, and I wanted to have a type/union/class/whatever that encompasses all AST node types that return a value via, say, a member function, how would I say "idk the return type of the member function, but it does return a thing"?
and would I use a template? a union? some other random thing?
 
12:54 AM
You need to decide on what the run-time semantics of the language are to establish that
 
I'm specifically using this for an output statement, among other things
 
Tagged unions are one way of implementing dynamically-typed languages that you could use
But if you have objects, static types, etc, you might go a different way
If you only have the two types of value, a tagged union seems easiest to go forward with
 
well
so far I have two
idk if that'll change, since I have no standards for the thing yet
 
1:15 AM
I just noticed that there is no reason to have the I monad and the O monad. They must be imbedded into the IO monad anyway. Dang it.
 
yep
 
This is why both std::istream and std::ostream are std::ios, I guess?
 
oh in c++ i have no clue
in a lazy language though, they both have to be IO anyway
 
6
A: Why isn't IO an instantiation of State?

Li-yao Xia Exposing the RealWorld in IO still gives you getUnsafePerformIO :: IO (IO a -> a) which is just as bad as unsafePerformIO. IO uses unlifted types (RealWorld#, (#,#)) to avoid unnecessary allocations, so it doesn't exactly match State anyway. It does match ST, but a direct definition of IO mini...

> getUnsafePerformIO :: IO (IO a -> a)
This is why Haskell doesn't expose main like Python does.
 
if I'm separating chunks of code for my program, but the things I'm importing to main aren't intended to be used anywhere else, can I just import it directly without a header file?
 
1:27 AM
@DannyuNDos define "exposing main"
what, the runtime setup before your main is run? yeah of course
 
*Cough*
 
1:40 AM
@blueberry so if multiple modular chunks need each others' content, how would I handle that? just import everything everywhere and use header guards to clean up my mess?
 
However it is that you usually structure your programs will also work fine here
 
 
2 hours later…
3:34 AM
@blueberry The main function's crimes have been exposed. To jail it goes! 10 years.
 
3:44 AM
Is that the real Peter Norvig who just joined the site? He doesn't have any other SE accounts.
 
I don't know how we could tell at this stage
 
yeah, there's no indicators to verify/disprove the authenticity of the account
 
I believe that it is not an impersonator
 
4:05 AM
I was more asking out of surprise than disbelief
 
Yeah, hopefully he sticks around
 
4:28 AM
I feel ashamed of myself for not knowing who Peter Norvig is
 
I don't really see why you should
 
fair
 
 
1 hour later…
5:33 AM
Quite a number of stack-based golflangs have word order of OSV, but there are so few natlangs with that word order.
I wonder speakers of such natlangs have stack-based thoughts?
Sapir-Whorf intensifies.
 
6:17 AM
Another load of stars
 
6:50 AM
good luck finding a OSV native speaker
oh ok warao might work
there's 33k native speakers
 
who is starring everything?
 
7:23 AM
Dunno
 
 
3 hours later…
10:08 AM
this person? not sure, just in room list
 
10:52 AM
@Redz pretty sure you need 20 rep to star
Maybe
I don't actually know
 
 
6 hours later…
5:15 PM
@DannyuNDos ASL is OSV
Slavic languages have a fluid sentence structure, and OSV is often used (myself included) if you want to emphasize the object (although IME OVS is more often used for that)
 
 
2 hours later…
7:33 PM
@DannyuNDos I'm inclined to say stack-based syntax isn't OSV, it's O1 O2 V and the verbs are imperative.
 
 
4 hours later…
11:05 PM
I'm under situation where tail call optimization is a savior.
 
11:15 PM
or some sort of search
linked list
let me guess
 
Huh?
 
that's the most common situations where I would expect TCO to be a lifesaver
 

« first day (350 days earlier)      last day (16 days later) »