nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to native code and Go
https://nevalang.org
MIT License
85 stars 7 forks source link

Multiline Comments #634

Open dorian3343 opened 1 month ago

dorian3343 commented 1 month ago

Title is self explanatory, we're missing multi line comments.

Example

/*
 . . . 
*/
emil14 commented 1 month ago

Honestly I intentionally didn't add it because I failed to see why need it. I personally never use this.

There's a shortcut for // in any IDE which isn't the case for multi-line comment. Also bunch of one-liners can do the same thing. E.g. I think I almost never see multi-line comments in Go, even tho sometimes comment sections are very big.

Could you please describe your opinion on this? What is the use case for multiple-comment? What it adds that's impossible with //?

dorian3343 commented 1 month ago

Ive been thinking a lot about how automatic documentation should work and how we could implement it, this all started because of #620 (which I think we should implement as the basis for the documentation website)

Heres how it could look

/*Description:
  Comp description of what it does etc
/*Authors:
 Authors of component
/*
/*Examples:
 Examples of the comp
/*

// and more

component Foo(start any) (sig any){
  // Component definition
}

This should also be plugged into the LSP

ArvinSKushwaha commented 1 month ago

Counterpoint, the asterisks add a lot of visual noise that could be avoided by blocks of single-line comments, like those most commonly used by Rust for docstrings.

/// This is my documentation for a struct [`ABC`]
struct ABC {
    /// This is my documentation for [`x`]
    x: u32,
}