[HN Gopher] Senegal Programming Language
       ___________________________________________________________________
        
       Senegal Programming Language
        
       Author : pionerkotik
       Score  : 35 points
       Date   : 2021-10-10 20:37 UTC (2 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | Zababa wrote:
       | As always, all languages, especially the new one, should have a
       | "why" section. Small caveat: maybe it's still under construction
       | and the person that posted it just found it too early. But once
       | you're ready to show it to the world, please include the why!
       | Note that anything is valid in the "why", even "just for fun" or
       | "because I could". For now there is:
       | 
       | > Senegal is a powerful, small-but-fast, concurrent, class-based,
       | and dynamically-typed programming language with a modern syntax.
       | 
       | I think the closest thing to it is Wren? https://wren.io/. The
       | difference being that Senegal is compiled and Wren is
       | interpreted.
       | 
       | A few things of interest:
       | 
       | - there are exceptions
       | 
       | - you can call some C code: https://lang-
       | senegal.web.app/docs/cimport
       | 
       | - you can "enhance" (monkey patch?) classes: https://lang-
       | senegal.web.app/docs/enhance
       | 
       | - classic C-style for, while, switch keywords
       | 
       | - there's a pipeline operator, but it's <| https://lang-
       | senegal.web.app/docs/pipeline
       | 
       | - the reference to "switch statements" probably means that switch
       | and if are statements, not expressions
        
         | 1MachineElf wrote:
         | Support for Windows, MacOS, and Linux is also a plus.
        
       | codefined wrote:
       | I'm not sure I'm a fan of the 'Enhance' concept[0]. It seems to
       | be similar to prototype Pollution in JavaScript[1] which is
       | generally considered bad practice. I can't tell, is `Enhance`
       | scoped to the current context? Or does it affect all of that type
       | throughout the rest of the program?
       | 
       | [0] https://lang-senegal.web.app/docs/enhance [1]
       | https://portswigger.net/daily-swig/prototype-pollution-the-d...
        
         | Zababa wrote:
         | The "enhance" seem to be monkey patching, which is a common
         | practice in dynamic languages. Prototype pollution is when
         | malicious people use monkey patching to introduce
         | vulnerabilities.
        
           | codefined wrote:
           | There are non-malicious issues related to prototype
           | pollution. The most recent that comes to mind are packages
           | overwriting each other. How do you handle two enhances that
           | add the same function name? In JavaScript the second
           | overwrites the first, which can cause issues if the functions
           | do different things.
        
       | karmakaze wrote:
       | Small suggestion: The 'docs' link in the README should link
       | directly to /docs rather than a place that shows less than where
       | I came from.
       | 
       | Reading through the docs I was wondering 'why' as mentioned in
       | another comment. I hoped to find it in the concurrency section
       | and was disappointed to see that it's only single-thread async:
       | 
       | > Coroutines are light-weight thread-like objects allowing you to
       | write asynchronous non-blocking code as well as handle errors in
       | Senegal. The key difference between threads and coroutines is
       | that a program with threads runs several threads concurrently,
       | whereas coroutines run a single coroutine and cooperatively. A
       | coroutine is not paused so that control can be given to another
       | unless and until you tell it to.
       | 
       | There still was a section about C interfacing, but many languages
       | do that. In the end, it seems to be about syntax which is the
       | least interesting thing about a language. What can a new language
       | do that an existing one doesn't do well? If it's a hobby project
       | that's well and good. Only wasn't clear what the
       | intentions/target is from the too brief README.
        
       | nemoniac wrote:
       | What is a "modern" syntax?
        
         | Zababa wrote:
         | For this one, JavaScript. For statically typed programming
         | languages, it usually means ML-style type declaration, that
         | TypeScript uses too.
        
           | smegcicle wrote:
           | and anything with significant-whitespace would ofcourse be a
           | "post-modern" syntax
        
       | beaconstudios wrote:
       | so many new programming languages come out that are almost
       | identical to existing ones. Where's the crazy ideas (aside from
       | the esoteric languages, which are different because they're
       | intentionally difficult). I'd love to see more entries in the
       | areas other than OO or procedural languages (or even just a
       | variation on those, like an actor-model language). There's so
       | many ideas in the programming language theory space that deserve
       | a swing.
        
         | brundolf wrote:
         | I'm working on one! It's not ready to be shown off yet, but I
         | outlined the core ideas here: https://www.brandons.me/blog/the-
         | bagel-language
        
           | Zababa wrote:
           | I only read the beginning as it's pretty late for me, but I
           | like the idea, and it innovative. I think you also did a
           | great job at converting quickly the "why".
        
       | mastrsushi wrote:
       | Why?
        
         | miohtama wrote:
         | I have the same question. The documentation does a good job
         | presenting the language, but not the motive or sweet spot use
         | case.
        
           | codefined wrote:
           | From the guidelines[0]:
           | 
           | > Please don't post shallow dismissals, especially of other
           | people's work. A good critical comment teaches us something.
           | 
           | [0] https://news.ycombinator.com/newsguidelines.html
        
             | miohtama wrote:
             | No, it is actually good feedback. Any project should have a
             | good background page why they sre being build, by who and
             | with what expertise.
        
           | 1MachineElf wrote:
           | There's a Discord where you can probably get the answer to
           | your question: https://discord.gg/9dq6YB2
        
             | TeMPOraL wrote:
             | Official Discords/Slacks for programming languages should
             | be considered an antipattern - especially if they end up
             | replacing documentation or a discussion group.
             | 
             | It's as if the new generation of developers doesn't realize
             | the difference between transient conversations (which is
             | what happens on Discord/Slack) and creating knowledge
             | (which needs to be persistent and searchable, neither of
             | which is afforded by aforementioned chat services).
        
               | brundolf wrote:
               | The above are persistent and searchable, unless you're
               | using the free version of Slack which sets a limit on
               | persistence
               | 
               | But regardless, my experience is that once languages
               | reach a critical mass they do get real documentation in a
               | more browsable format. And I think Discord is a totally
               | valid temporary solution for documentation, and a totally
               | valid replacement for discussion groups.
        
               | Apocryphon wrote:
               | Did programming language projects utilize IRC channels in
               | the past?
        
               | TeMPOraL wrote:
               | They did. Some software tooling still does. It's still an
               | antipattern if it replaces documentation.
               | 
               | This applies to communities in general (on-line and off-
               | line). Knowledge needs to be captured outside of the
               | minds of select participants. It's e.g. why, in our local
               | Hackerspace, I always insisted on the rule that anything
               | said on IRC (or later, Telegram) is non-binding - the
               | only things that matter are ones decided on the mailing
               | group or documented on the wiki. To do otherwise is to
               | force out everyone who can't keep pace with the common
               | chat.
        
       ___________________________________________________________________
       (page generated 2021-10-10 23:00 UTC)