Hacker Newsnew | past | comments | ask | show | jobs | submit | cjs_2's commentslogin

But not the default.


Are you sure about that? Certainly at least some of the synced information is encrypted before sync by default (passwords).


How many updates per month are you expecting for a package like this?


Multiple times a day, like radare2. Seriously, if there is no activity in 6 months - then the project is dead.


This is a lexical highlighter that tries to highlight similar, but different text differently. There's a point in time where there are no new features necessary.

radare2 is a portable reversing framework. I can't think of 2 projects more dissimilar. Perhaps you were thinking that the highlighter actually did something other than color text in an arbitrary way? Can you give an example of something that you would expect to change about it, especially at the rate of multiple times a day?


Isn't this more due to automatic type coercion in the language and not from the lack of types?


It's conversion, not coercion. Coercion is what C does to crash programs.


How could one think about functions differently than about what their input and output is?


Your statement is just a tiny bit too general and that's where you're missing.

"What about their input and output is" => "what type their input/output is"

The next question is what does the type of the input/output actually tell you about the input/output? In the most popular languages (using interfaces), it basically tells you that the input/output might have a, b and c set (or they might be null), and it could also have anything else set.

So the actual information you have is that you might or might not have (a,b,c) and also might or might not have (anything). Not as foolproof as you think. The natural objection is that aha! I defined this class to require (a,b,c) in the constructor and do a nullity check, so I know much more than this! But this is back to having "types in your head", that constructor signature and nullity check isn't compiler enforced (as in if you change it, nothing will fail in the typesystem at the point of the function that we're checking, as long as those fields remain on the class). So the useful part of the static typing is actually living in your head either way.


What would you suggest using instead? The actual (void *) 0?


In C++, nullptr.


And in C?


In C, always use 0 and check for 0, it's the only safe way. For C++, it depends on the standard you're using.


Except when calling a varargs function, when you need to cast to the correct pointer type


But 0 isn't always null right?


Literal zero in a pointer context is interpreted by the compiler to mean "the null pointer." The compiler then compiles the null pointer into the code.


But then how do you get a pointer to zero (not null) in those systems?


First, that's inherently non-portable. That aside...

On most systems, the null pointer happens to be a pointer to address zero. For other systems, e.g. 8086 16-bit mode, you can create a intptr_t (which is the same size as a pointer) and set it to zero. Then cast it to a pointer. Such casting is always done bitwise, so it will work.

The compiler knows to turn the following into the null pointer

  void *p = (void *) 0;
but the compiler will NOT turn the following into a null pointer

  void *p = (void *) (uintptr_t) 0;
because the literal 0 is now in an integer context, not a pointer context.


BTW 0 is a valid literal value of a pointer type (so you do not need a cast).


Thank you!


Prior to nullptr, generally I used literal 0. In those cases which require disambiguation, I used (void * ) 0.


In C++ it'd be nullptr.


Which RFC is this?



It should be the job of the environment. While i agree about learning general skills, Let's face it that Unix commands just aren't discoverable outside of the curated list by a teacher or other resource.


I know of Dyon [1] as an embbedable scripting language written in Rust.

1) https://github.com/PistonDevelopers/dyon


Dyon is built to work really well as a scripting language for the Piston game framework written in Rust. I was just looking at it.

I'll need to compare and see if Gluon can be leveraged in any way.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: