« first day (1570 days earlier)      last day (3380 days later) » 

10:05 PM
@R.MartinhoFernandes Drink water, go back to sleep.
Don't you dare die on us.
 
@R.MartinhoFernandes you seem to be enjoying the painting is all
 
user1804599
This is interesting.
 
user1804599
Using for_all on an infinite interval immediately fails.
 
user1804599
Instead of entering a potentially infinite loop.
 
Ell
@R.MartinhoFernandes have you taken any paracetamol?
 
user1804599
10:14 PM
> The only way to go is to go away.
 
user1804599
Now that's a reasonable way to go.
 
10:26 PM
especially after failing like we did tonight
 
@Ell Paracetamol is for kids. I prefer the stronger stuff :P ...
 
user1804599
I am thinking about putting environment stuff in dynamically scoped variables instead of passing them to main.
 
Ell
@πάνταῥεῖ what like? :P
 
alkerhol clearly
 
Ell
I don't think alcohol helps a fever :P
 
10:30 PM
b00z3
 
@Ell I think it does. help it
 
user1804599
Although it does not clarify which of those variables are used.
 
Ell
@рытфолд why?
actually I see the reasoning
well actually just make them static and stick them somewhere
 
user1804599
io.write env.stdout (utf8.encode "Hello, world!\n") is nice but verbose
 
THC, CBD and whiskey actually. But I really don't want to promote any drugs (besides coffee ;-) )
 
10:32 PM
@Ell no lazy wanker bad bad bad
 
Ell
@Puppy hey - environment variables are shared between runs anyway
 
...
 
user1804599
Eh.
 
user1804599
Only if you design your API to do that.
 
Ell
I mean.
 
10:33 PM
@Ell Yes, so they're mutable global variables but even worse.
 
@Puppy :-P ...
 
You mean. Indeed.
 
Ell
a programme gets the environment variables you start it with
right? o.O
 
... so
 
Ell
so they will always be global
 
10:34 PM
We all share the universe anyways, so let's do away with locks and live communes
 
Ell
well, they will always come from one place
whether you pass them into main or get them from a static thing somewhere
 
Oh wait. That's your ideal indeed
 
@Ell They're only global if you make them global.
 
Ell
I guess
 
I mean, if your OS offers fuck_you_get_shitty_magic_global(), then there's a limit to what you can do, but you can still do something.
 
user1804599
10:34 PM
sub main (env: Environment) do
    ioutil.readln utf8 env.stdin
    |> strconv.atoi
    |> factorial
    |> strconv.itoa
    |> ioutil.writeln utf8 env.stdout
end
 
user1804599
how terrible is this set of APIs
 
Ell
@Puppy True
 
Ell
and now I like the env: Environment thing. I've seen the error of my ways
 
> she (he?)
 
10:36 PM
other things it's bad to put as globals: stdin/stdout/stderr, command line arguments
 
user1804599
@Columbo lol
 
user1804599
@Puppy the filesystem!
 
user1804599
the network!
 
user1804599
the working directory!
 
Ell
@рытфолд working directory should be passed to main imho
 
10:38 PM
@UlrichEckhardt I realized this loophole. But I'd never recommend it. I prefer to give the /straight up/ answer, But I realize that if you can /prove/ that your using the iostream instance "as-if" const, you could get away with it (which is exactly the line of of thinking that produced option 1. in the first place). I hope you will do wisely and have success :) — sehe 5 secs ago
 
Ell
as part of the programmes invokation
 
user1804599
Of course it should.
 
user1804599
Fuck it being a global mutable variable.
 
Ell
invocation
 
user1804599
Not even thread-local.
 
Ell
10:38 PM
it's implicit too
it's pretty terrible now that I think of it
I guess it's not implicit actually
 
user1804599
My idea is to not even implicitly use it in file open stuff.
 
user1804599
openFile takes only absolute paths.
 
Ell
@рытфолд earlier, you did (encode.utf8 "Hello World!") or something, what is "hello world" encoded in by default?
the encoding of the source file?
 
@Ell dem spellings
 
user1804599
Not.
 
user1804599
10:40 PM
It's a string.
 
user1804599
Not bytes.
 
Ell
@рытфолд fair enuff
 
user1804599
utf8.encode takes a string and returns bytes.
 
Ell
a unicode string?
I'm a little confused
 
@Ell obviously
 
user1804599
10:41 PM
You can transform it into a sequence of code points, abstract characters, etc.
 
string =~= sequence of codeunits
 
user1804599
But a string itself isn't a sequence.
 
user1804599
You can't loop over it or ask for its length.
 
why not
 
units (inb4 utf16)
 
user1804599
10:42 PM
Because those are ambiguous for strings.
 
how so?
 
for text, more aptly
 
user1804599
Code points? Graphemes? Bytes in some encoding? Abstract characters? Words?
 
all of those are dumb except codepoints.
 
user1804599
Why?
 
user1804599
10:43 PM
Code points may be very meaningful for operation X but not at all for operation Y.
 
because all of those are composed of operations on codepoints.
except bytes which is too primitive
if you have range of codepoint, you can make range of grapheme or character(wtf meaning did you even intend here) or word.
 
user1804599
"Abstract character" is well-defined.
 
no it really is not.
 
@Puppy Once more, Puppy paints the universe irrelevant, because "I don't like it" means it's irrelevant!
 
Ell
@Puppy wat
graphemes is very useful
as is words
 
10:46 PM
Not for Puppies.
 
Ell
esp if you're writing a text editor :P
 
user1804599
definition is right there
 
that does not mean that it would make sense to have a string type be a range of words.
 
@Ell I.e. only then (and a handful similar tasks, that are usually already done for you)
@Puppy nobody said this. It was used to found the claim of ambiguities
 
10:47 PM
ambiguity implies that there is more than one alternative that would make sense.
if the other alternatives do not make sense then there is no ambiguity.
you can construct range of grapheme, abstract character, or word, from range of codepoint, and most operations only need codepoint anyway
 
Characters is frequently more interesting than codepoints. Anyhoops. Everybody is right here. High horses be damned
 
so it really only makes sense for a string to be a range of codepoints.
 
@Puppy Why do you have to be such a dick about null? :) Even its inventor admitted that it was a terrible mistake. Every method call is a potential NullPointerException. And that's all there really is to it.
 
It's like a church. People use each other to reiterate beliefs and very mildly challenge them
The only big difference is, that people are more openly disagreeing.
Gosh.Gosh.
The guy has found out about turing complete templates. Now he jumps to the extreme of "types with no data, only static content". He fails to realize that he's ***still*** grossly underestimating compiler optimizations
 
user1804599
Should strconv.itoa take a locale?
 
user1804599
10:50 PM
@sehe lol
 
@рытфолд Is it relevant to your application domains? (If GP, then yes)
 
user1804599
I don't know.
 
user1804599
It's a utility function to turn integers into strings.
 
user1804599
What is GP?
 
user1804599
Grand Prix?
 
10:51 PM
General Programming?
 
General Purpose (died 1754, at Gurlan Beach)
 
user1804599
I could define let atoius = atoi en_US.
 
> PS: I will NOT donate a kidney
 
No kidney...
 
10:53 PM
whoa beautiful
 
user1804599
hot
 
user1804599
Which can be useful for parsing stuff which has a known format.
 
Ell
why is it called itoa?
 
@JohanLarsson where
 
Ell
10:54 PM
itos makes more sense :P
 
@Ell lol. dat name. And strconv. Last time I saw strconv was in Visual Basic 6
 
user1804599
because Go
 
@sehe dunno, I'll tineye it
 
@Ell itos is a thing.
 
user1804599
Go calls it strconv.Itoa and strconv.Atoi.
 
10:54 PM
@Blob Whoosh
 
@sehe Sargeant Singleton unfortunately survived to this day
 
Ell
how about just tos then override
or to_s
 
@Ell you mean, overload
 
@Ell std::to_string?
 
not talking about c++
 
10:55 PM
@sehe url
 
Ell
@sehe Yes, thank you :)
I'm not on the ball at all today
 
same principle
 
user1804599
Ok so this is what factorial program looks like gist.github.com/rightfold/1e527b03db3ebb452fd8. Tell me how horrible it is.
 
user1804599
Time to sleep. Byebye!
 
is there any performance penalty when using fixed-size data types?
 
10:56 PM
@JohanLarsson mostbeautifulplacesintheworld.org/?p=4560 top 10 urban pools
@mrpyo depends. Native types -> highest probability of being optimal. You profiler knows
 
but I guess on popular platforms int32_t is just int, right?
 
Don't fall asleep now
that would be a waste of time
@mrpyo in reverse, yes
 

« first day (1570 days earlier)      last day (3380 days later) »