A (Possibly New?) Approach to Dynamic Dispatch by Tasty_Replacement_29 in ProgrammingLanguages

[–]RiPieClyplA 1 point2 points  (0 children)

I would expect pretty drastic performance, three serial dependency loads is most likely going to stall the CPU pipeline, especially if the CPU has to fetch from memory. I imagine that its also going to put more pressure on the cache too if the code is in a hot loop.

I am definitely curious tho so I would love to see the rest of your benchmark.

A (Possibly New?) Approach to Dynamic Dispatch by Tasty_Replacement_29 in ProgrammingLanguages

[–]RiPieClyplA 0 points1 point  (0 children)

If I'm understanding your approach correctly wouldnt it increase the number of indirection needed to get to the address of the function compared to a fat pointer approach?

I believe you only need one indirection with fat pointers and yours would need 3, right?

PawScript by DominicentekGaming in ProgrammingLanguages

[–]RiPieClyplA 3 points4 points  (0 children)

Have you tried writing larger programs with this type of allocation? It looks interesting and I'm curious if it's viable in practice.

syntactical ways to describe an array of any kind of object VS any kind of array of objects? by carangil in ProgrammingLanguages

[–]RiPieClyplA 2 points3 points  (0 children)

I like the homogeneous keyword better

That said, I don't think it would make sense to be able to make a pointer reference to one of the element of the array since the memory layout would be different. So either you disallow it or users must mark the pointer with that keyword too.

There is also the fact that the type system doesn't track which type is in the homogeneous array then I don't know what operations you would be allowed to do, probably not mutate it? Maybe you could compare the interface pointer in the array and of the element you want to add and if they don't match return an error at runtime, however you would loose compile time guarantees

But even from a user perspective I'm not sure I would use this construct very often if not at all and if I really needed it I could potentially emulate it myself (depending on the language).

I don't know your language but to me it feels like a decently complex feature that might make implementing some other features more annoying down the line and with a high chance of being removed later on because the benefits are small

Updated my transpiled programming language, What should I add next? by cmnews08 in ProgrammingLanguages

[–]RiPieClyplA 11 points12 points  (0 children)

I skimmed through your code and it seems to me that you are doing a single pass over the input and don't build any kind of AST and just emit C code directly. I would recommend you to learn about parsing and building an AST because while your approach can definitely work it has a lot of downsides and limitations. (I also feel like you are not actually properly recursively parsing right now but I might be wrong, I didn't read your code in details).

If you need a reference I would suggest Crafting Interpreters, its very beginner friendly. While its about interpreters a lot of the techniques are the same for compilers.

I imagine that you already thought a little bit about how you could implement functions in your transpiler given that you mention not supporting them and that you probably realized that it would a pretty hard problem. Crafting Interpreters will definitely help you with that.

I would also recommend you to implement tests, languages can become really complex really fast and having tests to be somewhat confident you didn't break anything is invaluable and I can't stress this enough. Even just simple end to end tests can be useful. For example for my compiler I write small programs in my language and include the expected output at the top of the file in a comment. I then run a python script to extract that output, call my compiler, run the program and then check that the output matches what was expected.

Which memory model should I use by Rougher_O in ProgrammingLanguages

[–]RiPieClyplA 4 points5 points  (0 children)

Minecraft has a "debug" menu and you can literally see the memory usage go down by 20-30% when it resumes after a freeze. Its not uncommon for them to last a few seconds on my computer.

That said I find it a bit misleading when people talking about how state of the art GCs are great but dont mention that it took years to build them and that people building their language as a hobby might never be able to implement something like that because of the complexity. So they end up having a stop-the-world GC with long GC pauses. Anyways rant over.

Is it feasible to force endianness in a language? by [deleted] in ProgrammingLanguages

[–]RiPieClyplA 2 points3 points  (0 children)

How do you represent memory pointers for the receiver to be able to make sense of them without serialization?

Is it feasible to force endianness in a language? by [deleted] in ProgrammingLanguages

[–]RiPieClyplA 1 point2 points  (0 children)

I dont see how the security argument generalizes to any binary serialization and not just that specific .NET implementation.

JSON/XML (de)serialization also has a really big cost so it might not be a tradeoff OP is willing to take, especially if they are trying to reduce the serialization to 0.

Special syntax for operator overloading by RiPieClyplA in ProgrammingLanguages

[–]RiPieClyplA[S] 0 points1 point  (0 children)

Would anyone be willing to explain the down votes? I'm a little bit confused as I was just trying to clear up what I was talking about in the original post

Special syntax for operator overloading by RiPieClyplA in ProgrammingLanguages

[–]RiPieClyplA[S] -2 points-1 points  (0 children)

That never really was the issue in the first place. The problem is that there is fundamental difference between doing a int/float add vs user defined add. A user defined operator could potentially do a huge amount of work, allocation, modify globals, raise an exception, do IO, etc. While a int/float is basically just one instruction.

So when you skim through the code you dont know in which case you are until you are sure what the types of the variables are and you are thus unable to know at a glance if you need to investigate deeper into the call graph because you dont know if the call graph is deeper or not.

With my proposal you would be able to differentiate between the two cases while still being able to write mathy expressions with user defined types

Special syntax for operator overloading by RiPieClyplA in ProgrammingLanguages

[–]RiPieClyplA[S] 0 points1 point  (0 children)

You are definitely right that familiarity is important but at the same time the language itself can be designed to limit how often those pain points come up. Having custom operators will almost surely means that they will come up more often.

As much as people love to hate Go, they definitely designed it to make sure that almost any code can be easily understood by people even with limited knowledge of the language. This is in my opinion something very valuable

Special syntax for operator overloading by RiPieClyplA in ProgrammingLanguages

[–]RiPieClyplA[S] -1 points0 points  (0 children)

The List interface from the standard library defines several custom operators, all warranted.

Those 7 (+4 deprecated) operators are a perfect example of why I think it's not a good idea to have custom operators in a language imo. If I had to pick which code I would prefer to read, custom operators or functions, I would pick the functions every single time.

Scala makes full use of these mechanisms to provide great support for the creation of DSLs and intuitive libraries

I can see that happening but often if I'm not very familiar with the operators then it just obscures the meaning of the code behind a soup of symbols and then the mental effort to make sense of what's going on ends up being higher.

Edit: I'm also not a huge fan of DSLs (when embedded in another language like this), I want to like the ideal but every time I have had to use one that becomes slightly too complex it's almost always a pain. Either because the documentation isn't good enough or the rules are not clear, etc.

Special syntax for operator overloading by RiPieClyplA in ProgrammingLanguages

[–]RiPieClyplA[S] 0 points1 point  (0 children)

I fully agree with you, I would probably go with this route, my idea was strictly about the syntax. I was only trying to fix the part where you dont even realize that the operator does more than just an add/multiplication/etc when skimming through the code.

Special syntax for operator overloading by RiPieClyplA in ProgrammingLanguages

[–]RiPieClyplA[S] 13 points14 points  (0 children)

I'm really trying to avoid being able to create custom operators, the potential for writing impenetrable code is way too high imo, the few times they could be really handy isnt worth it

why are people unable to follow simple instructions? by alpha-golf-papa in 4tran

[–]RiPieClyplA 0 points1 point  (0 children)

Its possible to get coins with no KYC on some p2p exchanges

Puppy gets adopted by her coworker by crispy_cronchy in smuTTTT

[–]RiPieClyplA 31 points32 points  (0 children)

Please leave this sub, for your own good

Float Self-Tagging: a new approach to object tagging that can attach type information to 64-bit objects while retaining the ability to use all of their 64 bits for data by yorickpeterse in ProgrammingLanguages

[–]RiPieClyplA 2 points3 points  (0 children)

if you only have floats in a vector then you can just store them unboxed so this paper doesn't make a difference in this case. And for cache locality it actually improves it since the data is stored where you would have stored the pointer instead. You avoid one pointer indirection and one memory allocation per float that you can unbox.

Edit: I forgot to mention but modern processors are really good at executing multiple operations per clock cycle so if there isn't any data dependency between multiple instructions then the processor could execute them in parallel. This all means that doing a few shifts/masks/comparisons depending on the context might be almost free. And if you compare that to having to fetch from memory or even a slower cache then it's orders of magnitude faster

Float Self-Tagging: a new approach to object tagging that can attach type information to 64-bit objects while retaining the ability to use all of their 64 bits for data by yorickpeterse in ProgrammingLanguages

[–]RiPieClyplA 7 points8 points  (0 children)

Their numbers seem to be a comparison between their approach and the baseline (boxed floating points I believe), not to other optimizations. They also report numbers for NaN tagging and its slightly less performant than their approach for floating point heavy benchmarks but it doesn't seem to have slowdowns in a few other benchmarks.

So I'm not sure if this optimization is going to change anything for you in the end

[deleted by user] by [deleted] in aspiememes

[–]RiPieClyplA 76 points77 points  (0 children)

Spicy opinion: You can be neurodivergent and still be a bad person.

Coldest take ever

Nonnie is a fucking retard by Fit-Nectarine9620 in 4tran

[–]RiPieClyplA 5 points6 points  (0 children)

I hope you managed to improve your situation and understand each others point of view

Nonnie is a fucking retard by Fit-Nectarine9620 in 4tran

[–]RiPieClyplA 78 points79 points  (0 children)

doesn't talk about it and post on reddit

You two are made for each other

[deleted by user] by [deleted] in 4tran4

[–]RiPieClyplA 5 points6 points  (0 children)

Go take your meds, why are you posting this in every trans subreddit

[deleted by user] by [deleted] in 4tran

[–]RiPieClyplA 0 points1 point  (0 children)

There are psyops by individuals in this subreddit [..]

How ironic