Hacker News new | ask | show | jobs
by photon_off 2299 days ago
I would like to be able to delineate strings with any character(s) of my choosing. The default could be single or double or triple quotes, but don't force me. I am sick of escaping characters in literals, I'd rather define a delineator that I know isn't in the string. Same for templating.

   let name = "Jane";
   let str = s{}:John said "Don't do that, {name}!":s
I would also like a JSON-like shorthand for declaring nested structures, without having to define each individual component separately. Eg:

   struct Person {
      user: {string name, int age},
      address: {string street, ...}
   }
   let p = new Person(<json>);
   print(p.user.age);
Convenience with arrays (python slicing is nice), maps, and primitive types pay huge dividends.

   arr.first();
   arr.last();
   arr[5,-5];  //5th to 5th to last
Built-in arbitrary length/precision numbers would be neat.

Besides that, tons and tons of useful libraries: IO, Date, JSON, DB Bindings, etc.