« first day (4434 days earlier)      last day (416 days later) » 

12:07 AM
firing up the vm for the first time now
 
did it crash
I bet it did
smh yall should've used 0xD00D1E as the magic number
 
@Ginger does a compilation error count
 
yes
 
it only did so bc i renamed a function and forgot to update a usage
 
lol
 
12:09 AM
i am currently stepping through it
 
imagine having a working debugger, couldn't be me
 
yes, the first run is a detailed debug, make sure Everything Runs Right™
 
*screams in VSCode*
 
vscode has a debugger too
no?
 
I also use VS Code but it's worse on Windows because gradle is incompatible with MinGW bash so I have to use PowerShell
@Seggan It has a debugger but you need an extension to actually use it, it doesn't work by default
 
12:10 AM
erm i forgot to add the LOAD opcode
 
^^, and for some reason the Kotlin plugin's debugger doesn't work right even though I compiled it from source
rest of the plugin works fine tho
 
and apparently i malformed my program?
yes i did, its having a constant label of PRINT instead of STRING lol
 
@Seggan point of clarification: Does the unpacker support unpacking things like 00 (fixint 0) and cc 00 (uint8 0) as Int, or do I have to encode it as d2 00 00 00 00 (int32 0)?
 
it supports everything msgpack does
so, yes
ok, running it for the second time, wish me luck
 
I wasn't sure if it would require you to unpack the first two as Byte instead of Int
 
12:17 AM
no it wouldnt
as you can see in the hexdump above
 
Got it
What is msgpack's official C/C++ library doing? There are three main branches with unrelated histories: master contains the license and a README directing you to the other two branches, c_master contains the pure C implementation, and cpp_master contains the C++ implementation
 
msgpack's a clever idea but the execution is too iffy for my tastes
 
mhm, time for a third attempt. the last one failed because the base enums werent being classloaded in time, so they werent being registered
so im just registering them manually before execution
 
class load order problems? oh no...
 
nah, it was me forgetting that enums dont exist until you reference them :P
 
12:23 AM
they what
 
classloading thingies
@Bbrk24 as in, they arent loaded or anything till you reference them
ok, 4th run
i accidentally made LOADC take 0 args
i can confirm programs are being loaded properly
but do they run?
 
> LOADC: loads random garbage
 
Right now I'm honestly considering which would be harder: installing cmake or reimplementing msgpack from scratch
 
@Bubbler yep
 
I don't need the whole of msgpack -- the array, bin, and float types are completely unused, for example, and I only need an encoder, not a decoder
 
12:28 AM
@Bubbler idk why they call a garbage dump a "constant pool"
YES CGR HELLO WORLD WORKS
 
YO
 
0000: de ad c0 de 03 a5 50 52 49 4e 54 a5 4c 4f 41 44   ......PRINT.LOAD
0010: 43 a6 53 54 52 49 4e 47 01 02 ad 48 65 6c 6c 6f   C.STRING...Hello
0020: 2c 20 57 6f 72 6c 64 21 02 01 00 00               , World!....
slightly modified from the previous version
ya think i should make an asm for this for easy debugging?
@Bbrk24 for small changes when reviewing u can make a commit request
 
Oh I forgot about that
 
easier to do than me physically making it
 
 
1 hour later…
1:54 AM
Ok, I was kind of thinking the whole flag thing was a little bit silly. But I actually just looked at a few of the Vyxal answers for the first time and it immediately drew up a knee jerk reaction. I conceptually understood what was going on, but I did not realize how just like infuriating it is. I don't think it's changed my opinion on anything, I still stick with the philosophical angle that I had. But it is definitely a different perspective.
I guess the big thing is that it feels like Vyxal is trying to cheat, and it feels like noone really minds. That feeling of unfairness, is something I didn't really expect.
Everything here, is obviously my personal feeling (not even really an opinion), not taking a stance on this "as a moderator".
 
2:06 AM
I don't think it's too bad that Vyxal does it, under the philosophy of each language is competing within its class, rather than against every other language.
Also, I didn't think the flags changed that much? mostly just IO stuff
 
Except for when the accepted answer is "Vyxal s, 0 bytes"
 
Eh, what does a 0 byte answer gain?
 
yeah some of the flags are basically pre/appended commands lol
 
Don't forget, Stop upvoting Trivial answers.
 
2:21 AM
@ATaco I guess the infuriating part is that it feels like that's not really the philosophy people are operating under.
 
Fair, What can you do?
Restricting flags makes some languages practically unusable.
 
Yeah, exactly. All I can do is downvote, and that is all I do.
 
Demanding C users include their -l... would be waay too punishing.
Correct answer. Vote with your votes.
 
@ATaco What? I can literally clang main.c and get an executable with no flags
even if I #include <stdio.h> and whatever
 
Depends the required libs I suppose.
 
2:24 AM
I've never had to mess with include paths
 
A better example is Klein which won't run unless you pass it one of 12 3 character flags.
 
I've had to with GCC and windows.h, and also openGL in the past
 
Okay that's fair
 
The more I use C the more I enjoy the language.
 
C is enjoyable to use. But I also hate it.
 
2:56 AM
@WheatWizard yes
 
I have had a Thought about cgr: when/how are we going to flesh out the bytecode? What operations will we include?
 
0
Q: Great Leap to the Right

Huỳnh Trần KhanhGiven a string s consisting of characters a-z lowercase, generate 5 arrays a1, a2, a3, a4, and a5 of size n (length of s) where the i-th element of each array represents the index of the next occurrence of the i-th character in s, with the following conditions: If no such occurrence exists, set ...

 
Would it be possible for cgr to provide a library/utility for generating lexers and parsers?
 
3:17 AM
(I have the parsing step down for Trilangle, the hard part is going to be converting bytecode formats)
 
wouldn't it just be a matter of writing what you currently have, but just as bytecode instructions?
transpiling is usually easier than writing an interpreter
 
Well, Trilangle bytecode has instructions inline, like assembly. CGR bytecode has all the constants clumped at the beginning. So, some instructions may need to be more than one, and I have to somehow account for that in my jump instructions
Perhaps not difficult, I've just never had to do this kind of thing before
 
do you mean global state may be changed between function calls?
 
Function calls? Oh no, Trilangle isn't nearly that high-level
 
well what is it about the constants at the beginning that is troublesome?
 
3:26 AM
Maybe it won't be that difficult, it's just a problem I haven't had to think about before
The real problem is that some instructions will become more than one and others won't, and the fact that I have to account for that in my jump offsets
 
will CGR have labels?
 
Seems pretty unlikely given the bytecode format. @Seggan Are there any plans for that?
 
@Bbrk24 if python can manage gotos in bytecode, so can cgr :p
 
Yeah, but the current implementation makes it seem like gotos will be more like those of machine code than those of C
 
well that seems okay. Just group things that are more than one command into some sort of block, have a label to the block as a whole and jump to that if needed.
 
3:34 AM
I might also just pad it with NOPs so that all instructions are the same number of CGR bytecode ops
Given the tendency for disassembled CGR bytecode to contain an excess of NOPs (mirrors, skips, and some branches are represented as NOP) that may not generate the most efficient code but it is an option
 
Have a group command that allows you to either execute all or none of the commands in a group
And you can't jump to inside the group, only above or below
 
The other option is that I store the CGR bytecode in a temporary buffer and do some work on that buffer to resolve gotos
(that is either going to be straightforward or impossible. I have no idea which.)
 
label(characterN): group { doX, doY, doZ....} ... jump(characterN)
 
Oh no
I hadn't even considered what the threading operator would look like in CGR bytecode
github.com/bbrk24/Trilangle#threading look at this entire mess
 
Is it internally implemented as multiple threads?
 
3:43 AM
No. I forgot to document it there but it guarantees that ticks are synchronized between threads, so the interpreter actually just keeps a vector<thread> and calls .tick() on each one in a for loop
What I mean is that I have to reconcile that with other languages' implementations of concurrent processing somehow
If you want to look at Trilangle's implementation, github.com/bbrk24/Trilangle/blob/master/interpreter.cpp#L19 . Could probably be improved/optimized a fair bit though
case status::waiting should probably be moved into its own subroutine, now that I look at it
 
Sounds like a discrete event simulation could be useful
 
 
1 hour later…
4:55 AM
I just published a feature to my online interpreter that lets the program be stored in the URL. If I go back and edit all my Trilangle answers to use this, I'd flood the front page, so I don't think that's a good idea. Should I do it in batches? What's the best way to approach this?
 
How many answers will be impacted?
 
17. I've already updated one of them, though
 
5:14 AM
I would recommend a batch size of 7
 
And how long between batches?
 
5:31 AM
Probably just until someone else makes a few edits or answers a few questions
 
Fair enough
 
There should probably be a meta proposal, because I don't think anyone really knows what to do in these situations
Not a proposal, a discussion
 
0
Q: How to Handle Mass Edit Events

lyxalEvery now and again, links to online interpreters will change, answer headers will become outdated and other circumstances will occur that impact the contents of a non-trivial amount of posts. There's nothing wrong with this - things change and are modified over time. Given that a whole bunch of ...

 
Something like that
Because this also applies to things like mass question retagging or mass grammar changes or other things like that
 
 
4 hours later…
9:44 AM
Random dumb idea for my practlang, what if in addition to ++ and -- you could do ** to multiply by 2 in place, // to divide by 2, and %% to mod 2
 
Makes sense.
 
@mousetail go further and make it so that all operators can do this
 
What other operators are there?
 
I guess bitwise ones but && and || already have another meaning
 
oof
 
9:49 AM
Suppose they didn't though, what should the default right value be?
 
Bi-glyphs should be limited to the minimum
 
Also << and >> I guess, could be <<<< and >>>>
 
@mousetail depends on the operator.
 
For &&?
 
@mousetail Yes, and in general, such implicit arguments are just more to remember.
 
9:50 AM
@mousetail Well what does & do
 
bitwise and
 
Just support var+=1 etc. for all operators and get rid of the strange 1-arg syntax
 
That would be the sane option though
 
> practlang
Practical languages should be sane, imho.
 
I'll probably not implement these things but theoretically how would they be used
 
9:51 AM
@mousetail something that makes a number like 16 or 8 bits at most
@Adám my suggestion to make it for everything was mostly in jest anyway
 
I might make a fork of my practlang with lots of dumb useless stuff
esolang variation
 
APL doesn't have the var++ and ++var but all operators, even user-defined ones, can be used in the var f= arg syntax.
 
More languages should support that
It's really cool
Vyxal 3 has arg f#>var for it
 
Actually practically I might implement ???? that, for a type that implements default, assigns the default to a nullish value
 
Slightly hard to read, imo.
Should use instead of ??
 
9:57 AM
@mousetail could I have an example? I'm not quite getting this
 
If myvar is a declared but unassigned boolean, myvar???? is equivalent to myvar=false
 
Oh that's cool
Why not just do it at variable creation though?
 
If myvar is num, then it becomes 0, if string, it becomes ""
@lyxal Maybe you're getting it from some external source.
 
Something I recently did in PHP, $arr??=[] except then you could write it shorter since arrays have a default value
 
But I don't see how this can work if everything isn't strongly typed.
 
10:01 AM
But the default is already defined for the type
 
@Adám It is strongly typed
 
So not assigning a value should set the default at creation
 
This would redeclare a Option<T> as a T
 
@mousetail Can you import JSON?
 
There will probably be a standard library module for JSON yes
 
10:03 AM
But how do you infer types?
 
@mousetail then use the default when getting the value
No need for an operator
 
E.g. what is the type of myvar = {foo:"bar"}.baz ?
 
A enum of all all possible JSON types, like rust
Though normally you'd load JSON into a predefined structure
 
But what does myvar???? do?
 
myvar in your example is not a Option<> so you couldn't use it
 
10:05 AM
Will you have both var++ and ++var?
 
@mousetail So then how about myvar = Some({pretend this is json I'm on mobile}.baz)
 
@lyxal If the JSON enum defines a default value, that. So probably Some(JsonValue::null)
 
fair enough
 
a????????b should be valid syntax, right?
 
@Adám Yes
So you could do this:
if (value ????) {
    log_warning("value was null, corrected");
}
 
10:09 AM
@Adám what would the b do?
 
@Adám It would fail the type checker since a???? is not nullable anymore, and ?? requires a nullable type
 
Oh.
 
@mousetail but what if it was a double nested option?
 
Hmmm true
 
Not that you'd probably see something like that in a sane production system
But still
 
10:11 AM
Imagine a???????????? when unwrapping a tripple nested Option
 
It would greatly reflect the questions the programmer has as to why there's a triple nested option
 
Add (?n) syntactic sugar so (?6) means ??????
 
That would further encourage terrible practices, I love it
 
@Adám Go all the way and make that work for every operator and syntax
 
Yesss!!! I mean Ye(s3)(!3)
 
10:14 AM
Then you could just remove normal addition, just do a(++b)
 
(n(o)100)100) - the screams of programmers seeing this syntax
3
Totally worth it btw
 
 
2 hours later…
11:59 AM
0
A: Sandbox for Proposed Challenges

mousetailIsolate the binary signals There are n binary signals, with intervals of 1 through n. For example, for n=3 the lists could be [1], [0, 1], [1, 0, 1]. Each list represents a repeating pattern. So [0,1] is really [0, 1, 0, 1, 0, 1, ...] The signals all start at the same time, but they are sent over...

 
12:12 PM
LDQ: What could sorting a number do that isn't sorting the digits?
 
@lyxal sort by number of holes? :p
topology go brrrr
 
somehow, I don't think that'll make it past PR review :p
 
I'd approve it
 
wait it's not even my PR
that's right
 
time to go cry about rabbit
 
12:19 PM
I'm asking to make a suggestion
 
specifically time to cry about Kotlin not letting me put whatever I want in annotation parameters
*angry static typing noises*
guess my built-ins only get to return primitive types :|
really loving the fact that I now have over 100 errors in my code
 
@lyxal Very out there suggestion but it could return the next smallest power of 10, IDK why I associate that with sorting
 
well now I've got a bonus problem
currently the classes representing Rabbit objects have type as an instance property, as opposed to a static one
 
@Ginger bonuses in code golf questions are usually discouraged.
@mousetail I like that
 
I'm inclined to say this is inevitable because technically classes like FunctionObject are meta-classes
so their types can't be fixed
but this means I can't figure out the Rabbit return-type from the Kotlin function signature
this is a symptom of ANOTHER issue, which is that I can't write Rabbit structs from Kotlin code; only functions
I'm getting kinda tired of this :|
really what I need to do is make a distinction between classes-with-known-type (like primitives) and meta-classes-with-no-known-type (like functions)
because I know the type of the primitives! it doesn't change!
well actually reviewing my code I actually can make Rabbit objects from Kotlin... just not structs
I can make things that behave as instances of structs but not the structs themselves
this is a problem because it creates a divide between "struct" and "object"
I guess I get to rejigger some things
really I should be able to construct a RabbitObject from a ResolvedType
so, here's what I'll do:
ResolvedType will get a new fields property, which will contain a Map from Identifiers to ResolvedTypes
upon constructing a RabbitObject from a ResolvedType, it'll automatically fill out its Context with RabbitObjects created from the type's fields
cool and good
although actually I'm not sure that fields should be a member of ResolvedType
maybe just ResolvedStructType, because structs are what have fields
 
12:33 PM
Just gonna interject with something I just experienced: gotta love how flask hosts on port 5000 while the http-server node package hosts on port 8080
 
new problem: how do I fill out fields during resolution?
...or initialization?
I suppose that's the whole point of the resolution system
hmm, yeah
 
@lyxal This is actually super convenient, it means you can run both at the same time
 
during resolution the fields property will be filled out
 
@mousetail it means I have to fight the URL autocomplete
and besides, I can't
 
That's a pretty minor issue overall
Also it's nice that this prevents caching and service worker sharing between the two
 
12:36 PM
in my case, there'll never be flask and node running at the same time
 
You can explicitly set the port
 
really my first big red flag should be the fact that I have a file named PrimitiveObjects.kt
when they should be primitive types
 
@Bbrk24 any that we need -- common golfing operations
@Bbrk24 i was thinking on it yesterday. i think yes, we should have at least numerical labels
 
Numerical labels works perfectly for me.
 
oooooooooh kotlin reflection lets me just create types out of thin air
kinda
okay, how should I turn types into objects? a builder function?
(@Seggan you may want to read through most of the above)
 
12:46 PM
idk about the JVM, but the Objective-C runtime let you register new classes, or even new methods on existing classes, at runtime
 
._.
yes I think builder function
 
@lyxal It turns out that stackexchange only lets you edit 10 posts in a day
 
at this point I will probably have to rewrite a large majority of Rabbit to work with the massive numbers of breaking changes I've added
:|
 
@Bbrk24 huh
interesting
don't think I knew that one
 
So now I have to wait until "tomorrow" (i.e. this evening) to finish the second batch
 
1:04 PM
0
Q: Shortening this Code to process nested tuple even further without the use of max()

Dark ProgrammerI have the code: marks = tuple(tuple((input("Enter subject: "), input("Enter marks: "))) for _ in range(int(input("Enter number of tuples: ")))) print(tuple((s[:3].upper(), max(int(m) for t, m in marks if t == s)) for s in set(t for t, m in marks))) #INPUT (("Physics",131),("Chemistry",30),("Phy...

 
1:57 PM
@Ginger i feel like you should rewrite rabbit
@Ginger thats a symptom of bad code
reflection should be used sparingly
 
calm down :b
@Seggan I'm not actually using reflection for that, I was just observing it was possible
@Seggan I am rewriting it
 

« first day (4434 days earlier)      last day (416 days later) »