Re: Reducing the pain of a clojars outage

2016-01-02 Thread Mikhail Kryshen
I would suggest also considering decentralized technologies. IPFS (https://ipfs.io/) looks like a good fit for the task. - It is distributed, every node used to access the repository will contribute to it's availability. - Directory trees in IPFS work like Clojure's persistent data structures

Re: OT: Github Alternatives

2014-06-30 Thread Mikhail Kryshen
I would recommend Fossil (http://fossil-scm.org/) — a distributed version control system with integrated distributed bug tracker, wiki and blog, all of which are accessed through a built-in web server. <#secure method=pgpmime mode=sign> Adrian Mowat writes: > Hi All, > > Sorry for the off topic

Re: GSoC Report: CinC, port of the clojure compiler in clojure

2013-10-09 Thread Mikhail Kryshen
Nicola Mometto writes: > I don't think that's what Mike was talking about. > Say we have (defn x ^long [] 1), clojure will use the IFn$L and emit an > "public long invokePrim()" method. > > When we do (defn y [] (let [a (x)] a) the compiler will call .invokePrim > instead of invoke. > > If we red

Re: GSoC Report: CinC, port of the clojure compiler in clojure

2013-10-08 Thread Mikhail Kryshen
Mikera writes: > 2) This in turn means we are going to have to "recompile" if we want to > retain any sort of dynamic behaviour. The current system of independently > mutable vars won't work (for obvious reasons: changing a var could easily > violate the previous type inference assumptions)

Re: Clojure generates unnecessary and slow type-checks

2013-06-14 Thread Mikhail Kryshen
JIT will probably remove unnecessary checkcast instructions. What looks suspicious to me is that i and asize are converted to longs (notice i2l opcodes). I noticed earlier that loops with long counters are measurably slower for the same number of iterations (probably, HotSpot does not apply some op

Re: In what OS do you code?

2013-06-14 Thread Mikhail Kryshen
"Yves S. Garret" writes: > Truthfully, they're not shy when it comes to things such as DRM, closing off > previous more open standards/software and just don't really give back to the > OSS community as much as they take. I think it would be naive to expect ethical behaviour from any large corpor

Re: In what OS do you code?

2013-06-14 Thread Mikhail Kryshen
I use GNU/Linux (specifically, Fedora at home and openSUSE, which I don't like much compared to other distros, at work): - I do not trust proprietary software vendors, - I avoid supporting Microsoft and Apple out of ethical issues, - I prefer the software distribution model where software comes fro

Re: Quirk with printing regexps

2013-03-28 Thread Mikhail Kryshen
On Thu, 28 Mar 2013 17:08:46 -0700 Mark Engelberg wrote: > Bug or feature? Certainly a feature for complex patterns with whitespace and embedded comments. For example, the following regexp parses line in Combined Log Format used by Apache httpd and other web servers: (def clf-pattern #"(?x)^

Re: Quirk with printing regexps

2013-03-28 Thread Mikhail Kryshen
On Fri, 29 Mar 2013 05:32:52 +0400 Mikhail Kryshen wrote: > (re-pattern "a\nb") returns regexp pattern that contains the newline > char literally. > > (re-patter "a\\\nb") returns pattern that contains '\n' (two-char > sequence). ^ should be (

Re: Quirk with printing regexps

2013-03-28 Thread Mikhail Kryshen
(re-pattern "a\nb") returns regexp pattern that contains the newline char literally. (re-patter "a\\\nb") returns pattern that contains '\n' (two-char sequence). These are not the same. '\n' always matches newline, while literal newline will be ignored if ?x flag is present. => (re-matches (re-p

Re: Clojure - Python Style suggestion

2013-02-04 Thread Mikhail Kryshen
The problem of readability of S-expressions has been discussed since the beginnings of Lisp. Some known alternative notations: http://en.wikipedia.org/wiki/M-expression http://readable.sourceforge.net/ On Mon, 4 Feb 2013 22:01:30 +0200 Sergey Didenko wrote: > Hi, > > For us as Clojure communi

Re: How do I set jvm options for a lein repl

2012-05-21 Thread Mikhail Kryshen
Also there is an environment variable _JAVA_OPTIONS (note the leading underscore) which is handled by the HotSpot JVM (OpenJDK or Oracle JDK) and can be used with any java application. -- Mikhail -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Performance of thread-local binding

2012-03-03 Thread Mikhail Kryshen
If I understand Clojure's dynamic vars correctly, in a context where some var *bar* is already thread-bound, the following code: (binding [*bar* new-val] (foo)) is semantically equivalent to: (let [old-val *bar*] (set! *bar* new-val) (try (foo) (finally (set! *bar* ol

Re: clojure.core/max and NaN

2011-10-30 Thread Mikhail Kryshen
Why does Clojure have it's own naive implementation of max for doubles instead of using max from java.lang.Math which has necessary checks for NaN and the positive and negative zeros? On Sun, 30 Oct 2011 15:36:23 +0100 Ben Smith-Mannschott wrote: > On Sun, Oct 30, 2011 at 10:02, bOR_ wrote: > >

Re: Hygenic approach for using Java2D from Clojure?

2011-06-29 Thread Mikhail Kryshen
Here are some ideas I used in Indyvon (https://bitbucket.org/kryshen/ indyvon). * Methods that modify graphics context (java.awt.Graphics2D instance) are wrapped in with- macros, e.g. with-color sets the current color to the specified value, executes body in try block, and resets the color to the

Re: A stupid jvm question

2011-06-17 Thread Mikhail Kryshen
On Fri, 17 Jun 2011 03:09:46 -0700 (PDT) flebber wrote: > I apologise for the stupidity of this question in advance. > > Just want to clarify. The jvm is great for other languages to be > hosted on clojure, jruby, scala, jython...etc. But what would be > really cool is if we could use the jvm to

Re: minor pauses

2011-04-08 Thread Mikhail Kryshen
I once wrote a Clojure app that communicates with jackd audio server through JNA in real time. It periodically fills an audio buffer and calls a couple of native functions, and it works reliably with an audio buffer of 10ms. I tried it under OpenJDK on Linux. So the HotSpot VM used in OpenJDK and

Re: 1.3 master commit for lazy defn loading

2011-04-07 Thread Mikhail Kryshen
Looks like it is a bug in Clojure. Create foo.clj: (ns foo) (let [] (defn foo [] :foo)) Then call foo from REPL: $ java -cp .:clojure-1.3.0-alpha6.jar clojure.main Clojure 1.3.0-alpha6 user=> (use 'foo) nil user=> (foo) ClassNotFoundException foo$eval9$foo__10 java.lang.Class.forName0 (Class

Re: Throwing an Exception with get

2011-03-21 Thread Mikhail Kryshen
On Mon, 21 Mar 2011 07:52:45 -0700 (PDT) Jonathan Smith wrote: > Here is a way that should work. > > (let [missing (gensym)] > (defn get-with-exception [map key] > (let [res (get map key missing)] > (if (= res missing) > (throw (new Exception "my-exception")) > res

Re: [Code Bounty] Implementing "ClojureScript" - command-line/sys-admin scripting with Clojure

2011-03-04 Thread Mikhail Kryshen
On Fri, 4 Mar 2011 10:41:20 -0800 (PST) Stuart Sierra wrote: > There are difficulties with using Clojure -- or any JVM language -- for > system administration. The first and biggest is the JVM startup time, > making it impractical for command-line use without a separate "server" > process.

Re: Ordering of defn's?

2011-02-22 Thread Mikhail Kryshen
On Tue, 22 Feb 2011 16:12:50 -0800 (PST) Jonathan Mitchem wrote: > Hm, I see now. Does Java work like that too? (C# doesn't.) No. > Are there any plans for this to change in the future? I can work with > it now, but it makes me uncomfortable. It feels like a step > backwards. > > I fully u

Re: Type hinting question

2011-02-12 Thread Mikhail Kryshen
Java SDK includes javap bytecode disassembler. And you can compile Java without creating project structure. $ emacs Test.java $ javac Test.java $ javap -c Test Results: public class Test { public static String hello() { final StringBuilder sb = new StringBuilder(); sb.append

Re: Any news on pull requests?

2011-02-05 Thread Mikhail Kryshen
As I understand it (and I might be wrong), there are basically two types of open source projects regarding copyright and Contributor Agreement. The first type are projects where contributors hold exclusive copyright on their contributions. These projects often does not require contributors to sign

Re: get the total memory used by a data structure?

2010-12-23 Thread Mikhail Kryshen
If you want to know how your program uses memory, try using some Java profiling tool like VisualVM shipped with JDK. On Wed, 22 Dec 2010 23:51:48 -0500 Robert McIntyre wrote: > I think it would be really cool to have a function that gives the > total number of bytes that a data structure consume

Re: Native Clojure

2010-12-20 Thread Mikhail Kryshen
On Mon, 20 Dec 2010 12:19:59 -0500 Ken Wesson wrote: > Has anyone tried compiling a Clojure project (along with Clojure > itself) with gcj or jet? I tried to compile Clojure 1.2 with GCJ. To avoid compilation errors I had to replace some classes in GNU Classpath with versions from OpenJDK. Still

Re: [OT] ASF loses Java showdown vote to Oracle

2010-12-07 Thread Mikhail Kryshen
I don't think it will affect Clojure and OpenJDK communities much. Apache always wanted to have a certified Java implementation under permissive license. They probably get sponsor money for not using copyleft licenses like GPL [1]. Also, I recommend the recent talk by James Gosling on Apple, Apac

Re: Jython Interoperability problem

2010-11-01 Thread Mikhail Kryshen
Consider using some implementation of persistent data structures that does not depend on Clojure. Clojure's data structures modified for use outside of Clojure: http://github.com/krukow/clj-ds Persistent analogue of the Java Collections Framework: http://code.google.com/p/pcollections/ On Fri, 2

ANN: Indyvon - GUI library

2010-09-07 Thread Mikhail Kryshen
Hi, I have recently published Indyvon -- an experimental multithreaded GUI library for Clojure. The main idea behind the library is that base UI element (called "layer") does not define any state (has no location, size, parent element). Dynamic layout of layers is captured at the rendering time an

Re: More urgency for CinC & CLR given Oracle's lawsuit against Google?

2010-08-13 Thread Mikhail Kryshen
CLR also infringes Oracle's patents and the only reason why Oracle is not likely to sue Microsoft is that Microsoft could do the same to Oracle. See http://jonathanischwartz.wordpress.com/2010/03/09/good-artists-copy-great-artists-steal/ Mono - the open source implementation of .NET also has unc

Re: Clojure servlet in tomcat - issues with -security option

2010-07-29 Thread Mikhail Kryshen
Dynamic compilation and loading of java bytecode is not possible in sandbox mode. You may try to AOT-compile your clojure code and use gen-class to generate servlet instead of invoking clojure from java. See http://clojure.org/compilation -- Mikhail -- You received this message because you are

Re: Idiomatic Clojure namespace names

2010-07-10 Thread Mikhail Kryshen
On 10 июл, 14:42, Jeff Rose wrote: > I also disagree with this concept of putting the language in the > package name. One of the benefits of compiling down to a common > runtime is that we don't need to care what language something was > written in. I think this kind of meta-data, along with the

Re: Which GUI toolkit would you like to see wrapped in an idiomatic Clojure library?

2010-05-28 Thread Mikhail Kryshen
I vote for Swing. Swing components conform to JavaBeans specification, so a generic Clojure library to construct and manipulate JavaBeans would make a large part of the GUI framework. On 27 май, 19:18, Luke VanderHart wrote: > My side project is a fairly complex GUI application written in > Cloj

Re: Dynamic use of protocols

2010-05-18 Thread Mikhail Kryshen
ash map for local > bindings. > > Sean > > On May 17, 10:41 am, Mikhail Kryshen wrote: > > > > > > > On 17 май, 12:07, Laurent PETIT wrote: > > > > Yes, > > > > as David wrote, > > > > What you're describing is not

Re: Dynamic use of protocols

2010-05-17 Thread Mikhail Kryshen
On 17 май, 12:07, Laurent PETIT wrote: > Yes, > > as David wrote, > > What you're describing is not single-dispatch-based polymorphism (e.g. > like in java), it's double dispatch (because you want to dispatch to > the implementation of the protocol function based on both the type and > another par

Re: Dynamic use of protocols

2010-05-16 Thread Mikhail Kryshen
On 16 май, 05:57, ataggart wrote: > Perhaps you misunderstand protocols.  Protocols don't support a > hierarchy, thus you don't extend them; you have types implement/reify > them.  Any "extending" you do will be against a type. By extending the protocol I mean "extending the polymorphism of the p

Re: Dynamic use of protocols

2010-05-16 Thread Mikhail Kryshen
On 16 май, 05:57, ataggart wrote: > Perhaps you misunderstand protocols.  Protocols don't support a > hierarchy, thus you don't extend them; you have types implement/reify > them.  Any "extending" you do will be against a type. By extending the protocol I mean "extending the polymorphism of the p

Dynamic use of protocols

2010-05-15 Thread Mikhail Kryshen
Hi, I'm developing visualization component for some application. There is a protocol to be extended to existing application problem domain classes to specify how to visualize each type. The user can load predefined implementations of the protocol or create custom visualizations in REPL. The probl