GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:51 JST mcc mcc

    #BabelOfCode 2024
    Week 5
    Language: TCL

    Confidence level: Medium high

    PREV WEEK: https://mastodon.social/@mcc/113906616486081430
    RULES: https://mastodon.social/@mcc/113676228091546556

    TCL is an odd language. I think anyone who's tried developing a programming language has probably at some point thought "what if I just didn't bother with types and did all operations as string transformations?". I think TCL is just that language.

    Officially, TCL is supposed to be capitalized "Tcl". I will not be complying.

    In conversation about 4 months ago from mastodon.social permalink

    Attachments

    1. No result found on File_thumbnail lookup.
      mcc (@mcc@mastodon.social)
      from mcc
      #BabelOfCode 2024 Week 4 Language: FORTRAN Confidence level: High PREV WEEK: https://mastodon.social/@mcc/113867584791780280 NEXT WEEK: https://mastodon.social/@mcc/113975448813565537 RULES: https://mastodon.social/@mcc/113676228091546556 I was very excited about doing TCL this week, but I told myself the first time I get a two-dimensional array problem I'd go FORTRAN, so I guess this week is FORTRAN. A friend of mine who did AOC2024 in December noted the early challenges this year were *very* easy. Today's definitely is. I wonder if part 2 will have any depth.
    2. No result found on File_thumbnail lookup.
      mcc (@mcc@mastodon.social)
      from mcc
      I was too busy to do AOC this month (that's https://adventofcode.com/). So I'm thinking I'm going to do AOC 2024, *in 2025*, under the following rules: - One challenge per week. - I don't have to perform a challenge every week. The goal is to finish by the start of December. - I have to do a different programming language every time. - C, C++ and Objective-C are not eligible languages. - If I make an honest attempt at a language and fail, I may retry in Go (but only Go) (I need to learn Go)
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:48 JST mcc mcc
      in reply to

      Answers to the above questions per #tcl on libera:

      - Type compatibility in tcl can be tested with [string is …]. "Actual" (interpreter level) type is apparently not exposed. https://www.tcl-lang.org/man/tcl8.6/TclCmd/string.htm#M10

      - Strings can be concatenated with [string cat …].

      - Arrays are "weird"; they live in a single scope and can't be exported or passed to a function except by breaking things with "upvar". Additionally, dicts are ordered. "arrays" feel like an old version of "dicts" and I think I intend to avoid them

      In conversation about 4 months ago permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        string manual page - Tcl Built-In Commands
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:48 JST mcc mcc
      in reply to

      My TCL notes file:

      {} => ""
      [] => ``
      set x y => x = y
      [expr {…}] => "act like a programming language"
      [eval {…}] => {act like ""}
      $ and [] work within "" but not {}
      eq ne in ni
      einter => coerce
      proc parameter named "args" is variadic if last
      first $ in $$a does nothing
      format => sprintf
      lsearch and regexp are different
      for {} {} {} => for(;;)
      [subst $$a] => dereference $a
      [string is …] => typecheck
      strings are not strings

      Before running:
      sudo apt install rlwrap
      alias tclrl='rlwrap tclsh'

      In conversation about 4 months ago permalink
      TÔ DE MUDANÇA repeated this.
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:48 JST mcc mcc
      in reply to

      I have just written my first TCL program in an hour or two after waking up. I regret to report I found it a very enjoyable experience. "boogerman" from the FPGA discord wins once again. Unlike the very start-and-stop experiences I had with FORTRAN and Forth (due to bad ergonomics and docs), ASM (due to its basic nature) and BASIC (due to both) I found I just *wrote code*; the way to proceed was always obvious. And my final code was terse, despite a complex algorithm including a BFS graph search.

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:49 JST mcc mcc
      in reply to

      https://mastodon.social/@mcc/113975863804082731

      https://mastodon.sdf.org/@sgeo/113975867549675273

      Currently terrified by the possibility that at some point I will wind up writing a TCL linter

      In conversation about 4 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: files.mastodon.social
        mcc (@mcc@mastodon.social)
        62.3K Posts, 570 Following, 23.1K Followers · glitch girl
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:49 JST mcc mcc
      in reply to

      The official TCL tutorial actually contains a section named "More Quoting Hell"

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:49 JST mcc mcc
      in reply to

      Okay. I actually was able to get through the TCL docs very quick. I would have got through it even quicker if I occasionally hadn't had to stop and do something else for a while because something pissed me off.

      I am tempted to call this an "elegant" spec. I think I would actively like this language if the syntax were restricted somewhat for safety (e.g. if {} were *required* for things such as expr, if, for instead of "you can leave them out but then it probably does something horribly wrong").

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:49 JST mcc mcc
      in reply to

      Here are my TCL questions:

      - I see that there are "integer", "wide integer", "float", "list" and string types in TCL. Is there a builtin that can discern which type a variable has and/or discern which type[s] a variable can be coerced to?

      - Is there a string concatenation operator? (besides "$a$b").

      - What is the difference between an array¹ and a dict? The tutorial makes it clear both exist and explain the difference very poorly.

      ¹ This refers to an associative array not a list

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:50 JST mcc mcc
      in reply to

      The fact I'm picking the languages in this project slightly independently of the problems may be leading to poor pairings (I don't know what problems are coming up, so it's hard to make a schedule that maps well). I think what I most wanted to try with TCL was complex string manipulation. But AOC2024 day 5 appears to be asking me to implement… some sort of sorting algorithm? An auto-sorting data structure? This may turn out to be hell in the exact way trying to do file input in FORTRAN was hell.

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:50 JST mcc mcc
      in reply to

      Oh… … I don't like this. I really don't like this.

      (The thing I don't like is that {}, which you might want to use instead of quotes due to the balancing feature, also disable interpolation. There aren't a lot of language design concepts I got out of Perl that I still think are good ideas, but the one I still strongly believe is that every language needs easy-to-use balanced quote delineators. `qq` is the best thing in Perl.)

      In conversation about 4 months ago permalink

      Attachments


      1. https://files.mastodon.social/media_attachments/files/113/975/674/548/423/381/original/896298cfba6819ea.png
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:50 JST mcc mcc
      in reply to

      I have a programming language I was implementing for a while in the 00s named Emily. There were three versions of it, two of which got released, and all three passed through a phase in their development where they were basically "curried LISP without parentheses".

      Every time I get exposed to Tcl, I become more convinced that "curried LISP without parentheses" as the whole concept for a minimal-size-interpreter language is actually a super good idea. (TCL isn't this.)

      https://www.youtube.com/watch?v=gMZsc3cvwKs

      In conversation about 4 months ago permalink

      Attachments

      1. LambdaConf 2015 - Introducing Emily Simplifying Functional Programming Andi McClure
        from Confreaks
        Emily is an experimental language project focusing on simplifying the basis of programming languages: it models all language operations through composition o...
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:50 JST mcc mcc
      in reply to

      *makes a noise as if she were being strangled by her own throat*

      In conversation about 4 months ago permalink

      Attachments


      1. https://files.mastodon.social/media_attachments/files/113/975/849/953/290/666/original/6c123799625d01f2.png
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:25:51 JST mcc mcc
      in reply to

      I have near zero experience with TCL. In the late 90s when I started using Linux it was already considered old; I had one program that used it, a Tk-based AOL Instant Messenger client that was, admittedly, the nicest piece of Linux GUI software I had.

      TCL is almost gone today EXCEPT in the Verilog community, which uses it religiously because it's a single language they can use both for build scripts (because it's designed as a scripting language) and as a template language (it can do that too).

      In conversation about 4 months ago permalink
    • Embed this notice
      TÔ DE MUDANÇA (augustocc@social.br-linux.org)'s status on Tuesday, 11-Feb-2025 03:29:30 JST TÔ DE MUDANÇA TÔ DE MUDANÇA
      in reply to

      @mcc I miss my TCL days. It was the language of choice for extending the functionality of 'eggdrop’, a popular (in its niche, and late-90s) IRC bot.

      As a language for extending other softwares, I feel that TCL was succeeded by Lua, a language created here in Brazil. Do you intend to test it too?

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:42:32 JST mcc mcc
      in reply to
      • TÔ DE MUDANÇA

      @augustocc The rules of the challenge are to only use languages I haven't used before, and I have written a *lot* of Lua, lol (I released like… five to fifteen games using it in the early 2010s, and then spent five years writing it professionally 2018-2023?). I use it less and less due to the lack of a viable typechecker (there's two typecheckers, neither of which *exactly* fit my needs) but I think Lua might literally be my favorite programming language, possibly even above the one I designed.

      In conversation about 4 months ago permalink
    • Embed this notice
      TÔ DE MUDANÇA (augustocc@social.br-linux.org)'s status on Tuesday, 11-Feb-2025 03:42:32 JST TÔ DE MUDANÇA TÔ DE MUDANÇA
      in reply to

      @mcc oh, I am so sorry, I didn't connect the dots and hadn't realized that I was addressing the creator of Emily. Keep on rocking!

      In conversation about 4 months ago permalink
    • Embed this notice
      mcc (mcc@mastodon.social)'s status on Tuesday, 11-Feb-2025 03:46:01 JST mcc mcc
      in reply to
      • TÔ DE MUDANÇA

      @augustocc You've actually heard of Emily?! Well, I'm flattered

      In conversation about 4 months ago permalink
    • Embed this notice
      TÔ DE MUDANÇA (augustocc@social.br-linux.org)'s status on Tuesday, 11-Feb-2025 03:46:01 JST TÔ DE MUDANÇA TÔ DE MUDANÇA
      in reply to

      @mcc Yep. As I said, keep on rocking!

      In conversation about 4 months ago permalink
    • Embed this notice
      Mauricio Teixeira 🇧🇷🇺🇲 (badnetmask@hachyderm.io)'s status on Tuesday, 11-Feb-2025 04:00:58 JST Mauricio Teixeira 🇧🇷🇺🇲 Mauricio Teixeira 🇧🇷🇺🇲
      in reply to
      • TÔ DE MUDANÇA

      @mcc @augustocc
      wow! I haven't thought about or read TCL code in decades. Thanks for that walk down memory lane!

      In conversation about 4 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.