Re:How to implement strings
by SquishyPanda23 on Saturday November 03, 2018 @05:58PM
(#18372714)
> Programing languges are the basic foundation which should be concerned with performance , organization and making sure freedom is given to the programmer.
This is one view, but there are others. For example, instead of focusing on performance and freedom, the programming language could focus on safety or formal properties.
E.g. there should never be code that compiles but is unsafe, or which can have certain classes of common bugs.
Re:How to implement strings
by matthewmacleod on Saturday November 03, 2018 @07:47PM
(#18373140)
That’s a valid view, but it would definitely be powerful if the language’s type system could express restricted character sets, right? You can already do something like this with e.g. Ada’s constrained subtypes, like encoding the length of a string or the range of a number into the type, making it statically impossible to accept invalid input. That’s really cool!
Would you rather they speed up the compiler/interperter or add edge case string classes? Its not like there isnt a trade off. This is a bottom of the barrel concern.