• 0 Posts
  • 30 Comments
Joined 1 year ago
cake
Cake day: July 4th, 2023

help-circle
  • For small projects, rewriting is often superb. It allows us to reorganize a mess, apply new knowledge, add neat features and doodads, etc.

    This. I’m coding to contribute to a open-source software with very small amount of coders, and with a non-mainstream Domain-Specific Language. A lot of the code I did before has been proven to work from times to time, but they all could benefit from better outputs and better GUI. So, I end up reengineering the entire and that’ll take a really long time, however, I do a lot of tests to ensure it works.








  • It’s a bit of a pain to finish, but I’m basically working on creating an array of numbers to assist in sorting unicode characters, and I’m making string processing commands for the G’MIC scripting language. So, that means by hand, I have to sort hundreds of thousands of characters, and I sorted tens of thousands of them already. I already did string_permutations and you can find string_permutations at index or find index which that permutation can be found. However those commands needs the array of numbers for an additional sorting option I’ll do.



  • Chances are there’s probably something similar to dictionary in Python in your languages or at least it’s a import/#include away. Although I don’t use general programming languages at all, in my used language (G’MIC), I do something like dict$var=input where $var is a defined variable, and this way I can access input by doing ${dict$var} and that’s similar to Python dictionary. In C++, there’s hash table implementation out there via github. That being said, there are sometimes when you don’t need a hashtable dependent on the hashmap, and sometimes, it’s just as simple as basic mathematics to access data.







  • Every languages has their own pitfalls. The answer on picking a language is to pick whatever works for you. There may be even domain-specific languages if you’re interested in a domain, and it can be way more flexible than general-purpose solutions for that domain too.

    I use 4 languages.

    1. C++ for adding features to a program.
    2. C# for making .dll for an application (Paint.NET). Kinda similar purpose to what I do with G’MIC, except so much more limited.
    3. Python for processing strings
    4. G’MIC for creating/editing raster graphics images (volumetric too)

    Now, I wish there was a vector equivalent to G’MIC, but there isn’t.



  • Here’s my opinion, a well-developed DSL could even be arguably more flexible than say Python even with existing libraries on their specific domains. So, if one is just limited to domains, they may be very well be preferable to general languages.

    I have coded in C#, Python, C++, and currently nearly everyday, G’MIC. Which one of those are a DSL? The last one. What it is? It’s a Domain-Specific Language that has been geared toward raster graphics image processing. Why do I use it? Looking at the stack-based processing, commands, built-in mathematical functions. It seems that it has a lot more things that are built-in than say Pillow library for Python and other things. And I only do create images with code, so I am happy with this, and I even did things like Python itertools combinatorics with more things like rank2list/list2rank variation of those combinatorics which aren’t image processing by themselves, but can aid to it.

    If I feel that it is way too limited for that Domain, then I wouldn’t use it. DSLs are only good if the other options are much more difficult to build with and their flexibility are often enough to entice their audience which is one with limited use cases. Of course, generic languages are usually better even than most DSL even within their domains because of wider support, and wider audience. More DSLs would be better than generics given enough time and support for their domains in my opinion.


  • From some one who used Python as it was the easiest solution to few of my problems, and having to experience languages with brackets and/or endif/fi/done as ways to limit scope, I find that having things like brackets and/or scope terminators easier to parse and less error-prone. I’m thinking about moving on to Ruby whenever I had a need where Python would be a good choice, but the time it takes for me to understand a new language is blocking me from that.