« first day (1528 days earlier)      last day (3421 days later) » 

8:00 AM
int main(int argc, char** argv) { return 0; } is how I start any program
 
@orlp they remind me that C-strings and passed container length and C are a thing
 
@Jefffrey std::vector<std::string> cmdline_args(argv, argv + argc);
 
I know
If I need command line arguments, I'll make sure to do that. But if I don't why bother.
Don't do while (std::cin >> newitem)
 
lol that totally happened as soon as i changed the blog style
the &amp
working on it, okay give me 20 mins for a revised blog that is rereadable >_>
 
8:20 AM
@Jefffrey the book starts out with linking print statments with std::endl and to avoid reverting back to println("bleh %s"); i was using them, it looked like linked printing statements required it in my compiler
 
@nsij22 std::endl flushes
 
int main(int argc, char** argv) is the automatically created template, if i am good i do int main(void) >_>
 
\n probably flushes too, but maybe not
@nsij22 no, don't do int main(void)
int main() is fine
 
=O thats what my programing teacher docked us 10% on if we didnt dooo
 
or auto main() -> int
 
8:22 AM
misssing a void-- 10%! instant dock
 
lol
 
user1804599
Don't do void parameter list in C++.
 
user1804599
It's pointless.
 
okay, i will leave it empty
 
user1804599
@GuruAdrian I like Perl.
 
8:23 AM
also note to anyone that uses wordpress, do not change the style if you have code brackets, unless you want to get AMPED UP!!!!
 
s/change the style if you have code brackets, unless you want to get AMPED UP!!!!//
FTFY
 
ftfy?
 
fixed that for you
 
user1804599
@Jefffrey ugh implicit return 0;
 
ugh non implicit return 0
don't remind me of return error codes pls
 
user1804599
8:25 AM
Unnecessary complexity.
 
what complexity?
 
user1804599
The language has been complicated by a moronic unfeature.
 
yes, but there's no complexity here
 
user1804599
"But you almost always want to return 0!"
Yeah I also almost always want to return values from any function so why not require return statements.
 
no, main is special
always will be
 
user1804599
8:27 AM
Yes. That's terrible.
 
user1804599
It shouldn't be.
 
and implicit return there is a non-issue
it lets you forget about return error codes entirely
just like int main() let you forget about arrays of c strings
 
user1804599
That's also retarded.
 
lol
 
user1804599
Why pass command line arguments to main at all?
 
user1804599
8:29 AM
Environment variables are global, I/O streams are global, CWD is global, why not make argv global?
 
@rightføld that's probably the only thing that makes sense about main actually
you call the program with explicit command line arguments, so you call main with explicit function arguments
 
user1804599
I can also call it with explicit environment variables.
 
user1804599
And an explicit current working directory.
 
how
 
user1804599
See exec(3)
 
user1804599
8:32 AM
Or better, help(subprocess).
 
make an example
 
user1804599
Popen(['echo', 'hello', 'world'], env={'a': 'b'}, cwd='/etc')
 
> Popen: command not found
 
user1804599
Open Python and import it from subprocess.
 
8:35 AM
how does python have anything to do with anything
 
user1804599
It allows you to start programs.
 
anything allows you to start programs
 
user1804599
You asked for an example, so I give you one.
 
user1804599
And it happens to be written in Python.
 
but you can't explicitly pass environment variables while calling the program with the usual ./program ... syntax
 
user1804599
8:36 AM
Could've written it in Z shell or Ruby or Scala but I chose Python because that was the first thing that came in my mind.
 
user1804599
@Jefffrey That's a shell thing.
 
that's what calling a program explicitly means
 
user1804599
You can with other environments.
 
@Jefffrey No it doesn't.
@Jefffrey Starting a program is an OS-level operation, not a shell-level operation.
 
it's actually an assembly level operation
 
8:37 AM
No.
 
user1804599
No.
 
which is actually an hardware level operation
 
@Jefffrey No? It's the OS.
 
user1804599
The OS provides an API for it.
 
which is actually a physic level operation
 
user1804599
8:37 AM
What language you use to call that API is completely irrelevant.
 
No, no, no.
No need to use false slippery slopes.
 
user1804599
@Jefffrey The API is higher-level than hardware.
 
A process is literally a thing defined by the OS.
 
None of those levels you gave have any concept of process.
 
the CPU has no concept of a process
 
8:38 AM
@rightføld yup
 
user1804599
Hardware doesn't give a shit about processes.
 
this might be shocking to someone, but how do one score a hat?
 
The OS is the lowest level with such an idea.
 
@chmod711telkitty ebay?
 
is it possible to start a program with an OS call directly?
 
8:39 AM
There's no other way...
 
@orlp ebay's shut down ... wait, that's pirate bay ...
 
you know what I mean
 
@Jefffrey man execve
 
@Jefffrey No, I don't.
 
user1804599
@Jefffrey Yes, indirectly.
 
user1804599
8:40 AM
With higher-level APIs like Python's.
 
whenever you start a program on linux, at some point execve gets called that makes the actual process
 
right
 
user1804599
> If the calling process is impersonating another user
 
user1804599
 
8:41 AM
then environment variables should be passed to main as well
 
user1804599
@orlp no, fork.
 
as well as the working directory
in some nice structure called Input or Environment or whatever
 
user1804599
@Jefffrey wait for styx top kek
 
you said you have a fetish for global things
I ain't waiting no styx then
 
user1804599
@Jefffrey No, I don't.
 
user1804599
8:43 AM
Fuck mutable globals.
 
@rightføld right
 
@orlp How did you make sense of that sentence?
@rightføld Er, like cwd?
 
@rightføld fork creates processes, exec* executes programs
 
user1804599
@R.MartinhoFernandes Exactly.
 
user1804599
Should be passed to main.
 
user1804599
8:44 AM
command line arguments, environment
variables, stderr, stdin, stdout, the directory in which the program was
started, the file system, the network, the preferred encoding, the preferred
locale, the process ID, the user which started the program, etc should all be passed to main.
 
@rightføld except that environment variables and the working directly already are globals
 
user1804599
They shouldn't be.
 
well, make linuxv2
where there are no environment variables
until you've done that, they are
 
@rightføld It's extrinsic state.
 
user1804599
If you don't provide access to that state then it's hidden.
 
8:45 AM
the environment in environment variable means it's inherently global
whether you like that or not (I don't), it's how the current system is designed
 
user1804599
The only way you can get around it in Styx is by being stupid and doing extern "C" getcwd: ... and extern "C" chdir: ....
 
user1804599
But even then all file system APIs only take absolute paths anyway.
 
@rightføld Or extern "C" anythingelsepotentially
 
or by calling one of thousands of FFI API functions that change the cwd...
 
user1804599
@R.MartinhoFernandes p much, but not a problem if Styx programs don't depend on it.
 
8:46 AM
@orlp Or just access it.
@rightføld The point is that you can't hide it unless you remove FFI completely.
IOW, deal with it.
 
user1804599
Libraries that change CWD are dangerous no matter the language.
 
user1804599
@R.MartinhoFernandes I know, but that doesn't mean I have to use it implicitly everywhere.
 
no, the CWD is dangerous, no matter the language
why?
because it's inherently global
that's what makes it dangerous, and trying to masquerade that makes it only more dangerous
 
user1804599
Calling chdir shouldn't change a thing for programs that don't use FFI calls.
 
chdir(".."); open("test.txt")
 
8:49 AM
@rightføld It's an FFI call. Your problem is solved!
 
I thought CWD was a shell thingy
 
@Jefffrey then how did you figure open("test.txt") worked?
 
That internally just appended it to relative paths
 
@Jefffrey relative to what
 
to the CWD?
 
8:51 AM
@Jefffrey but your program is not a shell, so how could it have a CWD?
 
never really thought about it
 
user1804599
@orlp What about that?
 
@rightføld I'm implying that chdir has effect on open (and other file functions), and unless all file I/O is FFI, it will have an effect
 
user1804599
open in Styx takes a file system and an absolute path.
 
@orlp No. He just makes it a pain to provide CLIs.
 
user1804599
8:53 AM
There is no chdir.
 
@rightføld You spend resources checking paths to see if they're absolute?
 
@orlp That's quite cheap.
We're talking about I/O here.
 
This 60% of u guys? imgur.com/gallery/D0zhw5a
 
startsWith '/' lol
 
Opening a file shouldn't be a bottleneck.
 
user1646075
8:55 AM
@rightføld at least perl has words 'n that.
 
oh and @chmod711telkitty pirate bay actually came back online tonight, real version
 
can absolute paths not start with / on linux?
 
user1804599
 
lol chroot
> Pathnames starting with a '/' character are called absolute pathnames. Pathnames not starting with a '/' are called relative pathnames.
 
user1646075
@rightføld I had J on my phone for a while, thinking it would be good to freak people out as an xtreme pocket calculator. But I never learned to use it ;-/
 
8:57 AM
So, checking if a path is absolute costs nothing
 
user1804599
It's O(1).
 
on standard linux, yes
 
user1804599
I don't know shit about how paths work on Windows.
 
@rightføld that's incredibly meaningless
 
user1804599
@GuruAdrian APL > J
 
8:58 AM
O(1) can be 2 hours of processing
 
user1646075
@rightføld that's better
 
user1646075
i want APL for my phone.
 
@orlp still better than O(n) then :P
 
user1804599
@GuruAdrian hardcore mode: with QWERTY keyboard.
 
user1646075
it would still freak people out, and I might be able to use it with a bit of refreshing
 
8:58 AM
@GuruAdrian In soviet russia APL wants a phone for you
 
user1646075
@rightføld oooooo
 
user1804599
@GuruAdrian or with one of those old phone keyboards
 
user1804599
The square ones.
 
@Jefffrey that depends on n
 
user1646075
I think J formalises a few things more clearly; I'm not sure 'cos I didn't understand it
 
8:59 AM
generally n is "big" in that notation
 
user1646075
@rightføld 2/ABC/quad/iota sort of thing?
 
@orlp No, it does not.
 
@Jefffrey but we were talking about filenames, thus n isn't big
 
(Well, it does. What do you mean?)
@orlp If n is bounded, O(n) is the same as O(1).
 
@R.MartinhoFernandes If n is bounded, an algorithm can still be classified as O(n) or as O(1)
 
9:00 AM
@orlp Because they're the same, as I said.
 
@R.MartinhoFernandes No, they're orthogonal concepts.
 
user1804599
> You have a tendency to feel you are superior to most computers.
 
You can classify an algorithm is O(1), and another is O(n)
 
No, they're the same set.
 
user1804599
@GuruAdrian exactλy
 
9:01 AM
that still doesn't mean that the O(n) one is worse than O(1)
that depends on n and the exact evaluation of the performance function
which is entirely orthogonal to how the performance function grows in relation to n, which is what the classification O(n) and O(1) tell you
 
user1804599
Yo momma is O(n!) space.
 
@rightføld Please turn your ass O(ff).
 
user1646075
calculating the size of yo mommas ass is NP incomplete
 
> Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 8001010d An outgoing call cannot be made since the application is dispatching an input-synchronous call. (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL)).
wut
 
@TonyTheLion Yes, you like that?
 
9:03 AM
No
its horrific
what does it even mean?
 
@TonyTheLion It means the computer is dying.
 
user1804599
> RPC_E_CANTCALLOUT_ININPUTSYNCCALL
 
@TonyTheLion Please check your USB privilege.
 
@orlp You're conflating two ideas that don't really match well.
O(n) can include two extra hours of processing, too.
If you want to count time, you can forget about that notation.
Don't mix the two.
 
@R.MartinhoFernandes Hence my statement saying that X is O(1) is meaningless in this context
 
9:05 AM
can O(1) operate worse than O(n)?
 
@Jefffrey Yes, depending on n.
@Jefffrey Given unbounded n, no.
 
@orlp Which I agree with. You shouldn't have proceeded to try and make meaning out of it, though :P
 
n > 1
 
@orlp Yes, it can.
 
user1804599
O(no!)
 
9:05 AM
@Jefffrey You need lim n->inf
 
@orlp what about n = 2?
 
@orlp But it's only after some point.
An algorithm that takes a million operations for input size 1, and then only n operations for any other input size n, is O(n).
 
@R.MartinhoFernandes Also, even given unbounded n it can still depend on your input distribution
(e.g. never hitting the worst case that actually makes it O(n))
 
so O(n) can operate worse than O(1) any time?
 
user1804599
My stomach.
 
user1804599
9:08 AM
stomache
 
user1804599
@Moshe no
 
I thought O notation was about how the number of elementary operations grows wrt to how much n grows.
 
@Jefffrey It is a property of an algorithm.
 
user1804599
Upper bound.
 
9:10 AM
Then after establishing this property, you can talk about actual runtimes
 
user1804599
If algorithm(1) takes c operations and algorithm(m) takes m operations, m > c for some m.
 
and it should be easy to see that 0.00001n is faster than 1 for small n
even though one is O(1) and the other is O(n)
:20587983 I literally just showed you the counterexample
 
I was talking to rightfold and I haven't read your message yet, calm down
 
@Jefffrey T ∈ O(f(x)) means: there is an a such that for all x > a, there is a k such that k > 0, k*f(x) > T(x), with T(x) being the actual exact count of operations.
@orlp It's actually a property of a function.
 
@R.MartinhoFernandes Right.
I was being sloppy
it's a property of the runtime function of the algorithm
you can also state that an algorithm uses O(1) memory
 
9:13 AM
@orlp Whatever you want actually. Like space.
 
or O(1) virgins sacrificed
but generally people talk about the runtime if not specified otherwise
 
@orlp well, in that case O(1) would be 0.00001 * 1 which would be smaller than 0.00001 * n for any n > 1.
 
@Jefffrey No it wouldn't.
 
why
 
Because f(x) = 100000 is in O(1).
 
9:15 AM
and f(x) = 0.00001x is O(n)
 
I'm dum
 
Sick ninja editing skills, @R.MartinhoFernandes.
 
I was talking about O(n) as if you passed n to the same algorithm
 
But that's not what it means.
 
9:16 AM
@Jefffrey O(n) looks like a function you pass in n
 
Yeah, I know.
 
but that's because the notation is confusing
(for the uninitiated)
There is no function O that gets called with n.
 
I knew that even before
 
user1646075
exists(byte) => boolean; exists(giga-triga-biga-byte-object) => boolean. O(1)
count-non-zero-bytes(byte) => 1; count-non-zero-bytes(giga-triga-biga-byte-object) => n. O(n)
 
I was just so eager to prove my point, that I took mental shortcuts until I reached a point of "wtf".
better go eat
 
user1804599
9:19 AM
Anyway checking whether a path is absolute is more than just startsWith "/"
 
Just to mess with wide
 
user1804599
It first has to find the type of the argument and look up the implementation of absolute? for said type.
 
I'm going to make a network drive that is set to the current directory
And then run it under cygwin with //cwdnetdrive/paths/lol
 
user1804599
And it has to check whether the path type is compatible with the file system.
 
hopefully type checks are compile time cost
 
9:21 AM
@orlp I was just going to point that out. According to the Cygwin project, POSIX paths starting // are allowed to have a special meaning.
 
user1804599
The compiler can optimize them out if it can guarantee the types.
 
user1804599
but lol I/O
 
Don't get me wrong, I never meant to imply that checking paths is expensive computationally
 
styx is not functional right?
 
It's just that they're notoriously complicated to get right on multiple systems
and bugs have serious impliciations for both the program correctness and security
but if you're building a programming language I guess you have no other option than to suck it up and deal with it regardless
 
user1804599
9:25 AM
@Jefffrey depends on the definition of "functional" you feel cozy with.
 
I have about 465 lines (including empty lines) of code in log4cplus just to create directories leading to log file path. :)
 
@VáclavZeman boost::filesystem?
 
@orlp Not allowed. ;)
 
by whom
 
@rightføld you think that "functional" is an ambiguous term?
 
user1804599
9:26 AM
Exactly.
 
@orlp By myself. Well, by the project.
 
@Jefffrey It doesn't work, no.
 
user1804599
Some definitions include impurity, some don't, some require laziness, some allow mutable variables, some don't.
 
@VáclavZeman I try to avoid Boost if possible, but I consider it an auto include when having to do extensive filesystem things
 
@rightføld IMHO it is not that ambiguous. Functional is when functions are first class citizens.
 
9:27 AM
Or when it functions.
 
@VáclavZeman Only white functions are first class citizens, any function that is black, gay, jewish or poor is not.
 
@rightføld so, what are the unambiguous characteristics of your language?
 
economy-class functions
 
@orlp s/white/white male/
 
Straight white male.
 
9:29 AM
@VáclavZeman As such, this is a arianistic functional language.
Check your functional privilege.
 
@orlp :)
 
As a first step towards a better aryan C++ I propose a new keyword
like you can mark a function noexcept, all jewish function must now be marked jew
 
straight healthy wealthy white male
 
All translation units containing jew functions must now be assembled with gas
 
shwwm
 
9:31 AM
It's a joke people...
 
sorry, had to
 
Is the holocaust off-limits?
 
user1804599
@Jefffrey it has modules.
 
user1804599
And protocols.
 
I'm using the flag system to show funny but possibly offensive posts to the network
 
9:32 AM
@rightføld Does it have higher order functions
 
user1804599
Of course it has HOFs I'm not a moron.
 
You can see flags as network-wide stars
 
@rightføld Do you ship a JIT for them or are they interpreted?
 
aww
 
user1804599
@orlp Yes.
 
9:34 AM
@rightføld I proposed two options and you answer with yes?
 
user1804599
Yes. :P
 
@orlp the latter
 
user1804599
But my VM interprets.
 
user1804599
Easier to implement.
 
user1804599
I don't know much about computers.
 
9:35 AM
@rightføld But when you switch to compiled you'll have to figure something out for HOFs
 
user1804599
Why?
 
user1804599
Functions are just Styx values.
 
user1804599
They're nothing special.
 
You can't compile all HOFs to native during compile time
 
user1804599
Why not?
 
user1804599
9:37 AM
It's most possible.
 
As an example, you can modify a HOF using the input of the contents of a website
 
user1804599
Example plix.
 
do you understand what a HOF is?
 
user1804599
Yes.
 
user1804599
It's a function that takes a function as argument or returns a function.
 
9:38 AM
exactly, and that implies you can create new functions that are modifications of old ones
those modifications can be done based on the input of a web resource, not available during compile time
 
user1804599
What
 
user1804599
Can you write an example in some language please? I have no idea what you are talking about.
 
user1804599
HOFs and runtime code generation are orthogonal.
 
user1804599
This is how I currently represent functions in Styx. May I change to JIT I just swap out bytecode for a function pointer and remove localVariableCount:
 
user1804599
struct Function {
    SharedArrayPtr<unsigned char const> bytecode;
    std::size_t localVariableCount;
    std::vector<Object*> closedOverObjects;
};
 
user1804599
Yes, that's just closedOverObjects.
 
user1804599
HOFs don't take bare function pointers. They take (function pointer, closed over objects) pairs.
 
user1804599
C++ also makes it possible with std::function and that doesn't require any runtime code generation either.
 
@rightføld closedOverObjects?
 
user1804599
Yes, closed over objects are objects that are closed over.
 
9:46 AM
Oh thanks. That clears it up.
 
I think I'm confused with something
 
Noob question : what is HOF ?
(Also, morning)
 
higher order function(s)
 
user1804599
In programming languages, a closure (also lexical closure or function closure) is a function or reference to a function together with a referencing environment—a table storing a reference to each of the non-local variables (also called free variables or upvalues) of that function. A closure—unlike a plain function pointer—enables a function to access those non-local variables even when invoked outside its immediate lexical scope. The following program fragment defines a (higher-order) function startAt with a local variable x and a nested function incrementBy. This nested function incrementBy has...
 
user1804599
@orlp You are confused with the only implementation of HOFs being taking/returning function pointers.
 
user1804599
9:53 AM
Doing that requires runtime code generation when passing closures.
 
@R.MartinhoFernandes @Jefffrey @CatPlusPlus shall we just call and end to this game and start over in the new year? maybe see if others want to join in.
 
@thecoshman If you're talking about Nomic, I might join after new year
 
@TonyTheLion our current rule set does allow people to join at any time btw.
 
Press F to pay respects.
 
F U
 
9:58 AM
@thecoshman I'm not desperate to join
 
@TonyTheLion it's amazing fun, don't let the fact only one person has yet to leave the game fool you.
 

« first day (1528 days earlier)      last day (3421 days later) »