<?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: Dave Creelman</title>
    <description>The latest articles on DEV Community by Dave Creelman (@kreely).</description>
    <link>https://dev.to/kreely</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615401%2Fbbf1e563-7359-4cf0-a3c1-0c810e114e3a.jpg</url>
      <title>DEV Community: Dave Creelman</title>
      <link>https://dev.to/kreely</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kreely"/>
    <language>en</language>
    <item>
      <title>Raylib v6 in Janet.. on the web</title>
      <dc:creator>Dave Creelman</dc:creator>
      <pubDate>Thu, 13 Aug 2026 01:45:27 +0000</pubDate>
      <link>https://dev.to/kreely/raylib-v6-in-janet-on-the-web-2947</link>
      <guid>https://dev.to/kreely/raylib-v6-in-janet-on-the-web-2947</guid>
      <description>&lt;p&gt;&lt;a href="https://gitlab.com/kreels/jaylib-wasm" rel="noopener noreferrer"&gt;Jaylib-WASM&lt;/a&gt;  provides a Makefile/emscripten based compile process to build a good number of the Raylib v6 examples in Janet, running on the web via WASM.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jaylib-wasm-d761fa.gitlab.io/" rel="noopener noreferrer"&gt;The demo page&lt;/a&gt; has a list of the examples ported so far.&lt;/p&gt;

&lt;p&gt;There is also a &lt;a href="https://gitlab.com/kreels/jaylib-wasm/-/tree/main/cmd?ref_type=heads" rel="noopener noreferrer"&gt;command line tool&lt;/a&gt; that lets you run the same web page Janet code via a command line (only in Linux so far).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;This effort is a personal exploration, not an official Janet effort.&lt;/em&gt; AI use in Janet core code needs to be heavily reviewed before use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7rr5wfy8rt9e3t1xgjf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7rr5wfy8rt9e3t1xgjf.png" alt="The Raylib Starfield Example, running in Janet on the web" width="780" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj0h76yct2lk4uxiqngyt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj0h76yct2lk4uxiqngyt.png" alt="Shadow Map Rendering of Robot" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Jaylib-WASM is an experiment for me using &lt;a href="https://www.deepseek.com/" rel="noopener noreferrer"&gt;DeepSeek&lt;/a&gt; to help me quite a lot to build these examples. It has worked relatively well for me so far.&lt;/p&gt;

&lt;p&gt;I have an interest in &lt;a href="https://lisp-lang.org/" rel="noopener noreferrer"&gt;Common Lisp&lt;/a&gt;. I got steered towards &lt;a href="https://janet-lang.org/" rel="noopener noreferrer"&gt;Janet&lt;/a&gt; via &lt;a href="https://ianthehenry.com/" rel="noopener noreferrer"&gt;Ian the Henry's&lt;/a&gt; site and his &lt;a href="https://janet.guide/" rel="noopener noreferrer"&gt;Janet for Mortals&lt;/a&gt; book.&lt;/p&gt;

&lt;p&gt;I'm interested in getting &lt;a href="https://www.raylib.com/index.html" rel="noopener noreferrer"&gt;Raylib&lt;/a&gt; working on web pages and wondered about bending &lt;a href="https://github.com/janet-lang/jaylib" rel="noopener noreferrer"&gt;Jaylib&lt;/a&gt; a bit this way...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sogaiu/jaylib-wasm-demo" rel="noopener noreferrer"&gt;Janet devs have already got Janet and Raylib working in WASM already&lt;/a&gt;. &lt;a href="https://gitlab.com/kreels/jaylib-wasm" rel="noopener noreferrer"&gt;Jaylib-WASM&lt;/a&gt; uses Jaylib (currently supporting Raylib v5) and Raylib v6 and gets about 65 of the &lt;a href="https://www.raylib.com/examples.html" rel="noopener noreferrer"&gt;Raylib v6 Examples&lt;/a&gt; running on a web page.&lt;/p&gt;

&lt;p&gt;The "main loop" concept that Raylib usually uses doesn't work as easily on a web page, so this project uses (suggested by DeepSeek) an update function, similar to &lt;a href="https://love2d.org/wiki/love" rel="noopener noreferrer"&gt;Love for Lua&lt;/a&gt;), to do updates while not "owning" the loop.&lt;/p&gt;

&lt;p&gt;Once the update function is created, the end of the Janet file simply initialises the window and runs the loop.&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="nv"&gt;init-window&lt;/span&gt; &lt;span class="nv"&gt;screen-w&lt;/span&gt; &lt;span class="nv"&gt;screen-h&lt;/span&gt; &lt;span class="s"&gt;"Post-processing Shaders"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;set-target-fps&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;run-game-loop&lt;/span&gt; &lt;span class="nv"&gt;update&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why build this?&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It's been fascinating to see how much pretty good code an Agentic AI tool can create relatively quickly. It make mistakes, but these can be caught in the process. Keeping a good set of tests would help automate this too.&lt;/p&gt;

&lt;p&gt;Doing this little project DeepSeek has been quite affordable and effective for me. Using DeepSeek in this way is possibly not an option that businesses would use. The code is getting completely understood and altered by DeepSeek.&lt;/p&gt;

&lt;p&gt;With all of that said, It's great to be able to put a running demo of an idea up on a web page. All of the Raylib demos do this. Writing the demo in a lisp family tool makes a touch more pleasant and more powerful (macros, REPL, etc).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why Use Janet?&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Janet is an interesting LISP-like language. It's made some interesting decisions with &lt;a href="https://janet.guide/concurrency-and-coroutines/" rel="noopener noreferrer"&gt;fibers for concurrency&lt;/a&gt; and more efficient &lt;a href="https://janet.guide/pegular-expressions/" rel="noopener noreferrer"&gt;Parsing Expression Grammars&lt;/a&gt; (PEGs), rather than regular expressions.&lt;/p&gt;

&lt;p&gt;So far, Janet has felt comfortable as a tool to quickly throw little tools together.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gamedev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Importing month names into SQLite3 can be useful</title>
      <dc:creator>Dave Creelman</dc:creator>
      <pubDate>Tue, 22 Apr 2025 14:01:15 +0000</pubDate>
      <link>https://dev.to/kreely/importing-month-names-into-sqlite3-can-be-useful-165f</link>
      <guid>https://dev.to/kreely/importing-month-names-into-sqlite3-can-be-useful-165f</guid>
      <description>&lt;h2&gt;
  
  
  SQLite3, very compact and very useful
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sqlite.org/docs.html" rel="noopener noreferrer"&gt;SQLite3&lt;/a&gt; is a marvellously useful tool. I've seen it used in finance, image management, system admin...&lt;/p&gt;

&lt;p&gt;It's estimated there are billions of SQLite DBs in use all over the world. Mostly because it's used in Android and Apple phones... there are billions of Android phones alone. Each of these devices use SQLite to make data management easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  But out of the box, it doesn't understand month names
&lt;/h2&gt;

&lt;p&gt;SQLite can import and manipulate dates in several formats. It can generate date strings fairly well. One thing the date handling doesn't have is a function or an &lt;a href="https://sqlite.org/lang_datefunc.html" rel="noopener noreferrer"&gt;SQLite3 based strftime&lt;/a&gt; format code to translate a month's number to its name.&lt;/p&gt;

&lt;p&gt;For developers, month numbers are usually fine (though I can admit to doing quick hand counts mapping month names to numbers) to use when dealing with date based information.&lt;/p&gt;

&lt;p&gt;If your app or tool aims to be straightforward to use, month names are probably easier to understand if you need to display or read date information with your SQLite3 DB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Storing month names in a DB table
&lt;/h2&gt;

&lt;p&gt;The following scripts use &lt;a href="https://www.gnu.org/software/coreutils/manual/html_node/date-invocation.html#date-invocation" rel="noopener noreferrer"&gt;coreutils date&lt;/a&gt; to generate a list of month numbers and corresponding month names. Once this script is run on the DB, month names are available in the table &lt;code&gt;month_numbers_and_names&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The table can be created on a newly created database, or an existing database.&lt;/p&gt;

&lt;p&gt;Save the following snippet of code as something like month_names_from_nums.sh....&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="k"&gt;function &lt;/span&gt;month_names&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
 &lt;span class="nv"&gt;month_num&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1  &lt;span class="c"&gt;#January, in English&lt;/span&gt;
 &lt;span class="nb"&gt;echo &lt;/span&gt;month_number, month_name
 &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;month_num&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;-lt&lt;/span&gt; 13 &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do 
   &lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2000-&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s2"&gt;"%02d"&lt;/span&gt; &lt;span class="nv"&gt;$month_num&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;-01"&lt;/span&gt; +%m,%B&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="o"&gt;((&lt;/span&gt;month_num++&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
 &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the script below as import_dates.sql...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;separator&lt;/span&gt; &lt;span class="nv"&gt;","&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;import&lt;/span&gt; &lt;span class="n"&gt;month_numbers_and_names&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt; &lt;span class="n"&gt;month_numbers_and_names&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create an SQLite3 db, or use an existing one&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;month_names &amp;gt; month_numbers_and_names.csv
sqlite3 my_db.db &amp;lt; import_dates.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this is done, you can open up my_db.db and you'll find the month names in the table month_numbers_and_names...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlite3 my_db.db "select * from month_numbers_and_names;"
month_number   month_name
------------  -----------
01            January    
02            February   
03            March      
04            April      
05            May        
06            June       
07            July       
08            August     
09            September  
10            October    
11            November   
12            December 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Merci, other languages can be supported as well
&lt;/h2&gt;

&lt;p&gt;Conveniently, date will generate month names for other locales if they're needed. To get French dates, we can use the following...&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="nv"&gt;LANG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fr_FR month_names &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; month_numbers_and_names.csv
sqlite3 my_french_db.db &amp;lt; import.dates.sql

sqlite3 my_french_db.db &lt;span class="s2"&gt;"select * from month_numbers_and_names;"&lt;/span&gt;

month_number   month_name
&lt;span class="nt"&gt;------------&lt;/span&gt;  &lt;span class="nt"&gt;-----------&lt;/span&gt;
01            janvier    
02            février    
03            mars       
04            avril      
05            mai        
06            juin       
07            juillet    
08            août       
09            septembre  
10            octobre    
11            novembre   
12            décembre   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can be handy if you have dates going in and out of your app.&lt;/p&gt;

&lt;p&gt;A simpler date passing interface can be had if month names are used. More processing may be able to be done directly on the database, without calling on date libraries.&lt;/p&gt;

&lt;p&gt;So, month name translation for dates is missing in SQLite3, but it's relatively straightforward to add. Internationalisation is possible too (a month_numbers_and_names.locale field would be required if month translations between locales was needed). This is left as an exercise for the reader :-).&lt;/p&gt;

&lt;h2&gt;
  
  
  Can this concept be used with other data too?
&lt;/h2&gt;

&lt;p&gt;Think about other translations and mappings that occur in your app... Could moving this data to a table in SQLite3 make the code lighter, the data more easily available ?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>sql</category>
    </item>
    <item>
      <title>First Post!</title>
      <dc:creator>Dave Creelman</dc:creator>
      <pubDate>Fri, 16 Apr 2021 04:28:26 +0000</pubDate>
      <link>https://dev.to/kreely/first-post-520g</link>
      <guid>https://dev.to/kreely/first-post-520g</guid>
      <description>&lt;p&gt;This is my first post on DevTo.&lt;br&gt;
Learning, learning, always learning!!&lt;/p&gt;

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