kaushalmodi's recent activity

  1. Comment on How do you store your bookmarks? in ~tech

    kaushalmodi
    Link
    I use a paid service https://pinboard.in/. I cannot recommend it enough! By using it, I am not tied to a particular browser. My default browser is Firefox, and there's a good Pinboard Webextension...

    I use a paid service https://pinboard.in/.

    I cannot recommend it enough!

    By using it, I am not tied to a particular browser. My default browser is Firefox, and there's a good Pinboard Webextension add-on available for Firefox.

    It has a great search, ability to add custom searchable notes to bookmarks, and API too (so there are few Emacs packages for Pinboard too :)).


    Update: Oops, @calcifer already posted about this. Turns out, I had started writing this about an hour back, something came up, and then I just submitted this comment.

    7 votes
  2. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    (edited )
    Link Parent
    Some of my Nim projects are public; you can find them here. nbuild — This is a bash-script port. I am playing with adding TOML config file companion file to this script to streamline my local...

    Some of my Nim projects are public; you can find them here.

    • nbuild — This is a bash-script port. I am playing with adding TOML config file companion file to this script to streamline my local package builds. This is a rough translation of this bash script. At the moment, I have a separate bash script for dozens of apps that I install locally (it's not as simple as make && make install for all apps as I am on an old OS RHEL 6.8 without sudo rights). Plan is to have just this one nbuild binary do building for all the packages, while picking package-specific CFLAGS/LDFLAGS, build using make/go/cargoetc., whatever from that TOML config file.
    • noxhugo — Had I not known of Nim, I would have used bash for this one. This is what it does.
    • ntodo — I would have written this one in Python if I hadn't known of Nim. This is my latest project in Nim. If someone is using Todoist, and wants to try compiling a Nim project to see how to access their Todoist tasks from CLI, this is a good project :). The project is stable, but WIP i.e. I added API support for all Todoist project actions, and most task actions.
    2 votes
  3. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    Link Parent
    I haven't finished the book. I started reading it a while back and finished only a tiny bit of it (Section I: first 3 chapters). The reading experience was nice. It mainly corroborated what I...

    I haven't finished the book. I started reading it a while back and finished only a tiny bit of it (Section I: first 3 chapters). The reading experience was nice. It mainly corroborated what I already learned about Lisps in general by using Emacs Lisp.

    I think it's a good "Introduction to Lisp" book.. helps people familiarize with everything is a list concept, car, cdr, etc. (from what I read in the first 3 chapters).

    Now I need to find time to finish that book. At the moment, I am reading this awesome book on the history of some of the not-so-known typographical characters: Shady Characters.

    1 vote
  4. Comment on Nim: Deploying static binaries in ~comp

    kaushalmodi
    Link Parent
    I appreciate that comment. Thanks. This is the first time I spent some time in figuring out how to deploy binaries and also optimize them. So I write these posts to also serve as reference notes...

    Great post! I particularly appreciate how you take the time to explain things like your glibc problem, musl, and NimScript in a way that someone with very little knowledge could still follow.

    I appreciate that comment. Thanks. This is the first time I spent some time in figuring out how to deploy binaries and also optimize them. So I write these posts to also serve as reference notes for my future self :)

    Something I might add is a one-sentence summary of what UPX does.

    Done! See the footnotes references added for upx and strip in that section.

    PS: Here's Gitlab's CI tool: https://about.gitlab.com/features/gitlab-ci-cd/

    I am aware of the Gitlab CI tool, but only for Gitlab Pages deployment and such. It's not clear if and how Release Assets can be auto-uploaded to Gitlab as I do for GitHub for the template project hello_musl.

  5. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    (edited )
    Link
    While replying to a comment by @Jidairo, I'm also making this a top level comment for more visibility. Why I like the Nim language I started using Nim a few months back. I actually wanted to start...

    While replying to a comment by @Jidairo, I'm also making this a top level comment for more visibility.


    Why I like the Nim language

    I started using Nim a few months back. I actually wanted to start using it about two years back, but it never happened. But my return to Nim was a good step; this time I might be here for a while as I have started to understand the nitty-gritty details of the language, and starting collecting my notes on it.

    Here's why I think Nim is an awesome language:

    1. Syntax: It's beautiful. If you like Python syntax, you'll like this. In fact, it's much more concise, but not at the cost of readability.

    2. Static type check, with a sprinkle of type inference (only when assigning the initial value).

    3. Proc/operator overloading: Have procedures (functions) with the exact same identifiers handle different data types in their own way.. and the same with operators.

    4. Generics: You can use generics in procs, iterators, etc.

    5. Cross Platform: While I don't use Windows or macOS, I have known Nim applications to compile on those OSes too, in addition to GNU/Linux type OSes plus a few more like Raspberry Pi and types.

    6. .so object export: Nim can compile the code to binaries, but they can be compiled to just libraries (.so objects) too. Here's my experiment on how I write code in Nim to talk to Emacs (v25.1+) via the Emacs Module support. That allows me to run Nim-written code from Emacs Lisp (and even executing Emacs Lisp code from Nim). How awesome is that‽

    7. Support: Great support over Gitter, GitHub issues, Nim Forum, etc. Great devs! (though, I incorrectly thought earlier that that wasn't the case :))

    8. Makes me feel at home: Hacking/coding in Nim comes the closest to coding in Emacs Lisp. In Emacs, if I want to understand what a function does, I look at its source code. I can do the same in Nim (look at the source, hack it, tweak it, submit PR).

    9. Editor support: The nim-mode Emacs major mode and ob-nim Org Babel package are awesome!

    10. Documentation: Check out the Nim the index.html to search anything. There are also Devdocs for Nim.

    11. Whitespace: Tab not allowed, yay! (I know that many folks don't like that.)

    12. Package distribution: The nimble tool (equivalent of pip) works great for building/distributing Nim projects.

    .. and much more! Computer science experts can talk about more benefits of Nim from systems programming point of view (GC, etc.).

    As for my use case, I use Nim as Python/Bash replacement, CLI utility development, and it looks excellent so far!

    In plain terms, coding in Nim is pure joy :)

    3 votes
  6. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    Link Parent
    I didn't know Dr. Conrad Barski (of Land of Lisp fame) had this comic book for Emacs Lisp! Thanks for linking it. Skimming through it, I think that it's not designed to serve as Emacs Lisp 101. I...

    I didn't know Dr. Conrad Barski (of Land of Lisp fame) had this comic book for Emacs Lisp! Thanks for linking it.

    Skimming through it, I think that it's not designed to serve as Emacs Lisp 101. I think that the jump from here to here is too big for someone completely new to Emacs Lisp or Lisp in general.

    Based on my brief skimming through that site, I think that someone already with mild introduction to a Lisp dialect will surely enjoy it (I plan to through it in entirely this week).


    PS: The website is not very responsive (doesn't look good on mobile devices).. I wonder if I can convert that to a responsive version using Org mode + Hugo and ping the author about it..

    2 votes
  7. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    Link Parent
    I couldn't agree more! It looks like the people don't understand or want to understand the real language features, and so gang up on trivial things like tabs and spaces. Just accept that TABs are...

    I couldn't agree more! It looks like the people don't understand or want to understand the real language features, and so gang up on trivial things like tabs and spaces.

    Just accept that TABs are illegal characters in Nim and don't use them, or configure your editor to replace those, and move along.

    2 votes
  8. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    Link Parent
    This is a really good reference to help kickstart learning Elisp, as you don't need to devote too much time to finish it.. may be ½ hour or may be 1 (or something around that). Learn X in Y...

    This is a really good reference to help kickstart learning Elisp, as you don't need to devote too much time to finish it.. may be ½ hour or may be 1 (or something around that).

    Learn X in Y minutes - Emacs Lisp

    And then just keep on tinkering with your Emacs config, study published Emacs packages, passively follow Emacs help mailing list, (and/or the /r/Emacs subreddit, emacs.stackexchange.com).

    4 votes
  9. Comment on Nim: Deploying static binaries in ~comp

    kaushalmodi
    Link
    Deploying Nim applications as static binaries for GNU/Linux type operating systems, built using musl. The deployment happens automatically using Travis CI on GitHub repos. The post goes into...

    Deploying Nim applications as static binaries for GNU/Linux type operating systems, built using musl. The deployment happens automatically using Travis CI on GitHub repos.

    The post goes into complete detail on how to do the build and how to deploy with all the required code and a template git repo.

    2 votes
  10. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    (edited )
    Link Parent
    This is Nim; it is a statically typed compiled language. It's hard to imagine that you could arbitrarily move a block to any indentation and still have the code even compile. So much +1 this. I...

    Many times when working with Python I've had very hard to find bugs that blocked me for hours caused by moving a code into the wrong indentation level

    This is Nim; it is a statically typed compiled language. It's hard to imagine that you could arbitrarily move a block to any indentation and still have the code even compile.

    My favourite language is Emacs Lisp, and Lisp in general, because they just have the perfect syntax, and having something like Paredit means that you almost never fail when moving bits of code around. Sexps are just easy and good, I don't understand why more languages use them.

    So much +1 this. I love Emacs Lisp too, and I never get the "fear of parentheses". But if you put the indentation vs lisp preference aside, this language is worth exploring.

    They are better even when just used as syntax like braces and w/o homoiconicity. If not, just have C braces. They make the life easier.

    This is another polarizing preference (first one that I referred to another comment is this thread is tabs vs spaces). I like Lisp because all the closing parens pack up the end of the last form.

    With C/Perl type parens, the code becomes too ugly (IMO) too quickly as everyone has a different style of where to put the parens and they are not so good. With indentation-based blocks, Python solved this major problem, and I am glad Nim took it up.

    Another reason why I love Nim is the composability that I enjoy so much in Emacs Lisp.

    Here's an example (in Nim):

    let
      idxString = if withIndex:
                    fmt"{idx:>4}. "
                  else:
                    "  "
    

    Full Source

    Looks a bit familiar? (see psuedo equivalent version of this below, in Emacs Lisp) :)

    (let ((idxString (if withIndex
                         (fmt"{idx:>4}. ")
                       "  ")))
      ;; use idxString
      )
    
    3 votes
  11. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    Link Parent
    I find that amusing.. how would you know that everyone follows an unenforced style guide? :) I agree with @SleepyGary that once you have the compiler through an error, you need to straighten up...

    For example Crystal (another fairly new language) has a style guide that everyone follows.

    I find that amusing.. how would you know that everyone follows an unenforced style guide? :)

    I agree with @SleepyGary that once you have the compiler through an error, you need to straighten up your editor config or whatever to prevent that error in future. I have yet to see that Nim compiler error because of tab chars :)

    5 votes
  12. Comment on Nim: A Programming Language Underdog in ~comp

    kaushalmodi
    Link Parent
    This awesome, though polarizing, decision by the Nim team is one of the cherry on the top Nim features why I love it. Consistency + sanity. I have been through countless files (an example) where...

    just making spaces the recommended indentation style, they have made it a syntax error to indent with tabs, which is absolutely ridiculous.

    This awesome, though polarizing, decision by the Nim team is one of the cherry on the top Nim features why I love it.

    While this is a relatively minor issue I can't stand to use a project that thinks their stylistic choice is the only correct option

    Consistency + sanity. I have been through countless files (an example) where colleagues using tabs (mostly unknowingly) make reading code a horrible experience.

    Spaces are nice.. a space will always a space char wide whether or not the colleagues understand tabs vs spaces.

    (We can go back and forth on this forever.. tabs vs spaces is one of the eternal wars.)

    don't force people to use spaces. Your stylistic choices are just stylistic choices.

    If someone can get past this as an "issue", they might discover the beauty of this language.

    8 votes
  13. Comment on Syntax highlighting for the coders, invites for everyone in ~tildes.official

    kaushalmodi
    (edited )
    Link Parent
    Don't details and summary work? Testing .. This is summary. Click to expand. Here are more details. Update: Nope, it doesn't, sorry for that useless comment notification. Update 2: There's an...

    This comment contains CSS known to the State of Tildestia to cause frustration due to being a wall of text. Collapse this comment and consult a physician.

    Don't details and summary work?

    Testing ..

    This is summary. Click to expand. Here are more details.

    Update: Nope, it doesn't, sorry for that useless comment notification.


    Update 2: There's an issue tracking support for details/summary. If anyone is interested, please vote it!

    4 votes
  14. Comment on Syntax highlighting for the coders, invites for everyone in ~tildes.official

    kaushalmodi
    Link Parent
    Awesome! That's a Firefox (which is my default browser too) add-on too. I haven't ever used this add-on; will have a look. Thanks!

    Awesome! That's a Firefox (which is my default browser too) add-on too. I haven't ever used this add-on; will have a look. Thanks!

    5 votes
  15. Comment on Syntax highlighting for the coders, invites for everyone in ~tildes.official

    kaushalmodi
    Link Parent
    [text](http://url) **bold!** I wonder what happens if... ```md Meta ``` I wrote the above using: ````md [text](http://url) **bold!** I wonder what happens if... ```md Meta ``` ````
    [text](http://url) **bold!**
    
    I wonder what happens if...
    
    ```md
    Meta
    ```
    

    I wrote the above using:

    ````md
    [text](http://url) **bold!**
    
    I wonder what happens if...
    
    ```md
    Meta
    ```
    ````
    
    5 votes
  16. Comment on Syntax highlighting for the coders, invites for everyone in ~tildes.official

    kaushalmodi
    (edited )
    Link
    As an aside, can the font family not be enforced for code blocks? This is the current CSS, which sets the font to not-so-pretty Courier on my machine: code, kbd, pre, samp { font-family: "SF...

    As an aside, can the font family not be enforced for code blocks?

    This is the current CSS, which sets the font to not-so-pretty Courier on my machine:

    code, kbd, pre, samp {
        font-family: "SF Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Courier, monospace;
        font-size: 1em;
    }
    

    How about setting just font-family: monospace;. Then I can see the code blocks in my browser-default monospace font (Iosevka rocks!).

    12 votes
  17. Comment on Syntax highlighting for the coders, invites for everyone in ~tildes.official

    kaushalmodi
    (edited )
    Link
    Yay! import re proc word_count(str: string, re: Regex): int = ## Count the number of ``re`` regular expression matches in ``str``. echo str.findAll(re) return len(str.findAll(re)) echo...

    Yay!

    import re
    
    proc word_count(str: string, re: Regex): int =
        ## Count the number of ``re`` regular expression matches in ``str``.
        echo str.findAll(re)
        return len(str.findAll(re))
    echo word_count("Works for Nim too!", re"Nim") # 1
    echo word_count("Works for Nim too!", re"o") # 4
    

    Update: Well, it's a bit shabby for Nim, but not too bad.

    8 votes
  18. Comment on What are some of your favorite RSS feeds to subscribe to? in ~tech

    kaushalmodi
    Link Parent
    I use https://www.newsblur.com/. It works great on web and Android (and I believe, iOS too).

    I use https://www.newsblur.com/. It works great on web and Android (and I believe, iOS too).

    3 votes