Re: candidate of add. language in src (not rust)
- In reply to: Bakul Shah : "Re: candidate of add. language in src (not rust)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Sep 2025 21:24:52 UTC
Bakul Shah wrote in
<92AA5267-EB11-4514-BB79-6B64FC2CC309@iitbombay.org>:
|On Sep 20, 2025, at 12:56 PM, Vadim Goncharov <vadimnuclight@gmail.com> \
|wrote:
|> On Sat, 20 Sep 2025 11:37:44 -0700
|> Bakul Shah <bakul@iitbombay.org> wrote:
|>> On Sep 20, 2025, at 9:00 AM, Vadim Goncharov <vadimnuclight@gmail.com> \
|>> wrote:
|>>> it has e.g. immutable strings so it is not very free from boilerplates.\
...
|> Consider not even Shell, but e.g. sed, awk or Perl. It's very easy \
|> in them to
|> write replacing a part of string, like s/foo/bar/ or appending/prepending
|> something to string. It's very common is scripts (and Makefiles, \
|> which also
|> could be considered high-level scripting language) to write such, \
|> but tedious
|
|Immutable strings simply means you can't index and replace a char
|but you can use regex or append/prepend and assign to the same var.
|For ex, x = "pre-"+x+"-post". Its string library is similar to Go's.
|Much less error prone or fiddly than C's.
You *can* create a string object in C, with a nice and beautiful
interface to do stuff.
Of course it sucks to compare
while(_tr.readLine(*&_line) >= 0){
ln = _line.trim().squeeze().data();
with any thinkable C myprefix_mystring_myfun(mystrobj,) cascade.
However, having seen some V lang intro page today, i would then
"using namespace XY;" and original things suddenly look much nicer.
(Having said that, at times i do not even understand modern C++.
To me "auto" means "i want that to live on the stack", etc etc.
That stupid i am. 'Nuff said. (I long for C+.))
...
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)