<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vee Satayamas</title>
    <description>The latest articles on DEV Community by Vee Satayamas (@veer66).</description>
    <link>https://dev.to/veer66</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F39553%2Fc5b3f02b-22ae-403a-8cb4-13d0b3b06774.jpg</url>
      <title>DEV Community: Vee Satayamas</title>
      <link>https://dev.to/veer66</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/veer66"/>
    <language>en</language>
    <item>
      <title>Validating Native Python: A Practical Approach with baredtype</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Mon, 19 Jan 2026 00:35:05 +0000</pubDate>
      <link>https://dev.to/veer66/validating-native-python-a-practical-approach-with-baredtype-44g1</link>
      <guid>https://dev.to/veer66/validating-native-python-a-practical-approach-with-baredtype-44g1</guid>
      <description>&lt;p&gt;In Python development, we often default to using basic data structures like &lt;code&gt;dict&lt;/code&gt; and &lt;code&gt;list&lt;/code&gt; to move data around. They are flexible, JSON-compatible, and require no special setup. With the recent advancements in &lt;code&gt;TypedDict&lt;/code&gt; and &lt;code&gt;Annotated&lt;/code&gt;, the Python type system has become powerful enough to describe these structures with high precision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;baredtype&lt;/strong&gt; is a library built to bridge the gap between these native structures and formal validation. It allows you to enforce strict rules on your data without ever forcing that data to change its shape or type.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Strength of Basic Data Structures
&lt;/h2&gt;

&lt;p&gt;The main draw of &lt;code&gt;baredtype&lt;/code&gt; is that it works directly with the data structures you already use. There is no custom class instantiation or "wrapping" of data into library-specific objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Serialization and Deserialization
&lt;/h3&gt;

&lt;p&gt;Because your data remains a standard &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;dict&lt;/code&gt;, you don't need special methods to get your data in or out of a system. You use the standard tools you already know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;To JSON:&lt;/strong&gt; &lt;code&gt;json.dumps(my_data)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From JSON:&lt;/strong&gt; &lt;code&gt;json.loads(input_string)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation:&lt;/strong&gt; &lt;code&gt;validate(MySchema, my_data)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Handling Keys and &lt;code&gt;None&lt;/code&gt; Values
&lt;/h3&gt;

&lt;p&gt;Working with native structures means using standard Python idioms. &lt;code&gt;baredtype&lt;/code&gt; respects &lt;code&gt;TypedDict&lt;/code&gt; definitions for required fields and &lt;code&gt;Annotated&lt;/code&gt; for value constraints, allowing you to handle &lt;code&gt;None&lt;/code&gt; values and missing keys naturally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing_extensions&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;TypedDict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;NotRequired&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;baredtype&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;validate&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TypedDict&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pattern&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^[\w.-]+@[\w.-]+\.\w+$&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;NotRequired&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Use standard Python to check your data:
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;username&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tech_lead&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;email&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;email&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No email provided.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;age&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Age is an optional key.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Validation checks the types and the constraints
&lt;/span&gt;&lt;span class="n"&gt;is_valid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;UserData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Mapping to JSON Schema and OpenAPI
&lt;/h2&gt;

&lt;p&gt;A core objective of &lt;code&gt;baredtype&lt;/code&gt; is making it easy to map Python types to external standards like JSON Schema and OpenAPI. It handles the "quantifiers" that define how different types can be combined.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quantifier Logic
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;oneOf&lt;/code&gt;&lt;/strong&gt;: By using &lt;code&gt;Annotated&lt;/code&gt; metadata, you can specify that data must match &lt;strong&gt;exactly one&lt;/strong&gt; type in a Union. This is crucial for precise API definitions where ambiguity can lead to bugs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;allOf&lt;/code&gt;&lt;/strong&gt;: This is naturally supported through &lt;code&gt;TypedDict&lt;/code&gt; inheritance. When one &lt;code&gt;TypedDict&lt;/code&gt; inherits from others, &lt;code&gt;baredtype&lt;/code&gt; generates a schema representing the union of those requirements, staying consistent with OpenAPI standards.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Two Ways to Verify the Spec
&lt;/h2&gt;

&lt;p&gt;When we define our data structures, we are writing a specification for our code. There are two primary ways to ensure our code follows this spec, both of which are supported by &lt;code&gt;baredtype&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Static Type Checking
&lt;/h3&gt;

&lt;p&gt;Because the library is built on &lt;code&gt;TypedDict&lt;/code&gt;, you get the full benefit of tools like &lt;strong&gt;Mypy&lt;/strong&gt; or &lt;strong&gt;Pyright&lt;/strong&gt;. Your IDE can catch missing keys or type mismatches while you are writing the code. This finds errors before the code ever runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Property-Based Checking
&lt;/h3&gt;

&lt;p&gt;While static types prove what &lt;em&gt;should&lt;/em&gt; happen, property-based checking proves what &lt;em&gt;can&lt;/em&gt; happen under stress. &lt;code&gt;baredtype&lt;/code&gt; integrates with &lt;strong&gt;Hypothesis&lt;/strong&gt; to automatically generate data that fits your &lt;code&gt;TypedDict&lt;/code&gt; definitions, including constraints like &lt;code&gt;min_length&lt;/code&gt; or regex patterns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;baredtype&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;given_from_annotations&lt;/span&gt;

&lt;span class="nd"&gt;@given_from_annotations&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_process_payload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;UserData&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Hypothesis generates a wide variety of valid UserData dicts
&lt;/span&gt;    &lt;span class="c1"&gt;# to find edge cases in your logic.
&lt;/span&gt;    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;my_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Validation: The Constant Requirement
&lt;/h3&gt;

&lt;p&gt;Regardless of whether you use static checking, property-based checking, or both, &lt;strong&gt;runtime validation is a must.&lt;/strong&gt; External data is inherently untrusted. Static checking verifies your internal logic, and property-based testing verifies your code's resilience during development. At the moment data enters your system, &lt;code&gt;baredtype&lt;/code&gt; provides the final, essential check to ensure the data actually matches your specification.&lt;/p&gt;




&lt;h2&gt;
  
  
  Explore the Project
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;baredtype&lt;/code&gt; offers a lightweight validation layer that stays out of your data's way, leveraging the emerging strengths of the Python type system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check out the project on Codeberg:&lt;/strong&gt;&lt;br&gt;
👉 &lt;a href="https://codeberg.org/veer66/baredtype" rel="noopener noreferrer"&gt;https://codeberg.org/veer66/baredtype&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>baredtype</category>
      <category>validation</category>
      <category>openapi</category>
    </item>
    <item>
      <title>Revisiting codebase organization practices from 2004</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sat, 27 Dec 2025 02:06:57 +0000</pubDate>
      <link>https://dev.to/veer66/revisiting-codebase-organization-practices-from-2004-5ej0</link>
      <guid>https://dev.to/veer66/revisiting-codebase-organization-practices-from-2004-5ej0</guid>
      <description>&lt;p&gt;I reviewed the file and directory structure of several web-based free software projects released in 2003–2004: the Koha 1.2.0 library management system, the MRBS 1.2.1 meeting room booking system, and the DSpace 1.2 content repository system. These were written in Perl, PHP, and Java, respectively.&lt;/p&gt;

&lt;p&gt;Endpoint files are named using an action, optionally followed by an entity, following patterns such as search.pl, &lt;code&gt;search.php&lt;/code&gt;, &lt;code&gt;SimpleSearchServlet.java&lt;/code&gt;, &lt;code&gt;updatebibitem.pl&lt;/code&gt;, &lt;code&gt;edit_entry.php&lt;/code&gt;, and &lt;code&gt;EditProfileServlet.java&lt;/code&gt;. These verbs or verb phrases may or may not align with user workflows. For example, Koha includes &lt;code&gt;opac_reserve.pl&lt;/code&gt;, indicating it handles the reservation workflow via the Online Public Access Catalog (OPAC) API. However, there is no dedicated "borrow" endpoint file.&lt;/p&gt;

&lt;p&gt;Each system is designed in a modular style. Koha has a &lt;code&gt;Borrower.pm&lt;/code&gt; module that provides a &lt;code&gt;reserveslist&lt;/code&gt; function; MRBS uses &lt;code&gt;functions.inc&lt;/code&gt; with functions such as &lt;code&gt;make_room_select_html&lt;/code&gt;; and DSpace's &lt;code&gt;Item.java&lt;/code&gt; includes methods like &lt;code&gt;findAll&lt;/code&gt;. That said, they do not strictly follow a multi-tier architecture, for instance, database queries are not isolated into a dedicated data access layer. Still, DSpace, by using Servlets and JSPs, does establish a distinct presentation layer.&lt;/p&gt;

&lt;p&gt;Because of the verb-based naming convention, files emphasize what they do rather than which architectural layer they belong to. This makes their purpose easy to understand at a glance.&lt;/p&gt;

&lt;p&gt;However, this approach can make organization and testing more challenging. Logic, database queries, and presentation code are often mixed; sometimes not even separated into distinct functions.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>history</category>
      <category>codebaseorganization</category>
    </item>
    <item>
      <title>Global Variables in Python Are Not That Global</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sat, 13 Dec 2025 05:51:25 +0000</pubDate>
      <link>https://dev.to/veer66/global-variables-in-python-are-not-that-global-280j</link>
      <guid>https://dev.to/veer66/global-variables-in-python-are-not-that-global-280j</guid>
      <description>&lt;p&gt;In the context of programming in the 1980s, "global variables" likely brings to mind languages like &lt;a href="https://en.wikipedia.org/wiki/MBASIC" rel="noopener noreferrer"&gt;MBASIC&lt;/a&gt;. However, using MBASIC as an example today would be challenging, as it is now rarely used or known. Instead, GNU Bash, which is the default shell scripting language for many systems—will be used to illustrate what global variables were traditionally like. Anyway, some might think of Fortran II, but I'm not familiar with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bash Example
&lt;/h2&gt;

&lt;p&gt;I wrote a Bash script consisting of four files:&lt;/p&gt;

&lt;h3&gt;
  
  
  a.bash
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;a.bash&lt;/code&gt; orchestrates everything. "Orchestration" might be too grand a word for these toy scripts, but I want to convey that it performs a role similar to Apache Airflow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;.&lt;/span&gt; ./b.bash
&lt;span class="nb"&gt;.&lt;/span&gt; ./c.bash
&lt;span class="nb"&gt;.&lt;/span&gt; ./d.bash

init
print_count
inc
print_count
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  b.bash
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;b.bash&lt;/code&gt; contains only one function, &lt;code&gt;inc&lt;/code&gt;, which increments the counter, which is the global variable in this example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;inc&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;counter &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  c.bash
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;c.bash&lt;/code&gt; contains &lt;code&gt;print_count&lt;/code&gt;, which simply displays the value of the global variable &lt;code&gt;counter&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;print_count&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$counter&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  d.bash
&lt;/h3&gt;

&lt;p&gt;In Bash, &lt;code&gt;counter&lt;/code&gt; can be initialized globally from within a function by default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;init&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Python Example
&lt;/h2&gt;

&lt;p&gt;The following section shows the result of porting the Bash script above to Python, highlighting the key differences.&lt;/p&gt;

&lt;h2&gt;
  
  
  a.py
&lt;/h2&gt;

&lt;p&gt;This is the orchestration part. Note the use of namespaces or module names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;

&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;print_count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;print_count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  b.py
&lt;/h2&gt;

&lt;p&gt;In the Python version, &lt;code&gt;inc&lt;/code&gt; must refer to the module &lt;code&gt;d&lt;/code&gt; to access the variable. Alternatively, &lt;code&gt;counter&lt;/code&gt; could be explicitly imported.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  c.py
&lt;/h2&gt;

&lt;p&gt;Similarly, &lt;code&gt;print_count&lt;/code&gt; in Python must also refer to module &lt;code&gt;d&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;print_count&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  d.py
&lt;/h2&gt;

&lt;p&gt;Unlike in Bash, initializing a global variable from within a function—even in the same module—requires an explicit &lt;code&gt;global&lt;/code&gt; declaration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;
    &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Differences
&lt;/h2&gt;

&lt;p&gt;As you can see, a global variable in Bash is truly global across files. In Python, however, a global variable is only global within its module, i.e., file. Furthermore, mutating a global variable in Bash requires no special syntax, whereas in Python a function must explicitly declare &lt;code&gt;global&lt;/code&gt; to modify a module-level variable.&lt;/p&gt;

&lt;p&gt;Consequently, although both are called "global variables," Python's are scoped to the module. This means they won’t interfere with variables in other modules unless we deliberately make them do so. For developers who use one class per module, a Python global variable behaves much like a class variable. Additionally, variable assignment inside a Python function is local by default, preventing accidental modification of global state unless explicitly intended.&lt;/p&gt;

&lt;p&gt;In short, many traditional precautions about global variables in languages like Bash or MBASIC no longer apply in Python. Therefore, we might reconsider automatically rejecting global variables based on past advice and instead evaluate their use case thoughtfully.&lt;/p&gt;

</description>
      <category>python</category>
      <category>globalvariable</category>
    </item>
    <item>
      <title>A lesson about abstraction from Arch Linux</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sun, 23 Nov 2025 09:23:50 +0000</pubDate>
      <link>https://dev.to/veer66/a-lesson-about-abstraction-from-arch-linux-3e98</link>
      <guid>https://dev.to/veer66/a-lesson-about-abstraction-from-arch-linux-3e98</guid>
      <description>&lt;p&gt;I was impressed by &lt;a href="https://www.pkgsrc.org/" rel="noopener noreferrer"&gt;pkgsrc&lt;/a&gt; because it is a powerful package management system that defines packages using a common tool like a Makefile. I later discovered that the &lt;a href="https://wiki.archlinux.org/title/PKGBUILD" rel="noopener noreferrer"&gt;PKGBUILD&lt;/a&gt; file is even more impressive, as its purpose is immediately clear. I initially attributed this to my greater familiarity with Bash scripting compared to Makefiles, but I now believe the true reason is PKGBUILD's level of abstraction.&lt;/p&gt;

&lt;p&gt;It retains explicit calls to configure and make, preserving the transparency of a manual installation. This demonstrates that while increased abstraction can make code shorter, it can also hinder understanding.&lt;/p&gt;

&lt;p&gt;Another potential advantage of greater abstraction is the ability to change the configure command for every package by modifying just one location. However, since GNU Autotools has continued to use the configure command for decades, it may not be worth sacrificing clarity for this particular benefit.&lt;/p&gt;

</description>
      <category>abstraction</category>
      <category>archlinux</category>
    </item>
    <item>
      <title>Reasons to use Emacs in 2025</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Tue, 02 Sep 2025 15:52:03 +0000</pubDate>
      <link>https://dev.to/veer66/reasons-to-use-emacs-in-2025-14bn</link>
      <guid>https://dev.to/veer66/reasons-to-use-emacs-in-2025-14bn</guid>
      <description>&lt;p&gt;Expanding Emacs functionality is as simple as defining a new function instead of creating an entire extension package, as is often done in many other extensible editors. This function can then be re-evaluated, tested, and modified entirely within Emacs using just a few clicks or keyboard shortcuts, with no need to restart or reload Emacs. &lt;/p&gt;

</description>
      <category>emacs</category>
    </item>
    <item>
      <title>Reasons to use Common Lisp in 2025</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sun, 17 Aug 2025 16:14:26 +0000</pubDate>
      <link>https://dev.to/veer66/reasons-to-use-common-lisp-in-2025-523h</link>
      <guid>https://dev.to/veer66/reasons-to-use-common-lisp-in-2025-523h</guid>
      <description>&lt;h1&gt;
  
  
  Reasons to use Common Lisp
&lt;/h1&gt;

&lt;h2&gt;
  
  
  An actively-maintained-implementation, long-term-stable-specification programming language
&lt;/h2&gt;

&lt;p&gt;There are many programming languages that don't change much, including&lt;br&gt;
Common Lisp, but Common Lisp implementations continue to be developed.&lt;br&gt;
For example, SBCL (Steel Bank Common Lisp) released its latest version&lt;br&gt;
just last month.&lt;/p&gt;

&lt;p&gt;Common Lisp can be extended through libraries. For example, cl-interpol&lt;br&gt;
enables Perl-style strings to Common Lisp without requiring a new&lt;br&gt;
version of Common Lisp. cl-arrows allows Common Lisp to create pipelines&lt;br&gt;
using Clojure-style syntax without needing to update the Common Lisp&lt;br&gt;
specification. This exceptional extensibility stems from macro and&lt;br&gt;
particularly reader macro support in Common Lisp.&lt;/p&gt;
&lt;h2&gt;
  
  
  Feature-packed
&lt;/h2&gt;

&lt;p&gt;Common Lisp includes many features found in modern programming&lt;br&gt;
languages, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Garbage collection&lt;/li&gt;
&lt;li&gt;Built-in data structures (e.g., vectors, hash tables)&lt;/li&gt;
&lt;li&gt;Type hints&lt;/li&gt;
&lt;li&gt;Class definitions&lt;/li&gt;
&lt;li&gt;A syntactic structure similar to list comprehensions&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Multi-paradigm
&lt;/h2&gt;

&lt;p&gt;While Lisp is commonly associated with functional programming, Common&lt;br&gt;
Lisp doesn't enforce this paradigm. It fully supports imperative&lt;br&gt;
programming (like Pascal), and its object-oriented programming system&lt;br&gt;
even includes advanced features. Best of all, you can freely mix all&lt;br&gt;
these styles. Common Lisp even embraces goto-like code via TAGBODY-GO.&lt;/p&gt;
&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;Common Lisp has many implementations, and some of them, such as SBCL,&lt;br&gt;
are compilers that can generate efficient code.&lt;/p&gt;

&lt;p&gt;With some (of course, not all) implementations, many programs written in&lt;br&gt;
dynamic programming languages run slower than those in static ones, such&lt;br&gt;
as C and Modula-2.&lt;/p&gt;

&lt;p&gt;First, an example of the generated assembly will be shown, along with&lt;br&gt;
more explanation about why it might be slowed down by some dynamic&lt;br&gt;
implementations&lt;/p&gt;

&lt;p&gt;The code listing below is a part of a program written in Modula-2, which&lt;br&gt;
must be easy to read by programmers of languages in the extended ALGOL&lt;br&gt;
family.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    TYPE
      Book = RECORD
        title: ARRAY[1..64] OF CHAR;
        price: REAL;
      END;

    PROCEDURE SumPrice(a, b: Book): REAL;
    BEGIN
      RETURN a.price + b.price;
    END SumPrice;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code is mainly for summing the price of books, and only the part&lt;br&gt;
'a.price + b.price' will be focused on.&lt;/p&gt;

&lt;p&gt;'a.price + b.price' is translated into X86-64 assembly code list below&lt;br&gt;
using the GNU Modula-2 compiler.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    movsd   80(%rbp), %xmm1
    movsd   152(%rbp), %xmm0
    addsd   %xmm1, %xmm0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"movsd 80(%rbp), %xmm1' and 'movsd 152(%rbp), %xmm0' are for loading&lt;br&gt;
'prices' to registers '%xmm1' and '%xmm0', respectively. Finally, 'addsd&lt;br&gt;
%xmm1, %xmm0' is for adding prices together. As can be seen, the prices&lt;br&gt;
are loaded from exact locations relative to the value of the '%rbp'&lt;br&gt;
register, which is one of the most efficient ways to load data from&lt;br&gt;
memory. The instruction 'addsd' is used because prices in this program&lt;br&gt;
are REAL (floating point numbers), and '%xmm0', '%xmm1', and 'movsd' are&lt;br&gt;
used for the same reason. This generated code should be reasonably&lt;br&gt;
efficient. However, the compiler needs to know the type and location of&lt;br&gt;
the prices beforehand to choose the proper instructions and registers to&lt;br&gt;
use.&lt;/p&gt;

&lt;p&gt;In dynamic languages, 'SumPrice' can be applied to a price whose type is&lt;br&gt;
an INTEGER instead of a REAL, or it can even be a string/text. A&lt;br&gt;
straightforward implementation would check the type of 'a' and 'b' at&lt;br&gt;
runtime, which makes the program much less efficient. The checking and&lt;br&gt;
especially branching can cost more time than adding the numbers&lt;br&gt;
themselves. Moreover, obtaining the value of the price attribute from&lt;br&gt;
'a' and 'b' might be done by accessing a hash table instead of directly&lt;br&gt;
loading the value from memory. Of course, while a hash-table has many&lt;br&gt;
advantages, it's less efficient because it requires many steps,&lt;br&gt;
including comparing the attribute name and generating a hash value.&lt;/p&gt;

&lt;p&gt;However, compilers for dynamic languages can be much more advanced than&lt;br&gt;
what's mentioned above, and SBCL is one such advanced compiler. SBCL can&lt;br&gt;
infer types from the code, especially from literals. Moreover, with&lt;br&gt;
information from type hints and 'struct' usage, SBCL can generate code&lt;br&gt;
that's comparably as efficient as static language compilers.&lt;/p&gt;

&lt;p&gt;Given, the Common Lisp code listing below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight common_lisp"&gt;&lt;code&gt;    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defstruct&lt;/span&gt; &lt;span class="nv"&gt;book&lt;/span&gt;
      &lt;span class="nv"&gt;title&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;price&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ss"&gt;:type&lt;/span&gt; &lt;span class="kt"&gt;double-float&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;declaim&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ftype&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;book&lt;/span&gt; &lt;span class="nv"&gt;book&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;double-float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;add-price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
         &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;optimize&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;speed&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;debug&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;safety&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt; &lt;span class="nv"&gt;add-price&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;book-price&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
         &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;book-price&lt;/span&gt; &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SBCL can generate assembly code for '(+ (book-price a) (book-price b))'&lt;br&gt;
as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ; 86:       F20F104A0D       MOVSD XMM1, [RDX+13]
    ; 8B:       F20F10570D       MOVSD XMM2, [RDI+13]
    ; 90:       F20F58D1         ADDSD XMM2, XMM1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The assembly code format is slightly different from the one generated by&lt;br&gt;
the GNU Modula-2 compiler, but the main parts, the 'MOVSD' and 'ADDSD'&lt;br&gt;
instructions and the use of XMM registers—are exactly the same. This&lt;br&gt;
shows that we can write efficient code in Common Lisp at least for this&lt;br&gt;
case. This shows that we can write efficient code in Common Lisp, at&lt;br&gt;
least in this case, that is as efficient as, or nearly as efficient as,&lt;br&gt;
a static language.&lt;/p&gt;

&lt;p&gt;This implies that Common Lisp is good both for high-level rapid&lt;br&gt;
development and optimized code, which has two advantages: (1) in many&lt;br&gt;
cases, there is no need to switch between two languages, i.e., a&lt;br&gt;
high-level one and a fast one; (2) the code can be started from&lt;br&gt;
high-level and optimized in the same code after a profiler finds&lt;br&gt;
critical parts. This paradigm can prevent premature optimization.&lt;/p&gt;
&lt;h2&gt;
  
  
  Interactive programming
&lt;/h2&gt;

&lt;p&gt;Interactive programming may not sound familiar. However, it is a common&lt;br&gt;
technique that has been used for decades. For example, a database engine&lt;br&gt;
such as PostgreSQL doesn't need to be stopped and restarted just to run&lt;br&gt;
a new SQL statement. Similarly, it is akin to a spreadsheet like Lotus&lt;br&gt;
1-2-3 or Microsoft Excel, which can run a new formula without needing to&lt;br&gt;
reload existing sheets or restart the program.&lt;/p&gt;

&lt;p&gt;Common Lisp is exceptionally well-suited for interactive programming&lt;br&gt;
because of (1) integrated editors with a REPL (Read Eval Print Loop),&lt;br&gt;
(2) the language's syntax, and (3) the active community that has&lt;br&gt;
developed libraries specifically designed to support interactive&lt;br&gt;
programming.&lt;/p&gt;
&lt;h3&gt;
  
  
  Integrated editors with a REPL
&lt;/h3&gt;

&lt;p&gt;With an integrated with a REPL, any part of the code can be evaluated&lt;br&gt;
immediately without copying and pasting from an editor into a REPL. This&lt;br&gt;
workflow provides feedback even faster than hot reloading because the&lt;br&gt;
code can be evaluated and its results seen instantaneously, even before&lt;br&gt;
it is saved. There are many supported editors, such as Visual Studio&lt;br&gt;
Code, Emacs, Neovim, and others.&lt;/p&gt;
&lt;h3&gt;
  
  
  the language's syntax
&lt;/h3&gt;

&lt;p&gt;Instead of marking region arbitrarily for evaluating, which is not very&lt;br&gt;
convenient when it is done every few seconds, in Common Lisp, we can&lt;br&gt;
mark a form (which is similar to a block in ALGOL) by moving a cursor to&lt;br&gt;
one of the parentheses in the code, which is very easy with structural&lt;br&gt;
editing, which will be discussed in the next section.&lt;/p&gt;

&lt;p&gt;Moreover, even a method definition can be evaluated immediately without&lt;br&gt;
resetting the state of the object in Common Lisp. Since method&lt;br&gt;
definitions are not nested in defclass, this allows mixing interactive&lt;br&gt;
programming and object-oriented programming (OOP) smoothly.&lt;/p&gt;

&lt;p&gt;Here's the corrected code listing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight common_lisp"&gt;&lt;code&gt;    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defclass&lt;/span&gt; &lt;span class="nv"&gt;toto&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="ss"&gt;:initarg&lt;/span&gt; &lt;span class="ss"&gt;:i&lt;/span&gt; &lt;span class="ss"&gt;:accesor&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;

    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defmethod&lt;/span&gt; &lt;span class="nv"&gt;update-i&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;obj&lt;/span&gt; &lt;span class="nv"&gt;toto&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setf&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;According to the code listing above, the method 'update-i' can be&lt;br&gt;
redefined without interfering with the pre-existing value of 'i'.&lt;/p&gt;

&lt;h2&gt;
  
  
  Structural editing
&lt;/h2&gt;

&lt;p&gt;Instead of editing Lisp code like normal text, tree-based operations can&lt;br&gt;
be used instead, such as paredit-join-sexps and&lt;br&gt;
paredit-forward-slurp-sexp. Moving cursor operations, such as&lt;br&gt;
paredit-forward, which moves the cursor to the end of the form (a&lt;br&gt;
block). These structural moving operations are also useful for selecting&lt;br&gt;
regions to be evaluated in a REPL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In brief, Common Lisp has unparalleled combined advantages, which are&lt;br&gt;
relevant to software development especially now, not just an archaic&lt;br&gt;
technology that just came earlier. For example, Forth has a&lt;br&gt;
long-term-stable specification, and works well with interactive&lt;br&gt;
programming, but it is not designed for defining classes and adding type&lt;br&gt;
hints. Julia has similar performance optimization and OOP is even&lt;br&gt;
richer, but it doesn't have a long-term-stable specification. Moreover,&lt;br&gt;
Common Lisp's community is still active, as libraries, apps, and even&lt;br&gt;
implementations continue to receive updates.&lt;/p&gt;

</description>
      <category>commonlisp</category>
      <category>lisp</category>
    </item>
    <item>
      <title>My programming environment journey</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sat, 19 Jul 2025 04:58:58 +0000</pubDate>
      <link>https://dev.to/veer66/my-programming-environment-journey-5748</link>
      <guid>https://dev.to/veer66/my-programming-environment-journey-5748</guid>
      <description>&lt;p&gt;No one actually cares about my programming environment journey, but I’ve often been asked to share it, perhaps for the sake of social media algorithms. I post it here, so later, I can copy and paste this conveniently.&lt;/p&gt;

&lt;p&gt;My first computer, in the sense that I, not someone else, made the decision to buy it, ran Debian in 2002. It was a used Compaq desktop with a Pentium II processor, which I bought from Zeer Rangsit, a used computer market that may be the most famous in Thailand these days. When I got it home, I installed Debian right away. Before I bought my computer, I had used MBasic, mainly MS-DOS, Windows 3.1 (though rarely), and  Solaris (remotely).  For experimentation, I used Xenix, AIX, and one on DEC PDP-11 that I forgot.&lt;/p&gt;

&lt;p&gt;Since I started with MBasic, that was my first programming environment. I learned Logo at a summer camp, so that became my second. Later, my father bought me a copy of Turbo Basic, and at school, I switched to Turbo Pascal.&lt;/p&gt;

&lt;p&gt;After moving to GNU/Linux, I used more editors instead IDEs. From 1995 to 2010, my editors were pico, nvi, vim, TextMate, and Emacs paired with GCC (mostly C, not C++), PHP, Perl, Ruby, Python, JavaScript, and SQL. I also used VisualAge to learn Java in the 90s. I tried Haskell, OCaml, Objective C, Lua, Julia, and Scala too, but it was strictly for learning only.&lt;/p&gt;

&lt;p&gt;After 2010, I used IntelliJ IDEA and Eclipse for Java and Kotlin. For Rust (instead of C), I used Emacs and Visual Studio Code. I explored Racket for learning purposes, then later started coding seriously in Clojure and Common Lisp. I tried using Vim 9.x and Neovim too, they were great, but not quite my cup of tea.&lt;/p&gt;

&lt;p&gt;In 2025, a few days ago, I learned Smalltalk with Pharo to deepen my understanding of OOP and exploratory programming.&lt;/p&gt;

&lt;p&gt;Update 2025/07/20: I forgot to mention xBase. In the '90s, I used it in a programming competition, but none of my programs in xBase reach production.&lt;/p&gt;

</description>
      <category>programmingenvironment</category>
    </item>
    <item>
      <title>I have been told to avoid linked lists.</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sun, 23 Mar 2025 08:18:12 +0000</pubDate>
      <link>https://dev.to/veer66/i-have-been-told-to-avoid-linked-lists-24ja</link>
      <guid>https://dev.to/veer66/i-have-been-told-to-avoid-linked-lists-24ja</guid>
      <description>&lt;p&gt;I've been told to avoid linked lists because their elements are scattered everywhere, which can be true in some cases. However, I wonder what happens in loops, which I use frequently. I tried to inspect memory addresses of list elements of these two programs run on SBCL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight common_lisp"&gt;&lt;code&gt;&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;69517814583&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F95AB37&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="mi"&gt;69517814567&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F95AB27&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cddr&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="mi"&gt;69517814551&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F95AB17&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cddr&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="mi"&gt;69517814551&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F95AB17&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight common_lisp"&gt;&lt;code&gt;&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;setq&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
              &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;69518319943&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F9D6147&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cdr&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="mi"&gt;69518319927&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F9D6137&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;CL-USER&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;sb-kernel:get-lisp-obj-address&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cddr&lt;/span&gt; &lt;span class="vg"&gt;*a-list*&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="mi"&gt;69518319911&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt; &lt;span class="nv"&gt;bits,&lt;/span&gt; &lt;span class="m"&gt;#x102F9D6127&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In both programs, the list elements are not scattered. So, if scattered list elements were an issue for these simple cases, you probably used the wrong compiler or memory allocator.&lt;/p&gt;

</description>
      <category>linkedlist</category>
    </item>
    <item>
      <title>JSON Manipulation</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sun, 19 Jan 2025 11:55:57 +0000</pubDate>
      <link>https://dev.to/veer66/json-manipulation-1183</link>
      <guid>https://dev.to/veer66/json-manipulation-1183</guid>
      <description>&lt;p&gt;There are many ways to manipulate JSON. I reviewed a few rapid ways today, which are using a command line tool called &lt;code&gt;jq&lt;/code&gt; and libraries that support JSONPath query language.&lt;/p&gt;

&lt;h1&gt;
  
  
  jq
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;Awk&lt;/code&gt; is a powerful domain-specific language for text processing, but it lacks built-in support for manipulating hierarchical data structures like trees. &lt;code&gt;jq&lt;/code&gt; fills this gap by providing a tool for transforming JSON data. However, one potential drawback is that &lt;code&gt;jq&lt;/code&gt; requires a separate installation, which may add complexity to my workflow.&lt;/p&gt;

&lt;p&gt;So I write a shell script using &lt;code&gt;jq&lt;/code&gt; to extract user's names and user's urls from a cURL response, and then output it in TSV format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s1"&gt;'https://mstdn.in.th/api/v1/timelines/public?limit=10'&lt;/span&gt; | jq &lt;span class="s1"&gt;'.[].account | [.username, .url] | @tsv'&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kuketzblog      https://social.tchncs.de/@kuketzblog
cats    https://social.goose.rodeo/@cats
AlJazeera       https://flipboard.com/@AlJazeera
TheHindu        https://flipboard.com/@TheHindu
GossiTheDog     https://cyberplace.social/@GossiTheDog
kuketzblog      https://social.tchncs.de/@kuketzblog
weeklyOSM       https://en.osm.town/@weeklyOSM
juanbellas      https://masto.es/@juanbellas
noborusudou     https://misskey.io/@noborusudou
jerryd  https://mastodon.social/@jerryd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a TSV file, we can use Awk, sed, etc. to manipulate them as usual.&lt;/p&gt;

&lt;h1&gt;
  
  
  JSONPath
&lt;/h1&gt;

&lt;p&gt;JSONPath, which was explained in &lt;a href="https://www.rfc-editor.org/rfc/rfc9535" rel="noopener noreferrer"&gt;RFC 9535&lt;/a&gt;, is supported by many libraries and applications, e.g. PostgreSQL. Still, I try to it in Python by the &lt;code&gt;jsonpath_nq&lt;/code&gt; library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;jsonpath_ng&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;parse&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;


&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://mstdn.in.th/api/v1/timelines/public?limit=10&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;compiled_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;$[*].account&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;matched_node&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;compiled_path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matched_node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;username&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;matched_node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;url&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It gave the same result to the shell script above. The code is a bit longer than the shell script. However, it can be integrated with many Python libraries.&lt;/p&gt;

</description>
      <category>json</category>
      <category>dsl</category>
    </item>
    <item>
      <title>Four Reasons that I Sometimes Use Awk Instead of Python</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Tue, 31 Dec 2024 17:44:34 +0000</pubDate>
      <link>https://dev.to/veer66/four-reasons-that-i-sometimes-use-awk-instead-of-python-4nhb</link>
      <guid>https://dev.to/veer66/four-reasons-that-i-sometimes-use-awk-instead-of-python-4nhb</guid>
      <description>&lt;p&gt;Python is a fantastic language, but in specific situations, Awk can offer significant advantages, particularly in terms of portability, longevity, conciseness, and interoperability.&lt;/p&gt;

&lt;p&gt;While Python scripts are generally portable, they may not always run seamlessly on popular Docker base images like Debian and Alpine. In contrast, Awk scripts are often readily available and executable within these environments.&lt;/p&gt;

&lt;p&gt;Although Python syntax is relatively stable, its lifespan is shorter compared to Awk. For example, the &lt;code&gt;print 10&lt;/code&gt; syntax from the early 2000s is no longer valid in modern Python. However, Awk scripts from the 1980s can still be executed in current environments.&lt;/p&gt;

&lt;p&gt;Python is known for its conciseness, especially when compared to languages like Java. However, when it comes to text processing and working within shell pipelines, Awk often provides more concise solutions. For instance, extracting text blocks between "REPORT" and "END" can be achieved with a single line in Awk: &lt;code&gt;/REPORT/,/END/ { print }&lt;/code&gt;. Achieving the same result in Python typically involves more lines of code, including handling file input and pattern matching.&lt;/p&gt;

&lt;p&gt;While Python can be embedded within shell scripts like Bash, aligning the indentation of multiline Python code with the surrounding shell script can often break the Python syntax. Awk, on the other hand, is less sensitive to indentation, making it easier to integrate into shell scripts.&lt;/p&gt;

&lt;p&gt;Although different Awk implementations (such as Busybox Awk and GNU Awk) may have minor variations, Awk generally offers advantages over Python in the situations mentioned above.&lt;/p&gt;

</description>
      <category>python</category>
      <category>awk</category>
    </item>
    <item>
      <title>A shell script that I usually run after installing SBCL</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sun, 21 Jul 2024 14:58:53 +0000</pubDate>
      <link>https://dev.to/veer66/a-shell-script-that-i-usually-run-after-install-sbcl-2dfi</link>
      <guid>https://dev.to/veer66/a-shell-script-that-i-usually-run-after-install-sbcl-2dfi</guid>
      <description>&lt;p&gt;I usually run this shell script after installing SBCL because to develop a program in Common Lisp practically, I usually need libraries. Thus, this script install Quicklisp and Ultralisp as a package manager and a package repository, respectively. Moreover, I set working directory for my Common Lisp projects to Develop in my home directory because when I put them in quicklisp/local-projects, I usually forget to backup or even forget where that the projects exist.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="c"&gt;# My working directory is $HOME/Develop. You probably want to change it.&lt;/span&gt;

&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/quicklisp
&lt;span class="nb"&gt;rm &lt;/span&gt;quicklisp.lisp
wget https://beta.quicklisp.org/quicklisp.lisp
sbcl &lt;span class="nt"&gt;--load&lt;/span&gt; quicklisp.lisp &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--eval&lt;/span&gt; &lt;span class="s1"&gt;'(quicklisp-quickstart:install)'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--eval&lt;/span&gt; &lt;span class="s1"&gt;'(ql-util:without-prompting (ql:add-to-init-file))'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
        &lt;span class="nt"&gt;--quit&lt;/span&gt;
&lt;span class="nb"&gt;rm &lt;/span&gt;quicklisp.lisp

sbcl &lt;span class="nt"&gt;--eval&lt;/span&gt; &lt;span class="s1"&gt;'(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)'&lt;/span&gt; &lt;span class="nt"&gt;--quit&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; ~/.config/common-lisp &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-rp&lt;/span&gt; ~/.config/common-lisp ~/.config/common-lisp.bak-&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-I&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;-&lt;span class="nv"&gt;$$&lt;/span&gt;
&lt;span class="k"&gt;fi
&lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.config/common-lisp

&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt; &amp;gt; ~/.config/common-lisp/source-registry.conf
(:source-registry
     (:tree (:home "Develop"))
     :inherit-configuration)
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>lisp</category>
    </item>
    <item>
      <title>Pyenv and Pipenv on Fedora</title>
      <dc:creator>Vee Satayamas</dc:creator>
      <pubDate>Sun, 14 Jul 2024 08:32:47 +0000</pubDate>
      <link>https://dev.to/veer66/pyenv-and-pipenv-on-fedora-13m2</link>
      <guid>https://dev.to/veer66/pyenv-and-pipenv-on-fedora-13m2</guid>
      <description>&lt;p&gt;I wonder if I can use pyenv and pipenv on Fedora Workstation 40 although I don't use these utilities in my personal projects. And the answer is yes.&lt;/p&gt;

&lt;p&gt;The steps are as follow:&lt;/p&gt;

&lt;h2&gt;
  
  
  Install dependencies
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf builddep python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install pyenv
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://pyenv.run | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know that you don't like running Bash script immediately from cURL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modify .bashrc
&lt;/h2&gt;

&lt;p&gt;Pyenv normally told you to append these lines to .bashrc, and the restart your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] &amp;amp;&amp;amp; export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

# Restart your shell for the changes to take effect.

# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:

eval "$(pyenv virtualenv-init -)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Python via Pyenv
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pyenv install 3.10 # You can choose other versions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know that we can install Python using configure and make like many other packages, but you can use pyenv as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set default python
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pyenv global 3.10 # or other version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then restart your terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  And finally, install pipenv
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pipenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
    </item>
  </channel>
</rss>
