This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-05
Channels
- # beginners (240)
- # boot (5)
- # cider (48)
- # clara (2)
- # cljs-dev (3)
- # cljsrn (66)
- # clojure (111)
- # clojure-denver (2)
- # clojure-italy (42)
- # clojure-nl (5)
- # clojure-spec (12)
- # clojure-uk (45)
- # clojurescript (138)
- # community-development (7)
- # core-async (8)
- # datomic (27)
- # emacs (21)
- # euroclojure (6)
- # figwheel (10)
- # fulcro (29)
- # graphql (5)
- # hoplon (3)
- # luminus (1)
- # lumo (7)
- # mount (4)
- # off-topic (13)
- # onyx (20)
- # parinfer (3)
- # pedestal (4)
- # precept (1)
- # proton (3)
- # re-frame (41)
- # reagent (3)
- # reitit (28)
- # ring-swagger (7)
- # shadow-cljs (88)
- # specter (1)
- # testing (10)
- # tools-deps (27)
- # vim (58)
wow, congrats @bronsa & colleghi, roba extra spessa. Bel write-up (almeno l'ho capito anch'io)
Oh wow congrats @bronsa, roba fichissima
Stavo dando un occhio a Toccata https://github.com/Toccata-Lang/toccata qualcuno l'ha mai provato?
che voi sappiate esiste un esempio per un linguaggio minimale su Graal/Truffle usando clojure e non java?
in #off-topic ne stavamo parlando io @ghadi @tbaldridge e @schmee proprio l'altro giorno
questo lisp ci va molto vicino http://cesquivias.github.io
(ma usa Java per farlo se e' quello che intendi @gabriele.carrettoni)
@bronsa quindi diciamo che c'è solo questo per il momento https://gist.github.com/halgari/f03ff8d75bde40903852a1b15dbe61cf
Questo proof of concept https://github.com/jduey/crawl/blob/master/src/crawl/HIR.clj replica in Clojure il procedimento che usa Graal per parsare il bytecode (che sarebbe il mio approccio preferito al problema, saltando Truffle)
(c'e' un po' di prosa nel blog post relativo http://www.clojure.net/2012/05/01/New-Project/)
In realta' non e' mai arrivata. C'e' qualcuno ogni tanto che apprezza e ci fa qualcosa, ma non e' idiomatico
L’unico use case per le monadi in clojure che ho incontrato finora è la Try
monad, che è l’equivalente del do
con Maybe
in Haskell
@bronsa avresti un link (o libro) dove posso vedere una panoramica dei vari stili di parsing funzionali e no? Tipo il dragon book e' buono per questo?
Se vuoi concatenare delle operazioni che possono ritornarti degli errori (e vuoi ritornare l’ultimo errore) passando i risultati intermedi nelle operazioni successive, mlet
(monadic let) + exception
(la Try monad in cats
) è l’unico modo sano
@reborg niente off the top of my head, il dragon book meh, è un po' datato e non è funzionale per niente
@nilrecurring hai un esempio in clojure dove e' stato fatto "male"?
Avevo postato questa cosa su un thread in ML, lo ripesco
@nilrecurring ma Try non dovrebbe essere Either?
È una specializzazione di Either
Spiega la differenza nella doc: (che ho linkato sopra) > It represents a computation that may either result in an exception or return a successfully computed value. Is very similar to the Either monad, but is semantically different. > It consists of two types: Success and Failure. The Success type is a simple wrapper, like Right of the Either monad. But the Failure type is slightly different from Left, because it always wraps an instance of Throwable (or any value in cljs since you can throw arbitrary values in the JavaScript host).
Il punto è che Either propaga l’errore come una condizione programmatica normale, mentre un sacco di librerie sulla JVM tirano eccezioni per segnalare condizioni di “errore” (perchè il type system non è sufficiente per esprimerle correttamente). Quindi la Try
è sostanzialmente Either che wrappa il tutto in un try/catch
ah i bei tempi in cui usavo Either in Java (http://www.functionaljava.org/javadoc/4.4/functionaljava/fj/data/Either.html) ... 😊