**Language features**

[Support for nested types](https://github.com/nim-lang/Nim/issues/7449) and 
[support for cyclical imports](https://github.com/nim-lang/RFCs/issues/6) would 
be huge boons for library wrapping.

The `range` keyword [has some issues and could be 
improved.](https://status-im.github.io/nim-style-guide/language.range.html)

**Standard library**

There is great community support for [interoperability with 
Python](https://github.com/yglukhov/nimpy), and good support for [generating C 
wrappers](https://github.com/nimterop/nimterop). It would be interesting to 
have first-party support for them - although maybe they're better off as 
external libraries.

A hefty amount of modules have clunky names, for example:

  * Python's `os.walk` vs Nim's `os.walkDirRec`
  * `ansiBackgroundColorCode(c: Color)` from `terminal` (especially as this is 
designed to be used often, like ANSI codes)
  * `parseHexInt` and `parseHexStr` from `strutils`



**Superficial syntax changes**

I really dislike `%*` as the JSON operator.

  * It's not readable or intuitive.
  * JSON is not used enough to justify such a cryptic operator (unlike `$` for 
string conversion).
  * `json()` would be clearer, at the expense of +4 characters per usage.



I also don't like `*` as the public marker.

  * It's not readable or intuitive.
    * A newcomer to Nim will have no idea what `*` does when stumbling across 
it the first time in a codebase. (the rest of Nim's syntax, by comparison, is 
very straightforward.)
  * `pub` or variants (`public`) are standard across many, many languages.
  * `*` has strong associations with pointers.
    * This can be confusing for a language that is as close to C as Nim is.



I think `pub` would be much better. However, it does have some inconsistencies 
in block statements.
    
    
    # Current behavior (with `*` as the public marker)
    proc exportedEcho*(s: string) = echo s
    proc `*`*(a: string; b: int): string =
      result = newStringOfCap(a.len * b)
      for i in 1 .. b:
        result.add a
    
    var exportedVar*: int
    const exportedConst* = 78
    type ExportedType* = object
      exportedField*: int
    
    type
      ExportedBlockType* = object
        exportedField*: int
    let
      exportedBlock*: int
      unexportedBlock: int
    
    
    Run
    
    
    # With `pub` as the public marker
    pub proc exportedEcho(s: string) = echo s
    pub proc `*`(a: string; b: int): string =
      result = newStringOfCap(a.len * b)
      for i in 1 .. b:
        result.add a
    
    pub var exportedVar: int
    pub const exportedConst = 78
    pub type ExportedType = object
      pub exportedField: int
    
    type
      pub ExportedBlockType = object
        pub exportedField: int
    let
      pub exportedBlock: int
      unexportedBlock: int
    
    
    Run

Reply via email to