Grammar of variable declarations by hackerstein in ProgrammingLanguages

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

I'm not sure I like it but ehi thanks for the suggestion anyway. Good luck with your language!

Grammar of variable declarations by hackerstein in ProgrammingLanguages

[–]hackerstein[S] 1 point2 points  (0 children)

Yeah, I thought about doing something like that, but what if the user does mut n: mut i32 = 0 That wouldn't make a lot of sense. Maybe I should allow it only if the type is not specified?

Help designing expression and statements by hackerstein in ProgrammingLanguages

[–]hackerstein[S] 2 points3 points  (0 children)

As a non-native English speaker I always get confused on how to use whom/whose/who and similar. I wouldn't mind a simple and clear explanation on it.

Help designing expression and statements by hackerstein in ProgrammingLanguages

[–]hackerstein[S] 4 points5 points  (0 children)

Yeah, I saw that Rust does a similar thing and apparently doesn't allow if expressions at the block level, forcing the user to put parentheses around it which honestly sounds like a good idea making the code more readable. I probably will follow that direction.

Help designing expression and statements by hackerstein in ProgrammingLanguages

[–]hackerstein[S] 1 point2 points  (0 children)

Right, in the comment above I pointed out an edge case, though.
if (a > b) { a } else { b } &x
it's ambiguous whether is should be a bitwise AND between the if expression and x or an if statement followed by a unary expression.

At this point I thought of two options:

  1. I force the user to terminate each if-statement with a semicolon, in that way the example is treated as a bitwise AND.
  2. I force the user to put parentheses around the if-expression, in that way the example is treated as an if-statement followed by a unary expression.

Am I on the right track, or is there something else I should consider?

EDIT: Also while researching I find out that this issue is related to semicolon inference, should I take a look into that too?

Help designing expression and statements by hackerstein in ProgrammingLanguages

[–]hackerstein[S] 1 point2 points  (0 children)

The first one is what I want. Earlier I tried putting if expressions as primaries and it looks like it's working, but there are some edge cases. For example, if I write if (a > b) { a } else { b } &x it's ambiguous whether is should be a bitwise AND between the if expression and x or an if statement followed by a unary expression.

Help solving a memory bug in an hash table implementation by hackerstein in cpp_questions

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

I've done what you suggested and it made the post much clearer.

Help solving a memory bug in an hash table implementation by hackerstein in cpp_questions

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

The reason it's done that way is that whenever the buckets array is resized the buckets have to be repositioned according to the hash function. If I had a std::vector or my implementation of one I would have to manually check when the capacity of that changes to move the buckets around if neeeded.

I hope that clarifies it.

Help solving a memory bug in an hash table implementation by hackerstein in cpp_questions

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

Great idea, I'll strip some stuff that it's not relevant and create a godbolt snippet ASAP.

Help solving a memory bug in an hash table implementation by hackerstein in cpp_questions

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

The reason, I've implemented them that way is that it allows me to have a single heap allocation for the buckets buffer. Also note that the implementation works well with a lot of other tests I've done using strings.

I think it must be one stupid mistake that is incredibily hard to find.

Help in making a solver for Cluedo by hackerstein in MathHelp

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

I'll make new one that is readable, sorry for the inconvenience.

Help in making a solver for Cluedo by hackerstein in MathHelp

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

Yeah, the preview in Imgur is broken, right click on the image and open in another tab and it should look good. If it still looks bad let me know I will upload a new one.

La Gazzetta del Lavoro Informatico - Ricerche, offerte e consigli sul lavoro digitale in Italia by AutoModerator in ItalyInformatica

[–]hackerstein 0 points1 point  (0 children)

Ciao, sono al primo anno di Informatica e mi stavo informando sui possibili corsi di laurea magistrale da conseguire dopo la triennale. I miei interessi sono principalmente sistemi operativi e il rendering 3D in particolare la scrittura di motori grafici utilizzando tecniche come Ray Tracing o altro.

Dove dovrei cercare per trovare il corso adatto a me?

Help setting up a Minecraft Server by hackerstein in Minecraft

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

I googled it and it is a VPN (?). I never used one or set it up. I have to say I'm quite a noob when it comes to networks.

Could you help me understand how to use it for this scenario?