There's no value in a String type if it doesn't behave for text. One can simply use a "Array<char>" to convey proper semantic meaning.
156 karma · joined June 11, 2012
There's no value in a String type if it doesn't behave for text. One can simply use a "Array<char>" to convey proper semantic meaning.
It can additionally be an indication as to whether regular expression matching works, though that is usually handled by a library, and not the core string types.
My contention was always that if a "string" does not reverse text, then it's no better than an "array<char>". The existence of a "string" type implies it should do more.
Alas, I might have to wait, as I tend to use Python 3.8 and it's not supported yet -- though mainly I use it for types, it might actually run in 3.7
Had I wanted to make a game from the start I would most certainly not have made a language first! That would be crazy. And that's my comments about sunk costs -- just because I have Leaf, it'd still be crazy to do this other projects in it.
I saw that migration guide, but it has very few details about what is actually involved in migration. It doesn't include API change details.
It's not like I'm going to decide to write a new 20k line library for my project, but if something is only a few hundred lines of code it's definitely easier to just rewrite.
I'm uncertain of what you mean with "copying the data over" in reference to large data. Surely it's still just the pointer being copied? Or are you speaking of things like `std::vector` in C++ that are value-copied by default?
When I cosnider tracing GC my primary arguments against it have nothing to do with performance at all, yet it often comes up as an argument against my position. This article is attempting to address that critique, by saying I doubt you could compare the two directly.
I don't consider dead objects, where the memory is not longer used and free to be allocated, to be part of the allocated memory.
Most places I see talking about reference counting just say reference counting, sometimes mentioning memory management. Automatic memory management is perhaps the most generic term.
How reference counting actually works is covered in my previous article, which I wrote as a lead-up to this one. It covers the particulars of how memroy coherency is the primary cost of reference counting.
I've added a section to the article with a more correct snapping function showing the issue more clearly (I hope).
Interesting is that print can show an exact representation of any floating point value, but of course 0.1 can't be represented exactly.
Your point about floating point not having exact values is precisely the issue, and that is what my added example tries to demonstrate. My previous article, linked from the intro, about floating point tries to cover that aspect a bit more.
http://mortoray.com/2015/07/06/essential-facts-about-floatin...
Numbers will end up slightly lower or higher than an expected value simply due to accuracy in calculations and minor differences in input.
For example, suppose we have two UI elements, one with a width of 80% and the other expressed as a factor as 0.8. Depending on how specifically these are parsed and processed this may result in slightly different values. For the user creating the UI however they'd expect the same result.
The epsilons I introduce into my floor/ceil code is meant to deal with these minor variations.
It's hard to show concise examples that truly show how this little bit of error eventually compounds and destabilizes a calculation.
I agree there are ways to avoid that problem, but the general issue of truncation across storage/calculation I think remains an important concept.