<?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: Julien Bisconti</title>
    <description>The latest articles on DEV Community by Julien Bisconti (@veggiemonk).</description>
    <link>https://dev.to/veggiemonk</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%2F347742%2F9c74519e-3191-4ca2-9194-bcabc541e30e.jpeg</url>
      <title>DEV Community: Julien Bisconti</title>
      <link>https://dev.to/veggiemonk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/veggiemonk"/>
    <language>en</language>
    <item>
      <title>Compiling C dependencies for Rust and node-gyp on MacOSX Catalina</title>
      <dc:creator>Julien Bisconti</dc:creator>
      <pubDate>Thu, 19 Mar 2020 11:58:53 +0000</pubDate>
      <link>https://dev.to/veggiemonk/compiling-c-dependencies-for-rust-and-node-gyp-on-macosx-catalina-16mg</link>
      <guid>https://dev.to/veggiemonk/compiling-c-dependencies-for-rust-and-node-gyp-on-macosx-catalina-16mg</guid>
      <description>&lt;h2&gt;
  
  
  Quick story first.
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A weed smoker died. He did bad things during his life and was sent to hell. Arriving there, he saw an endless field of plants (marijuana) and in the middle, sitting there, Jimmy Hendrix and Bob Marley, rolling a massive join. 

He ran towards them and say: - "Hi, big fan, quick question. I thought this was going to be hell! But with all that weed, I must be in heaven. Can we smoke some together?"
Hendrix asks, "Got a lighter ?" 
Smoker replied, "No."
Marley says, "See, man, this is hell".
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I don't smoke weed. I don't even drink alcohol. My addiction is trying GitHub projects.&lt;br&gt;
So I wanted to try a Rust project that I use daily on a freshly installed OSX. &lt;br&gt;
Clone, change dir, &lt;code&gt;cargo build&lt;/code&gt;.&lt;br&gt;
And this is what hell looks like for me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error: failed to run custom build command for `libz-sys v1.0.25`

Caused by:
  process didn't exit successfully: `/Users/julien/code/rust/starship/target/debug/build/libz-sys-42a4bb72600da88a/build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
cargo:rerun-if-changed=build.rs
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
running "cc" "src/smoke.c" "-o" "/dev/null" "-lz"
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/compress.o" "-c" "src/zlib/compress.c"
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/adler32.o" "-c" "src/zlib/adler32.c"
cargo:warning=In file included from src/zlib/compress.c:9:
cargo:warning=In file included from src/zlib/zlib.h:34:
cargo:warning=src/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
cargo:warning=#    include &amp;lt;sys/types.h&amp;gt;      /* for off_t */
cargo:warning=             ^~~~~~~~~~~~~
cargo:warning=1 error generated.
cargo:warning=In file included from src/zlib/adler32.c:8:
cargo:warning=In file included from src/zlib/zutil.h:22:
cargo:warning=In file included from src/zlib/zlib.h:34:
cargo:warning=src/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
cargo:warning=#    include &amp;lt;sys/types.h&amp;gt;      /* for off_t */
cargo:warning=             ^~~~~~~~~~~~~
exit code: 1
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/crc32.o" "-c" "src/zlib/crc32.c"
cargo:warning=1 error generated.
exit code: 1
cargo:warning=In file included from src/zlib/crc32.c:31:
cargo:warning=In file included from src/zlib/zutil.h:22:
cargo:warning=In file included from src/zlib/zlib.h:34:
cargo:warning=src/zlib/zconf.h:444:14: fatal error: 'sys/types.h' file not found
cargo:warning=#    include &amp;lt;sys/types.h&amp;gt;      /* for off_t */
cargo:warning=             ^~~~~~~~~~~~~
cargo:warning=1 error generated.
exit code: 1

--- stderr
src/smoke.c:1:10: fatal error: 'zlib.h' file not found
#include &amp;lt;zlib.h&amp;gt;
         ^~~~~~~~
1 error generated.


error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/julien/code/rust/starship/target/debug/build/libz-sys-fd27be55bdb5100e/out/build/src/zlib/adler32.o" "-c" "src/zlib/adler32.c" with args "cc" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
error: build failed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I've had my fare share of C/C++ compiling errors 15 years ago using Gentoo. &lt;br&gt;
So by reflex, search the internet with the error message: Nothing.&lt;br&gt;
And that's hell. It means, it is my environment and I'm missing some dependecies. &lt;/p&gt;

&lt;p&gt;I check &lt;code&gt;brew info zlib&lt;/code&gt; and&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;==&amp;gt; Caveats
zlib is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It doesn't look good. &lt;/p&gt;

&lt;p&gt;I searched and searched for a ridiculous amount of hours.&lt;br&gt;
Trying nightly versions of Rust, different targets, changing dependencies version, trying to build others Rust projects.&lt;br&gt;
All failed.&lt;/p&gt;

&lt;p&gt;I gave up for the day when I caught myself looking at forum threads from 2012. I felt like being an archeologist mixed with an historian. This has gone too far. Taking a break.&lt;/p&gt;
&lt;h2&gt;
  
  
  Sometimes, you just can't let it go
&lt;/h2&gt;

&lt;p&gt;Still griding at the back of my mind is that compile error. Then I remembered, when in doubt, on OSX, install the full version (9 GB) of XCode to the latest version. I'm sure this will be a common experience for most projects in any language or platform in 2025, if we survive the ripple of COVID-19, that is. Trying and re-trying &lt;code&gt;xcode-select --install&lt;/code&gt; (the lightweight version of XCode) did not change anything. &lt;/p&gt;

&lt;p&gt;I just wanted the banana and got the gorilla holding the banana with the whole jungle. &lt;/p&gt;

&lt;p&gt;Let's try to compile a C program &lt;code&gt;a.c&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;stdio.h&amp;gt;
int main(void){
 printf("Hello world\n");
 return 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Running &lt;code&gt;gcc -o a a.c&lt;/code&gt; works perfectly.&lt;br&gt;
Running &lt;code&gt;make a&lt;/code&gt; throw this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cc     a.c   -o a
a.c:1:9: fatal error: 'stdio.h' file not found
#include&amp;lt;stdio.h&amp;gt;
        ^~~~~~~~~
1 error generated.
make: *** [a] Error 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Ok, we're getting somewhere.
&lt;/h2&gt;

&lt;p&gt;I returned to build the Rust program with different flags to no avail.&lt;/p&gt;

&lt;p&gt;I gave up and went back to a Node.js project. &lt;br&gt;
Change dir, &lt;code&gt;npm install&lt;/code&gt;. &lt;br&gt;
I wonder if there is a competition I don't know about, to see who has the most dependencies.&lt;br&gt;
And hell is there again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ npm install

&amp;gt; fsevents@1.2.11 install /Users/julien/code/awesome-docker/node_modules/fsevents
&amp;gt; node-gyp rebuild

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:53:
In file included from /Users/julien/Library/Caches/node-gyp/12.16.1/include/node/uv.h:52:
In file included from /Users/julien/Library/Caches/node-gyp/12.16.1/include/node/uv/errno.h:25:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/errno.h:32:15: fatal error: 'errno.h' file not found
#include_next &amp;lt;errno.h&amp;gt;
              ^~~~~~~~~
1 error generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/julien/.fnm/node-versions/v12.16.1/installation/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/julien/.fnm/node-versions/v12.16.1/installation/bin/node" "/Users/julien/.fnm/node-versions/v12.16.1/installation/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/julien/code/awesome-docker/node_modules/fsevents
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

audited 9680 packages in 7.655s

31 packages are looking for funding
  run `npm fund` for details

found 10 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What did I do to deserve this? &lt;/p&gt;

&lt;p&gt;Ok let's look at node-gyp.&lt;/p&gt;

&lt;p&gt;Nice, a special page decicated to &lt;a href="https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md"&gt;Catalina&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trying all the steps and debugging everything.&lt;/p&gt;

&lt;p&gt;Nope. Still in hell.&lt;/p&gt;

&lt;p&gt;Maybe I'm thinking about it all wrong. This is not Rust related, it is not node-gyp related, it is OSX Catalina related.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Answer
&lt;/h2&gt;

&lt;p&gt;Stack overflow to the rescue:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave"&gt;https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://apple.stackexchange.com/questions/372032/usr-include-missing-on-macos-catalina-with-xcode-11"&gt;https://apple.stackexchange.com/questions/372032/usr-include-missing-on-macos-catalina-with-xcode-11&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://apple.stackexchange.com/questions/372340/missing-header-files-on-macos-catalina"&gt;https://apple.stackexchange.com/questions/372340/missing-header-files-on-macos-catalina&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, the answer was, the &lt;code&gt;CPATH&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CPATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;xcrun &lt;span class="nt"&gt;--show-sdk-path&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/usr/include"&lt;/span&gt;  &lt;span class="c"&gt;# bash, zsh&lt;/span&gt;
&lt;span class="c"&gt;# or fish shell&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-x&lt;/span&gt; CPATH &lt;span class="o"&gt;(&lt;/span&gt;xcrun &lt;span class="nt"&gt;--show-sdk-path&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;/usr/include 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;Now everything compiles \o/&lt;/p&gt;

&lt;p&gt;What is &lt;code&gt;CPATH&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;CPATH specifies a list of directories to be searched as if specified with -I, but after any paths given with -I options on the command line. This environment variable is used regardless of which language is being preprocessed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Source: &lt;a href="http://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html"&gt;http://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm going to remember that one. I hope it saves someone some pain.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ClojureScript HTTP data fetching</title>
      <dc:creator>Julien Bisconti</dc:creator>
      <pubDate>Wed, 11 Mar 2020 07:29:27 +0000</pubDate>
      <link>https://dev.to/veggiemonk/clojurescript-http-data-fetching-4b67</link>
      <guid>https://dev.to/veggiemonk/clojurescript-http-data-fetching-4b67</guid>
      <description>&lt;p&gt;In ClojureScript, there is a very helpful library that is a wrapper around XHR. It is called &lt;a href="https://github.com/r0man/cljs-http"&gt;cljs-http&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In order to use it, we have to use the &lt;code&gt;core.async&lt;/code&gt; library. &lt;code&gt;core.async&lt;/code&gt; was design to work on the JVM to handle concurrent threads. JavaScript is single threaded but the concept is the same: passing message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple HTTP request
&lt;/h2&gt;

&lt;p&gt;It is  helpful to know how to get data from a server when building a website or an app. It is a simple use case so here is an example of a &lt;code&gt;GET&lt;/code&gt; request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="c1"&gt;;; require core.async and cljs-http&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;example.core&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:require-macros&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cljs.core.async.macros&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:refer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;go&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:require&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cljs-http.client&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cljs.core.async&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:refer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="p"&gt;]]))&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c1"&gt;;; request&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;http/get&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"https://api.github.com/users"&lt;/span&gt;&lt;span class="w"&gt;
                                &lt;/span&gt;&lt;span class="c1"&gt;;; parameters&lt;/span&gt;&lt;span class="w"&gt;
                                 &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="no"&gt;:with-credentials?&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
                                  &lt;/span&gt;&lt;span class="no"&gt;:query-params&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"since"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;135&lt;/span&gt;&lt;span class="p"&gt;}}))]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;prn&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:body&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;;; print the response's body in the console&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By the way, if the server returns data as JSON, the response will be automatically converted to EDN. So there is no extra work than the piece of code outlined above.&lt;br&gt;
Now that you have your data, you have to extract what you need. There is a good tutorial that talks about&lt;br&gt;
&lt;a href="http://xahlee.info/clojure/clojure_binding_forms.html"&gt;destructuring&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Core.async
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;go&lt;/code&gt; macro is part of &lt;code&gt;core.async&lt;/code&gt; library as well as &lt;code&gt;&amp;lt;!&lt;/code&gt; function which is use to extract message from the channel.&lt;br&gt;
You can read all about &lt;a href="http://www.braveclojure.com/core-async/"&gt;concurrent process and channels here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All HTTP functions in &lt;code&gt;cljs-http&lt;/code&gt; return a &lt;code&gt;core.async channel&lt;/code&gt;.&lt;br&gt;
When a request has completed or failed it is written on that channel.&lt;br&gt;
The response can be extracted with the &lt;code&gt;&amp;lt;!&lt;/code&gt; function inside a &lt;code&gt;go&lt;/code&gt; block. I am not completely sure why but I know it has something to do with the fact that &lt;code&gt;go&lt;/code&gt; is a macro. (If you know why, please leave a comment below).&lt;/p&gt;
&lt;h2&gt;
  
  
  Custom Headers
&lt;/h2&gt;

&lt;p&gt;Sometimes you need to add a header such as "Authorization" (Github requires it).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;http/post&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"https://api.github.com/graphql"&lt;/span&gt;&lt;span class="w"&gt;
                                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="no"&gt;:with-credentials?&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
                                 &lt;/span&gt;&lt;span class="no"&gt;:headers&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"Authorization"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"SuperSecretToken1234"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
                                 &lt;/span&gt;&lt;span class="no"&gt;:json-params&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="no"&gt;:query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"query { viewer { login }}"&lt;/span&gt;&lt;span class="p"&gt;}}))]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;prn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:data&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:body&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With that you can go and start testing ClojureScript to your heart's delight and with data coming from a server.&lt;/p&gt;

&lt;p&gt;Happy prototyping...&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
