10 ms·
The Senegal Programming Language
- Calamity210 5y agoI was wondering where all the traffic on the repo was coming from after months of inactivity lol. Most comments (so far) are asking "why?". Its honestly a fair question, what does this language offer that others dont? Nothing really, this project isn't anything serious I just wanted to have some fun with it. Regardless, I'll put up a why section.
- mcdonje 5y agoWhy is it called Senegal?
- Calamity210 5y agoI've got a Senegal parrot (hence the pixel art) and im bad at naming things and...the rest is history i guess
- mcdonje 5y agoNot a bad name or reason. Thanks for sharing.
- johnisgood 5y agoMight be off-topic but how did you get notified about the high traffic? If my website had a high traffic I would not notice at all. I do not feel like writing a script to notify me either.
- Calamity210 5y agoDiscord webhooks with GitHub, a lot of people were starring(?) it on github
- brundolf 5y agoNothing wrong with that! The world would be a lot less interesting if every project were useful
- mastrsushi 5y agoWhy?
- miohtama 5y agoI have the same question. The documentation does a good job presenting the language, but not the motive or sweet spot use case.
- codefined 5y agoFrom 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 https://news.ycombinator.com/newsguidelines.html
- miohtama 5y agoNo, 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 5y agoThere's a Discord where you can probably get the answer to your question: https://discord.gg/9dq6YB2 https://discord.gg/9dq6YB2
- TeMPOraL 5y agoOfficial 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).
- Apocryphon 5y ago
- Zababa 5y agoAs 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/ 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 https://lang-senegal.web.app/docs/cimport - you can "enhance" (monkey patch?) classes: https://lang-senegal.web.app/docs/enhance 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 https://lang-senegal.web.app/docs/pipeline - the reference to "switch statements" probably means that switch and if are statements, not expressions
- 1MachineElf 5y agoSupport for Windows, MacOS, and Linux is also a plus.
- pansa2 5y ago> Senegal is compiled and Wren is interpreted Senegal seems to use a bytecode interpreter: https://github.com/SenegalLang/Senegal/blob/22fe863ad234e43ab25a5328bf8e6bd6a189331b/src/svm.c#L1531 https://github.com/SenegalLang/Senegal/blob/22fe863ad234e43a...
- codefined 5y agoI'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 https://lang-senegal.web.app/docs/enhance [1] https://portswigger.net/daily-swig/prototype-pollution-the-dangerous-and-underrated-vulnerability-impacting-javascript-applications https://portswigger.net/daily-swig/prototype-pollution-the-d...
- Zababa 5y agoThe "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 5y agoThere 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.
- crabmusket 5y agoThis may be apocryphal, but I thought JS's `Array.includes` method was so-named when it was added to the spec to avoid conflicting with popular libraries that were adding a `contains` method to the Array prototype. In order to avoid conflicting and breaking existing sites, a less-common name was chosen for the spec.
- Zababa 5y agoThat was the case with Array.prototype.flat, that was supposed to be Array.prototype.flatten but flatten was already used by MooTools, and they respected the "don't break the web".
- beaconstudios 5y agoso 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 5y agoI'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 https://www.brandons.me/blog/the-bagel-language
- Zababa 5y agoI 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".
- Kinrany 5y ago> To get down to brass tacks: Bagel will be a statically-typed, JavaScript-targeted language. It will keep many of the same syntaxes and semantics as JavaScript/TypeScript, except where there's significant benefit to breaking away from them. It will involve lots of nice little refinements and additions to the JavaScript paradigm, but it's mainly driven by two key ideas, which are really what make the whole project worth doing in my opinion: > 1. A hard, enforced separation between stateless functional code and stateful procedural code > 2. Reactivity as a first-class citizen Hell yes, I'm in. These two features are interesting enough to try by themselves, I don't even care about the details. The next most important thing is that JS/TS FFI just works, so I really hope it does.
- nemoniac 5y agoWhat is a "modern" syntax?
- karmakaze 5y agoSmall 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.
- Shadonototra 5y agoSenegal is the name of a country
- eyelidlessness 5y agoJava is the name of an island in Indonesia. C# is a note commonly used in 12-tone chromatic scale. Ruby is a gemstone. Bash is a violent action. Racket is a fraudulent scheme, which…
- Shadonototra 5y agoand so what? it's not the same as using the name of a prominent country it's disrespectful, stupid, and won't help you for SEO or searchability anyways they probably looked for name of birds and stopped there, uncultured
- Calamity210 5y ago(Mind blown) Maybe try asking before making a fool out of yourself lol. https://news.ycombinator.com/item?id=28823129 https://news.ycombinator.com/item?id=28823129
- Shadonototra 5y ago> they probably looked for name of birds and stopped there, uncultured ^ look what i wrote
- eyelidlessness 5y agoWhy is it disrespectful? Or “stupid”? What SEO benefit do you think any project expects to get from choosing to share a name with any country?
- Shadonototra 5y agoi find this incredible that i have to justify and explain why it is
- Lerc 5y agoI'm curious as to why they have 'this.' to access class fields. JavaScript uses this because the architecture for accessing fields predates the existence of classes (even then I feel it should be extended to allow fields be accessed without 'this.' if the field and usage exist within the same class definition.) Surely a compiler should be smart enough to not require a 'this.' if the name is in the scope of the class and not hidden behind something like a parameter with the same name.
- eyelidlessness 5y ago> JavaScript uses this Python goes one further and requires you explicitly name your this (commonly self) as a parameter. Which is one thing I particularly like about Python, as it’s clear class instance methods are just sugar over plain functions/routines without any magic. I find the Java-style name resolution that doesn’t require qualification utterly confusing. It would be especially weird/probably a footgun in a JS-like language where functions are frequently used as values and where their names can be shadowed locally.
- zarzavat 5y agoI dislike implicit 'this' immensely. It is very common for local variables to shadow instance variables, e.g. in a constructor. Habitual use of shadowing can lead to bugs, for instance if you mistype a local variable declaration a later use of the intended name might default to the instance variable. Ruby is my favourite with @foo, it's concise but explicit. Because of this, languages with implicit this tend to have a convention such as "instance variables must start with an underscore", which is just a poor man's sigil. Here's an example: In early versions of Swift, using print("hello world") in a UI class would open a print dialog, because it dispatched the print: instance method on NSView, instead of the global print function.
- deleted 5y ago[deleted]
- ford_o 5y agoMistyped variable will lead to unused variable warning. The swift example is problem of API, not shadowing.
- rustycc 5y agoWhy writing a 2021 language in C, instead of Rust?
- nlitened 5y agoTwo reasons: - If the author already knows some language well, it’s rather inefficient to master another language just to create a new one. - Rust is likely to be relevant for 11 more years, C is likely to be relevant for 43 more years. Things that have existed for a long time, tend to keep existing longer.
- LordRishav 5y agoI hugely despise the Rust-like Code of Conduct. Also please provide actual build instructions instead of giving binary files to add to PATH and execute.