<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/clojure">
  <channel>
    <title>Clojure</title>
    <link>https://www.linuxjournal.com/tag/clojure</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Creating Linux Command-Line Tools in Clojure</title>
  <link>https://www.linuxjournal.com/content/creating-linux-command-line-tools-clojure</link>
  <description>  &lt;div data-history-node-id="1340130" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/Clojure_logo.jpg" width="800" height="400" alt="Clojure logo" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/mihalis-tsoukalos" lang="" about="https://www.linuxjournal.com/users/mihalis-tsoukalos" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Mihalis Tsoukalos&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;&lt;em&gt;Learn how the leiningen utility can help you manage your Clojure
projects.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;
This article is a gentle introduction to the Clojure Functional
Programming language that is based on LISP, uses the Java JVM and has a handy
REPL. And, as Clojure is based on LISP, be prepared to see lots of
parentheses!
&lt;/p&gt;

&lt;h3&gt;
Installing Clojure&lt;/h3&gt;

&lt;p&gt;
You can install Clojure on a Debian Linux machine by executing the following
command as root or using sudo:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
# apt-get install clojure
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
Finding the version of Clojure you are using is as simple as executing one of
the following commands inside the Clojure REPL, which you can enter by
running &lt;code&gt;clojure&lt;/code&gt;:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
# clojure
Clojure 1.8.0
user=&gt; *clojure-version*
{:major 1, :minor 8, :incremental 0, :qualifier nil}
user=&gt; (clojure-version)
"1.8.0"
user=&gt; (println *clojure-version*)
{:major 1, :minor 8, :incremental 0, :qualifier nil}
nil
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
The first command gets you into the Clojure REPL, which displays the
&lt;code&gt;user=&gt;&lt;/code&gt;
prompt and waits for user input. The remaining three commands that should be
executed within the Clojure REPL will generate the same output, which, in this
example, shows that Clojure version 1.8.0 is being used.
So, if you're following along, congratulations! You
have just run your first Clojure code!
&lt;/p&gt;

&lt;h3&gt;
The leiningen Utility&lt;/h3&gt;

&lt;p&gt;
The first thing you should do after getting Clojure is to install a very
handy utility named leiningen, which is the easiest way to use and manage
Clojure projects on your Linux machine. Follow the instructions at
&lt;a href="https://leiningen.org/#install"&gt;leiningen.org&lt;/a&gt; or use your favourite package manager
to install leiningen on your Linux machine. Additionally, if you are
using Clojure all the time and working with large Clojure projects, tools
like &lt;a href="https://jenkins.io"&gt;Jenkins&lt;/a&gt; and &lt;a href="https://semaphoreci.com"&gt;Semaphore&lt;/a&gt;
will automate your build and test phases and save
you lots of time.
&lt;/p&gt;

&lt;p&gt;
After installing leiningen, use the &lt;code&gt;lein&lt;/code&gt; command (which is the
name of the executable file for the leiningen package) to create a new
project named hw:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
$ lein new hw
Generating a project called hw based on the 'default' template.
The default template is intended for library projects,
not applications. To see other templates (app, plugin, etc),
try `lein help new`.
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
The preceding command will create a new directory named hw that will contain
files and other directories. You'll need to make some changes to some of
the project files in order to execute the project. First, you'll
need to edit the project.clj that can be found inside the hw directory and
make it as follows:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/creating-linux-command-line-tools-clojure" hreflang="en"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Fri, 29 Mar 2019 12:00:00 +0000</pubDate>
    <dc:creator>Mihalis Tsoukalos</dc:creator>
    <guid isPermaLink="false">1340130 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Linux Journal October 2018: Programming</title>
  <link>https://www.linuxjournal.com/content/new-issue-out-linux-journal-october-2018-programming</link>
  <description>  &lt;div data-history-node-id="1340169" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/291_0.png" width="800" height="471" alt="programming issue" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/carlie-fairchild" lang="" about="https://www.linuxjournal.com/users/carlie-fairchild" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Carlie Fairchild&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;Welcome to the Programming issue, October 2018, of &lt;em&gt;Linux Journal&lt;/em&gt;. This month we highlight programming languages new and old including Go, Rust, Clojure and Bash. Take a look at this month's complete line-up:&lt;/p&gt;

&lt;p lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;Featured articles in this issue include:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://www.linuxjournal.com/content/understanding-bash-elements-programming"&gt;Understanding Bash: Elements of Programming&lt;/a&gt;** &lt;em&gt;This article is available online now as a sneak peak in to our October issue.&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;Getting Started with Rust: Working with Files and Doing File I/O&lt;/li&gt;
	&lt;li&gt;Introductory Go Programming Tutorial&lt;/li&gt;
	&lt;li&gt;Creating Linux Command-Line Tools in Clojure&lt;/li&gt;
&lt;/ul&gt;&lt;p lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;Additional articles:&lt;/p&gt;

&lt;ul&gt;&lt;li lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;Shall We Study Amazon's Pricing Together?&lt;/li&gt;
	&lt;li lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;Review: System76 Oryx Pro Laptop&lt;/li&gt;
	&lt;li lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;3D-Printed Firearms Are Blowing Up&lt;/li&gt;
	&lt;li lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;FOSS Project Spotlight: Tutanota, the First Encrypted Email Service with an App on F-Droid&lt;/li&gt;
	&lt;li lang="x-size-14" xml:lang="x-size-14" xml:lang="x-size-14"&gt;Introducing Genius, the Advanced Scientific Calculator for Linux&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Columns:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Kyle Rankin's Hack and /: Papa's Got a Brand New NAS: the Software&lt;/li&gt;
	&lt;li&gt;Shawn Powers' The Open-Source Classroom: Have a Plan for Netplan&lt;/li&gt;
	&lt;li&gt;Reuven M. Lerner's At the Forge: Automate Sysadmin Tasks with Python's os.walk Function&lt;/li&gt;
	&lt;li&gt;Dave Taylor's Work the Shell: Normalizing Filenames and Data with Bash&lt;/li&gt;
	&lt;li&gt;Zack Brown's diff -u: What's New in Kernel Development&lt;/li&gt;
	&lt;li&gt;Glyn Moody's Open Sauce: Now Is the Time to Start Planning for the Post-Android World&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Subscribers&lt;/strong&gt;, you can &lt;a href="https://secure2.linuxjournal.com/pdf/dljdownload.php"&gt;download your October issue&lt;/a&gt; now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not a subscriber?&lt;/strong&gt; It’s not too late. &lt;a href="https://www.linuxjournal.com/subscribe"&gt;Subscribe today&lt;/a&gt; and receive instant access to this and ALL back issues since 1994!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want to buy a single issue?&lt;/strong&gt; Buy the August magazine or other single back issues &lt;a href="https://store.linuxjournal.com/collections/back-issues-of-linux-journal/products/august-2018-issue-of-linux-journal"&gt;in the &lt;em&gt;LJ&lt;/em&gt; store&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/new-issue-out-linux-journal-october-2018-programming" hreflang="en"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Mon, 01 Oct 2018 14:59:55 +0000</pubDate>
    <dc:creator>Carlie Fairchild</dc:creator>
    <guid isPermaLink="false">1340169 at https://www.linuxjournal.com</guid>
    </item>
<item>
  <title>Compojure</title>
  <link>https://www.linuxjournal.com/content/compojure</link>
  <description>  &lt;div data-history-node-id="1224084" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/clojure.jpg" width="480" height="480" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/reuven-lerner" lang="" about="https://www.linuxjournal.com/users/reuven-lerner" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Reuven Lerner&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
&lt;a href="https://www.linuxjournal.com/content/intro-clojure-web"&gt;In my last article&lt;/a&gt;, I started discussing Compojure, a Web framework written
in the Clojure language. Clojure already has generated a great deal
of excitement among software developers, in that it combines the
beauty and expressive elegance of Lisp with the efficiency and
ubiquity of the Java Virtual Machine (JVM). Clojure has other traits
as well, including its famous use of software transactional memory
(STM) to avoid problems in multithreaded environments. 
&lt;/p&gt;

&lt;p&gt;
As a Web developer and a longtime Lisp aficionado, I've been
intrigued by the possibility of writing and deploying Web applications
written in Clojure. Compojure would appear to be a simple framework
for creating Web applications, built on lower-level systems, such as
"ring", which handles HTTP requests.
&lt;/p&gt;

&lt;p&gt;
In my last article, I explained how to create a simple Web
application using the "lein" system, modify the project.clj
configuration file and determine the HTML returned in response to a
particular URL pattern ("route"). Here, I try to advance
the application somewhat, looking at the things that are typically of
interest to Web developers. Even if you don't end up using Clojure or
Compojure, I still think you'll learn something from understanding
how these systems approach the problem.
&lt;/p&gt;


&lt;h3&gt;
Databases and Clojure&lt;/h3&gt;

&lt;p&gt;
Because Clojure is built on the JVM, you can use the same objects in
your Clojure program as you would in a Java program. In other words, if
you
want to connect to a PostgreSQL database, you do so with the same JDBC
driver that Java applications do.
&lt;/p&gt;

&lt;p&gt;
Installing the PostgreSQL JDBC driver requires two steps. First, you
must download the driver, which is available at
&lt;a href="https://jdbc.postgresql.org"&gt;https://jdbc.postgresql.org&lt;/a&gt;. Second, you then must tell the JVM
where it can find the classes that are defined by the driver. This is
done by setting (or adding to) the CLASSPATH environment variable—that is, put the driver in:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
export CLASSPATH=/home/reuven/Downloads:$CLASSPATH
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
Once you have done that, you can tell your Clojure project that you want
to include the PostgreSQL JDBC driver by adding two elements to the
&lt;code&gt;:dependencies&lt;/code&gt; vector within the
&lt;code&gt;defproject&lt;/code&gt; macro:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/compojure" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 26 Dec 2013 21:02:14 +0000</pubDate>
    <dc:creator>Reuven Lerner</dc:creator>
    <guid isPermaLink="false">1224084 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
