Fork me on GitHub
#off-topic
<
2018-05-22
>
akiroz08:05:42

I was just discovering ALGOL68 and just wow, it feels like a modern language 😮

fellshard22:05:40

The industry took a long, dark walk off a short pier around the time MS showed up and turned everything into a C++ hell. It's been a bit of an odyssey getting back to sanity.

benzap09:05:41

wow, I can't believe they made this in 1968

benzap09:05:22

smalltalk was created around then too, I believe

xtreak2911:05:14

Amazing amount of production traffic served with Prolog : https://news.ycombinator.com/item?id=17121351

fabrao14:05:55

Hello all, I´m starting a project that it has to be scalabe itself. I´m researching about BaaS providers and I saw some that closed already, even http://parse.com from Facebook. I saw others that is "vendor lock-in", and others that is limited by APIs for 3rd party integration libs. So, is it worth to use BaaS? This project will integrate with credit cards payments, chatbots, machine learning, file storing, and so one ... Could anyone give me an advice what starting way do I have to go throuth?

val_waeselynck14:05:37

We need to know much more about your use case to be able to help. You don't choose a database primarily for its hosting options, rather for how adapted it is to your querying patterns.

olieidel15:05:43

if you’re looking for an alternative to parse, maybe check out firebase? I agree with @U06GS6P1N however, knowing your use case is far more important

val_waeselynck15:05:56

Yeah, these are typically used for storing individual data in mobile apps - you wouldn't use that at all for e.g e-commerce

olieidel17:05:15

Let’s reduce it to “you wouldn’t use that at all”

borkdude14:05:55

What’s the shortest valid Clojure expression that is also a valid bash expression? https://github.com/borkdude/balcony/commit/97cf0b107bb443c9437a8676090eb147fbbf285a

borkdude14:05:24

":" might do it 🙂

Alex Miller (Clojure team)14:05:41

that’s not a valid Clojure expression

borkdude14:05:50

it’s a string

Alex Miller (Clojure team)14:05:09

oh, sorry I read that wrong

borkdude14:05:02

":";your bash here will make clojure interpret everything after ; be a comment and just parse the string as a value, while bash does nothing before the semicolon and executes the rest

borkdude14:05:39

yes, but that will make bash ignore the entire line 🙂

borkdude14:05:52

since # is a comment in bash

borkdude14:05:16

sorry I didn’t make that requirement clear

borkdude14:05:46

what does that one do?

Alex Miller (Clojure team)14:05:16

expands to positional params

Alex Miller (Clojure team)14:05:42

unlikely to be useful, just golfing :)

Alex Miller (Clojure team)14:05:14

sorry, I guess that should be $*

borkdude14:05:29

yeah… it has to work in the case of valid in both;valid in bash

borkdude14:05:17

so for example expr;ls should preferably only do ls while not giving an error message

borkdude14:05:52

$* isn’t valid clojure

dominicm14:05:23

I suppose '$; wouldn't be valid bash.

Alex Miller (Clojure team)14:05:46

it’s valid clojure data (but you also need eval to work)

borkdude14:05:04

@dominicm that screws up the command after ;

borkdude14:05:52

(it already works, but maybe there are nicer ones)

borkdude14:05:02

command not found

dominicm14:05:23

Interesting, : does nothing in bash

dominicm14:05:29

What about ; alone?

borkdude14:05:30

yeah, it’s the noop

borkdude14:05:38

syntax error

dominicm14:05:51

yeah, I think you'll struggle to beat that one then

Alex Miller (Clojure team)14:05:20

having # be the dispatch character really narrows your options :)

Alex Miller (Clojure team)14:05:56

prob not shortest but has some simplicity to it

borkdude14:05:15

yeah, I like it

Alex Miller (Clojure team)14:05:31

it is less confusing than many other options :)

borkdude14:05:08

that’s the one I already had

borkdude14:05:40

ok true or ":"… beats (> "/dev/null") which is very confusing to people 😉

borkdude14:05:05

@alexmiller should I do anything with caching to make the script run even faster or is this enabled by default?

borkdude14:05:12

I mean classpath caching

borkdude14:05:58

Also I wonder if putting more libs on the classpath without loading them could make it slower

Alex Miller (Clojure team)14:05:04

should work automatically

Alex Miller (Clojure team)14:05:01

my guess would be that it would not have an effect but who knows what kind of startup opts are involved

Alex Miller (Clojure team)14:05:27

there is a tradeoff between laziness and pre-prep, not sure how that is handled

borkdude14:05:24

I mean if I put cider/cider-nrepl {:mvn/version \"0.17.0-SNAPSHOT\"} in my deps.edn. Does this make it slower if I’m not going to require the lib in my program.

Alex Miller (Clojure team)14:05:00

in the words of a wise man named Rich, “why guess when you can test?”

borkdude15:05:01

doesn’t appear to make a difference after the second run

borkdude15:05:02

hmm, funny, it does matter with clj-http

Alex Miller (Clojure team)15:05:40

might depend on whether there are .class files in the jar

borkdude15:05:23

$ time "clj" "-Sdeps" "{:deps {}}" "-e" "(+ 1 2 3)"
# after 2 times
real	0m0.914s

":";clj_http="clj-http {:mvn/version \"3.9.0\"}"
$ time "clj" "-Sdeps" "{:deps {$clj-http}}" "-e" "(+ 1 2 3)"
# after 2 times
real	0m1.907s

borkdude15:05:27

@alexmiller clj-http wraps Apache HTTP stuff, so yes, there will be .class

borkdude15:05:10

I think I could optimize it by using this add-lib functionality, but I don’t know how classpath caching behaves with that one?

borkdude15:05:29

oh I think @mfikes won… >= works

borkdude15:05:19

unless someone comes up with a 1 character one

Alex Miller (Clojure team)15:05:35

well first, add-lib is an experimental feature in a branch and second, there is no classpath caching involved

Alex Miller (Clojure team)15:05:31

at some point, I’m not sure why it’s worth optimizing this - just build a jar and make a native app with graal

Alex Miller (Clojure team)15:05:52

being a script is inherently not optimized

Alex Miller (Clojure team)15:05:10

there are various Clojure compiler flags you could pass too like elide-meta

borkdude15:05:12

“just make a native app with graal” is harder than it sounds though, since there are a lot of things that don’t work with it

borkdude15:05:24

of course I already tried that 🙂

borkdude15:05:41

I’m just playing around, just to see how far I can get

Alex Miller (Clojure team)15:05:44

well “make a jar and run it” is short of that and presumably faster

borkdude15:05:06

true, if I need more speed I can AOT, uberjar and deploy that, but that’s less adventurous.

borkdude15:05:51

I also tried planck, but then I didn’t know how to use proper http libraries

borkdude15:05:57

and e-mail libs

borkdude15:05:00

I could do that in lumo

borkdude15:05:04

but meh, node

borkdude15:05:18

For now this is fine and I’ve had some fun

Alex Miller (Clojure team)15:05:21

-Dclojure.compiler.disable-locals-clearing=true
-Dclojure.compiler.elide-meta="[:doc :file :line :added]"
-Dclojure.compiler.direct-linking=true

borkdude15:05:36

cool, I’ll try!

Alex Miller (Clojure team)15:05:14

in clj, prefix any of those with -J

Alex Miller (Clojure team)15:05:30

clj -J-Dclojure.compiler.disable-locals-clearing=true etc

borkdude15:05:42

#{}; <- comment in both bash and clojure 😉

borkdude16:05:28

@alexmiller I don’t see any noticable effect with direct linking or locals clearing turned off and with $elide_meta I get an error https://github.com/borkdude/balcony/blob/master/balcony.clj#L14

Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection, compiling:(clojure/core/specs/alpha.clj:1:1), compiling:(/Users/Borkdude/Dropbox/dev/clojure/balcony/./balcony.clj:21:1)
Not sure why that happens

borkdude16:05:07

Repro:

bash
tools_cli='org.clojure/tools.cli {:mvn/version "0.3.7"}'
elide_meta='-J-Dclojure.compiler.elide-meta="[:doc :file :line :added]"'
"clj" "$elide_meta" "-Sdeps" "{:deps {$tools_cli}}" "-e" "(require '[clojure.tools.cli])"

Alex Miller (Clojure team)16:05:08

I guess you don’t need the quotes in elide-meta there

solf16:05:31

I'm reinstalling linux on a new laptop and I'm looking to switch from Gnome: anyone knows if there's a DE that has separate workspaces per monitor? (if I change workspace on a monitor, the other monitor doesn't)

borkdude16:05:13

yeah, that’s it

javamonn19:05:16

there’s an upcoming online prolog class for anyone interested: https://twitter.com/SWI_Prolog/status/998443391837859840

4