A Pen by Michael SALIHI on CodePen.
My answer to: https://www.reddit.com/r/Clojure/comments/pcwypb/us_engineers_love_to_say_the_right_tool_for_the/ which asked to know when and at what is Clojure "the right tool for the job"?
My take is that in general, the right tool for the job actually doesn't matter that much when it comes to programming language.
There are only a few cases where the options of tools that can do a sufficiently good job at the task become limited.
That's why they are called: General-purpose programming languages, because they can be used generally for most use cases without issues.
Let's look at some of the dimensions that make a difference and what I think of Clojure for them:
I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.
- Downloaded GraalVM and set $GRAALVM_HOME
- Found two main libraries for building GraalVM CLIs - https://github.com/luchiniatwork/cambada#packaging-as-a-native-image and https://github.com/taylorwood/clj.native-image (or https://github.com/taylorwood/lein-native-image for the lein equivalent). I chose clj.native-image as it seemed more focused on doing one thing well.
- First tried its template example which was easy to follow.
- Then added a graalvm build to one of our small cli tools
- Found it to be pretty straightforward except for a stdout flushing issue that was trivial to fix
# Installation --- | |
# 1. In Bitbucket, add FTP_USERNAME, FTP_PASSWORD and FTP_HOST as environment variables. | |
# 2. Commit this file (bitbucket-pipelines.yml) to your repo (in the repo root dir) | |
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will | |
# push everything and initialize GitFTP) | |
# | |
# Usage --- | |
# - On each commit to master branch, it'll push all files to the $FTP_HOST | |
# - You also have the option to 'init' (see 'Installation' above) - pushes everything and initialises | |
# - Finally you can also 'deploy-all' (from Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:deploy-all) |
New repo: https://github.com/konradit/gopro-linux
{:paths ["."] | |
:deps {clansi/clansi {:mvn/version "1.0.0"}}} |
-- happy avril 14th :))))))))))))))))))))))))))))))))))))))) | |
do | |
let bars = 4 | |
key = "8" | |
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]" | |
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]" | |
d1 $ slow bars | |
$ stack [ | |
n (righthand + key + "<24 36>/2"), |
<?php | |
// jQuery version of https://gist.github.com/3110728 | |
/* | |
-- the SQL database table | |
create table form_ajax ( | |
ID varchar(5) not null, | |
Name varchar(100), | |
Address varchar(100), |
(ns blog-ring.middleware | |
(:require [ring.middleware.params :refer [wrap-params]] | |
[ring.middleware.keyword-params :refer [wrap-keyword-params]])) | |
((wrap-params identity) | |
{:query-string "clojure=yes&lisp=maybe"}) | |
;; -> {:query-string "clojure=yes&lisp=maybe", | |
;; :form-params {}, | |
;; :params {"clojure" "yes", "lisp" "maybe"}, | |
;; :query-params {"clojure" "yes", "lisp" "maybe"}} |
#!/usr/bin/env bb | |
#_" -*- mode: clojure; -*-" | |
;; Based on https://github.com/babashka/babashka/blob/master/examples/image_viewer.clj | |
(ns http-server | |
(:require [babashka.fs :as fs] | |
[clojure.java.browse :as browse] | |
[clojure.string :as str] | |
[clojure.tools.cli :refer [parse-opts]] | |
[org.httpkit.server :as server] |