Skip to content

Instantly share code, notes, and snippets.

View mfikes's full-sized avatar

Mike Fikes mfikes

View GitHub Profile
@mfikes
mfikes / README.md
Last active February 24, 2024 13:43
Playing with BigInt in ClojureScript

Usage

Fire up a REPL using any of the following forms.

Node

clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:git/url "https://github.com/mfikes/clojurescript" :sha "ed1e7373a9ecd8b52084dc438e6c21d23dba47ca"}}}' -m cljs.main -re node
@mfikes
mfikes / fast.md
Last active January 6, 2024 07:19
Fast Clojure REPL

An experimental change for fast Clojure REPL startup:

  1. Download the JAR: clojure-1.8.0-fast.jar
  2. Launch it via java -jar clojure-1.8.0-fast.jar

The code used to create this JAR is on GitHub.

What's it doing?

It is:

@mfikes
mfikes / polyglot.md
Created April 30, 2018 03:02
Polyglot Graal from ClojureScript

You need to first install GraalVM, and then set your PATH so that you get the GraalVM binaries (incluing the GraalVM version of node).

You can then install R and Ruby via

gu -c install org.graalvm.r
gu -c install org.graalvm.ruby
@mfikes
mfikes / cljs.md
Last active January 6, 2024 07:13
cljs command

If you wan't a cljs that acts like clj, but for ClojureScript, there are a few minor changes you can make:

First, add the following entry to ~/.clojure/deps.edn under the :deps key:

org.clojure/clojurescript {:mvn/version "1.10.439"}

Then make copies of clj and clojure named cljs and clojurescript, and put those copies on your path.

@mfikes
mfikes / clojurists-together-clojurescript.md
Last active December 29, 2023 04:52
Clojurists Together Q2 2018 Funding Round - ClojureScript

This page logs work being done under Clojurists Together Q2 2018 Funding Round towards the ClojureScript project. High level progress reports will be published formally with Clojurists Together, but you can follow here if you are interested in low-level details, progress notes, etc.

Themes

The concrete themes identified include:

  • Fixing CLJS-2702, which prevents us from upgrading to newer versions of Closure Library.
  • Work on highly voted ClojureScript tickets. Please take some time and vote in this list of tickets in need of patches.
  • Work on issues related to NPM dependency management. (In particular NPM issues in the list above will be given extra emphasis).
@mfikes
mfikes / README.md
Last active September 24, 2023 13:15
eval in ClojureScript

ClojureScript master now has cljs.core/eval. This delegates to cljs.core/*eval* which, by default throws, but you can bind it to any implementation that can compile and evaluate ClojureScript forms.

If you require the cljs.js namespace (which is the main support namespace for self-hosted ClojureScript), then cljs.core/*eval* is set to an implementation that uses self-hosted ClojureScript for this capability. This means that all self-hosted ClojureScript environments will now have a first-class eval implementation that just works. For example, Planck master:

$ planck -q
cljs.user=> (eval '(+ 2 3))
5
@mfikes
mfikes / main.c
Last active May 14, 2023 16:52
Modified nrf/samples/bluetooth/peripheral_hids_keyboard/main.c
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
#include <zephyr/types.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
@mfikes
mfikes / core.cljs
Created November 7, 2015 00:11
TextInput for ClojureScript + React Native
;; Need to set js/React first so that Om can load
(set! js/React (js/require "react-native/Libraries/react-native/react-native.js"))
(ns future-app.core
(:require [om.core :as om]))
;; Reset js/React back as the form above loads in an different React
(set! js/React (js/require "react-native/Libraries/react-native/react-native.js"))
@mfikes
mfikes / file_io.clj
Created September 9, 2018 15:28
Async file io in Clojure
(ns api-server.file-io
(:use [clojure.tools.logging :only (info warn error)])
(:import (java.nio.channels CompletionHandler AsynchronousFileChannel)
(java.nio ByteBuffer)
(java.nio.file.attribute FileAttribute)
(java.nio.file StandardOpenOption)
(java.util.concurrent Executors))
(:require [clojure.core.async :as async :refer [chan go put! close!]]
[clojure.java.io :as io]))
@mfikes
mfikes / log.txt
Created May 15, 2015 12:45
React Native JSC JIT
[16:53:32] <kjeldahl> Is the comment about the JavaScript Runtime not running with JIT still true, after iOS 8?
[16:59:53] <ide> kjeldahl: yes no JIT unless you run it out of process which is laggy
[17:01:02] <ide> not sure if the JIT matters that much though. like I’m curious if an iphone 6 without the JIT beats a 4s with the JIT
[17:02:25] <kjeldahl> ide: Ok, thx.