Re: Proxy vs. glue class
On Saturday, 5 April 2014 08:08:13 UTC+8, Colin Fleming wrote: > > FWIW, in Cursive, which is a big ball of mixed Clojure + Java, I've given > up trying to use gen-class and have started using Java shims for > everything. I like it a lot more than gen-class, which I always feel like > I'm fighting. With the new Java->Clojure API in 1.6 (or the equivalent > using RT.var() and friends for earlier versions) it's really not that hard, > tool support is much better and IMO it's much cleaner. gen-class will > always indirect method calls through a var but if you're worried about > performance you can get the underlying function object with Java and call > it directly, with the caveat that you then lose the ability to update it > dynamically at the REPL. > > I'd dearly love a deftype-style extend-type or similar which would allow > base class extension. I know it's not encouraged in Clojure but one of > Clojure's fundamental principles is exposing the host where it's pragmatic > to do so, and both proxy and gen-class have some pretty serious warts for > this purpose. > +LOTS for this. I have wanted to extend a Java abstract base class *many* times in Clojure. It's a real pain point, right now. Especially for interop with Java libraries that expect you to extend base classes in order to write plugins etc. Currently when this comes up I just forget about Clojure and write this stuff in Java. IMHO extending reify to support abstract base classes as well as interfaces would be the simplest way to achieve this. FWIW here's the (as yet unaddressed) issue I raised about this on JIRA: http://dev.clojure.org/jira/browse/CLJ-1255 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Proxy vs. glue class
Yeah, it's annoying, no doubt. I have a bunch of classes that do nothing but override a protected method with a public one so I can proxy without warnings, some that I have to use because I can't create a non-trivial constructor, and so forth. Re: your proposal, I think I'd prefer to leave reify et al as they were now, and that continue to be the "encouraged" path. I prefer the idea of having a separate interop form (extend-type, or whatever) although I think it should be able to natively reify protocols etc. Such a form would get pretty complicated if you wanted to be able to do everything a Java class can (create arbitrary constructors or whatever), but a form that works like deftype but: a) can extend a concrete class b) allows me to call supertype methods, including protected ones c) has the generated code inline in the method body (I'll delegate through a var if I want to) d) can reify protocols directly e) can optionally cause its namespace to be require'd in a static initialiser (so the class can be used in IoC containers etc) would be fantastic. I don't think it's unreasonable to expect people to write some Java for more esoteric things (multiple constructors, non-public class access, non-Clojuresque fields, static methods etc), but simple class extension along the lines of the existing interop support doesn't seem like such a bad idea. On 5 April 2014 20:20, Mikera wrote: > On Saturday, 5 April 2014 08:08:13 UTC+8, Colin Fleming wrote: >> >> FWIW, in Cursive, which is a big ball of mixed Clojure + Java, I've given >> up trying to use gen-class and have started using Java shims for >> everything. I like it a lot more than gen-class, which I always feel like >> I'm fighting. With the new Java->Clojure API in 1.6 (or the equivalent >> using RT.var() and friends for earlier versions) it's really not that hard, >> tool support is much better and IMO it's much cleaner. gen-class will >> always indirect method calls through a var but if you're worried about >> performance you can get the underlying function object with Java and call >> it directly, with the caveat that you then lose the ability to update it >> dynamically at the REPL. >> >> I'd dearly love a deftype-style extend-type or similar which would allow >> base class extension. I know it's not encouraged in Clojure but one of >> Clojure's fundamental principles is exposing the host where it's pragmatic >> to do so, and both proxy and gen-class have some pretty serious warts for >> this purpose. >> > > +LOTS for this. I have wanted to extend a Java abstract base class *many* > times in Clojure. It's a real pain point, right now. Especially for interop > with Java libraries that expect you to extend base classes in order to > write plugins etc. Currently when this comes up I just forget about Clojure > and write this stuff in Java. > > IMHO extending reify to support abstract base classes as well as > interfaces would be the simplest way to achieve this. > > FWIW here's the (as yet unaddressed) issue I raised about this on JIRA: > http://dev.clojure.org/jira/browse/CLJ-1255 > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: InvokeDynamic
An interesting paper looking at the languages based on top of the JVM here: http://www.dcs.gla.ac.uk/%7Ewingli/jvm_language_study/jvmlanguages.pdf A presentation based on the above paper here: http://www.dcs.gla.ac.uk/~wingli/jvm_language_study/JVM_Languages_Presentation.pdf -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Treating mutable Java objects as values
I am very new to Clojure so please forgive me if there is an obvious answer that I have missed. I'm trying to understand the effect of interop with Java objects, specifically on the polluting nature of non-values in a system. If I need to interop with a Java library, and that library will have mutable objects, how do I shield the rest of my program from that? I can think of a few solutions but they all seem terrible. 1. Copy all the data from the mutable Java object to a Clojure structure that is a value. This seems incredibly wasteful and in my case probably totally unmanageable due to the GC pressure it would create (I'm working on a game with lots of rapidly mutating Java objects). 2. Create a value-like wrapper that provides a read only interface. This doesn't really cause a memory issue, but now you have a "value'ish" thing floating around that while not modifiable by you can up and change at any moment. 3. Create a wrapper that memoizes data into true values but only as it's accessed. In my case I have an update window that demarcates time into discreet slices. At the end of the frame I could indicate to my "value" that the underlying Java object can no longer be trusted to be the same so all future attempts to access non-memoized values should fail. This works as long as you access the same fields/methods off the Java object down the road. Of course all of these solutions have issues with object graphs and needing to walk the whole graph to fully convert it into a value. So is it worth trying to do anything along this path or is this a fool's errand and I should find some other code organization way to run caution tape all over the place shouting "careful here, this is dangerous highly volitile stuff!"? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Creating user interface for SubSurface Utility Engineering Program
I am new at clojure, I have submitted a proposal named "SubSurface Utility Engineering Program". This program automatically plots the objects in autocad drawing using lisps which saves lots of time of an organization. I able to plot objects just with my lisps which is in only in coding manner. I want to create a user interface for my own lisps which further makes the work so easy. I want suggestions. Can anyone help me out on this?? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Treating mutable Java objects as values
I don't think there is a general answer to this fundamental impedance mismatch, but you might want to look at the implementation of clojure.core/bean: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_proxy.clj#L372 That doesn't provide a deep view but it's a start for approaches #2 and #3 above. Also be wary of this bug: http://dev.clojure.org/jira/browse/CLJ-978 On Sat, Apr 5, 2014 at 4:10 AM, David Koontz wrote: > I am very new to Clojure so please forgive me if there is an obvious > answer that I have missed. I'm trying to understand the effect of interop > with Java objects, specifically on the polluting nature of non-values in a > system. If I need to interop with a Java library, and that library will > have mutable objects, how do I shield the rest of my program from that? I > can think of a few solutions but they all seem terrible. > > 1. Copy all the data from the mutable Java object to a Clojure structure > that is a value. This seems incredibly wasteful and in my case probably > totally unmanageable due to the GC pressure it would create (I'm working on > a game with lots of rapidly mutating Java objects). > > 2. Create a value-like wrapper that provides a read only interface. This > doesn't really cause a memory issue, but now you have a "value'ish" thing > floating around that while not modifiable by you can up and change at any > moment. > > 3. Create a wrapper that memoizes data into true values but only as it's > accessed. In my case I have an update window that demarcates time into > discreet slices. At the end of the frame I could indicate to my "value" > that the underlying Java object can no longer be trusted to be the same so > all future attempts to access non-memoized values should fail. This works > as long as you access the same fields/methods off the Java object down the > road. > > Of course all of these solutions have issues with object graphs and > needing to walk the whole graph to fully convert it into a value. So is it > worth trying to do anything along this path or is this a fool's errand and > I should find some other code organization way to run caution tape all over > the place shouting "careful here, this is dangerous highly volitile stuff!"? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
alternative syntax for Clojure? Haskell?
When I started learning Haskell after a year or more of Clojure, the syntax was refreshing, and I found myself wishing I could write Clojure with Haskell syntax. Later I left Clojure behind for plain Java because of code maintenance issues. I had been writing elegant but deeply nested Clojure code that was very difficult to read and realized that Clojure nurtures this propensity in its users. Though it's possible to write flatter more linear, more readable, more maintainable code, I didn't really want to, and other languages are designed for such. Now I'm coming back to those old discoveries again, and thinking about Clojure, and wondering how much work it would be to write a new Haskell-ish syntax for using Clojure. I was just looking at core.logic tests, which are a perfect example of hard-to-read, using single letter variables, few newlines, and zero comments. To be clear, in this topic I'm not interested in the functional purity of Haskell, nor it's libraries or type system, but just the syntax. Has anyone had a similar experience? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Treating mutable Java objects as values
If it were my project I would simply not modify mutable values. If they're modified outside your own code, then model how they change. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
I find Haskell syntax completely unreadable. Just saying On Apr 5, 2014 11:36 AM, "Travis Wellman" wrote: > When I started learning Haskell after a year or more of Clojure, the > syntax was refreshing, and I found myself wishing I could write Clojure > with Haskell syntax. > > Later I left Clojure behind for plain Java because of code maintenance > issues. I had been writing elegant but deeply nested Clojure code that was > very difficult to read and realized that Clojure nurtures this propensity > in its users. Though it's possible to write flatter more linear, more > readable, more maintainable code, I didn't really want to, and other > languages are designed for such. > > Now I'm coming back to those old discoveries again, and thinking about > Clojure, and wondering how much work it would be to write a new Haskell-ish > syntax for using Clojure. I was just looking at core.logic tests, which are > a perfect example of hard-to-read, using single letter variables, few > newlines, and zero comments. > > To be clear, in this topic I'm not interested in the functional purity of > Haskell, nor it's libraries or type system, but just the syntax. > > Has anyone had a similar experience? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
Clojure syntax (I.e. parentheses) enable features in the language- you can't remove them without sacrificing functionality. Personally, I feel the uniformity of Clojure syntax makes it easier for me to reason about code. When I'm working in a language like, say, Ruby, I have to think ahead about whether or not I need/will need delimiters (e.g. parentheses) depending on how I'm composing code. --- Joseph Smith @solussd > On Apr 5, 2014, at 12:57 PM, Timothy Baldridge wrote: > > I find Haskell syntax completely unreadable. Just saying > >> On Apr 5, 2014 11:36 AM, "Travis Wellman" wrote: >> When I started learning Haskell after a year or more of Clojure, the syntax >> was refreshing, and I found myself wishing I could write Clojure with >> Haskell syntax. >> >> Later I left Clojure behind for plain Java because of code maintenance >> issues. I had been writing elegant but deeply nested Clojure code that was >> very difficult to read and realized that Clojure nurtures this propensity in >> its users. Though it's possible to write flatter more linear, more readable, >> more maintainable code, I didn't really want to, and other languages are >> designed for such. >> >> Now I'm coming back to those old discoveries again, and thinking about >> Clojure, and wondering how much work it would be to write a new Haskell-ish >> syntax for using Clojure. I was just looking at core.logic tests, which are >> a perfect example of hard-to-read, using single letter variables, few >> newlines, and zero comments. >> >> To be clear, in this topic I'm not interested in the functional purity of >> Haskell, nor it's libraries or type system, but just the syntax. >> >> Has anyone had a similar experience? >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with your >> first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
The way I think about syntax is: Given: * my brain has limited processing power (measured in kilo-hertz ?) * my brain has very limited L1 cache Question: * do I want to store the operator-precedence + left/right associativity rules of Haskell operators in my brain * spend brain cycles pattern matching the above to even _read_ the code? :-) Having said that, I also feel, within the limits of (), one can do creative things, like swiss arrows. (-<> ... ( ... <> ... )) This example allows for cool "syntax", but has 0 intellectual overhead. On Sat, Apr 5, 2014 at 11:05 AM, Joseph Smith wrote: > Clojure syntax (I.e. parentheses) enable features in the language- you can't > remove them without sacrificing functionality. > > Personally, I feel the uniformity of Clojure syntax makes it easier for me > to reason about code. When I'm working in a language like, say, Ruby, I have > to think ahead about whether or not I need/will need delimiters (e.g. > parentheses) depending on how I'm composing code. > > --- > Joseph Smith > @solussd > > > On Apr 5, 2014, at 12:57 PM, Timothy Baldridge wrote: > > I find Haskell syntax completely unreadable. Just saying > > On Apr 5, 2014 11:36 AM, "Travis Wellman" wrote: >> >> When I started learning Haskell after a year or more of Clojure, the >> syntax was refreshing, and I found myself wishing I could write Clojure with >> Haskell syntax. >> >> Later I left Clojure behind for plain Java because of code maintenance >> issues. I had been writing elegant but deeply nested Clojure code that was >> very difficult to read and realized that Clojure nurtures this propensity in >> its users. Though it's possible to write flatter more linear, more readable, >> more maintainable code, I didn't really want to, and other languages are >> designed for such. >> >> Now I'm coming back to those old discoveries again, and thinking about >> Clojure, and wondering how much work it would be to write a new Haskell-ish >> syntax for using Clojure. I was just looking at core.logic tests, which are >> a perfect example of hard-to-read, using single letter variables, few >> newlines, and zero comments. >> >> To be clear, in this topic I'm not interested in the functional purity of >> Haskell, nor it's libraries or type system, but just the syntax. >> >> Has anyone had a similar experience? >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are
Re: alternative syntax for Clojure? Haskell?
I always felt that clojure compared to java is about 10x more dense, but only 3x harder to read and write in lines, and the overhead is dependent on the level of abstraction, as it should be. Having only the essence removes noise. Also, in java, raising the level of abstraction generally creates more code, in clojure it creates less. On Saturday, April 5, 2014, t x wrote: > The way I think about syntax is: > > Given: > > * my brain has limited processing power (measured in kilo-hertz ?) > * my brain has very limited L1 cache > > Question: > > * do I want to store the operator-precedence + left/right > associativity rules of Haskell operators in my brain > * spend brain cycles pattern matching the above to even _read_ the code? > > :-) > > > Having said that, I also feel, within the limits of (), one can do > creative things, like swiss arrows. > > (-<> ... >( ... <> ... )) > > This example allows for cool "syntax", but has 0 intellectual overhead. > > On Sat, Apr 5, 2014 at 11:05 AM, Joseph Smith wrote: > > Clojure syntax (I.e. parentheses) enable features in the language- you > can't > > remove them without sacrificing functionality. > > > > Personally, I feel the uniformity of Clojure syntax makes it easier for > me > > to reason about code. When I'm working in a language like, say, Ruby, I > have > > to think ahead about whether or not I need/will need delimiters (e.g. > > parentheses) depending on how I'm composing code. > > > > --- > > Joseph Smith > > @solussd > > > > > > On Apr 5, 2014, at 12:57 PM, Timothy Baldridge > wrote: > > > > I find Haskell syntax completely unreadable. Just saying > > > > On Apr 5, 2014 11:36 AM, "Travis Wellman" wrote: > >> > >> When I started learning Haskell after a year or more of Clojure, the > >> syntax was refreshing, and I found myself wishing I could write Clojure > with > >> Haskell syntax. > >> > >> Later I left Clojure behind for plain Java because of code maintenance > >> issues. I had been writing elegant but deeply nested Clojure code that > was > >> very difficult to read and realized that Clojure nurtures this > propensity in > >> its users. Though it's possible to write flatter more linear, more > readable, > >> more maintainable code, I didn't really want to, and other languages are > >> designed for such. > >> > >> Now I'm coming back to those old discoveries again, and thinking about > >> Clojure, and wondering how much work it would be to write a new > Haskell-ish > >> syntax for using Clojure. I was just looking at core.logic tests, which > are > >> a perfect example of hard-to-read, using single letter variables, few > >> newlines, and zero comments. > >> > >> To be clear, in this topic I'm not interested in the functional purity > of > >> Haskell, nor it's libraries or type system, but just the syntax. > >> > >> Has anyone had a similar experience? > >> > >> -- > >> You received this message because you are subscribed to the Google > >> Groups "Clojure" group. > >> To post to this group, send email to clojure@googlegroups.com > >> Note that posts from new members are moderated - please be patient with > >> your first post. > >> To unsubscribe from this group, send email to > >> clojure+unsubscr...@googlegroups.com > >> For more options, visit this group at > >> http://groups.google.com/group/clojure?hl=en > >> --- > >> You received this message because you are subscribed to the Google > Groups > >> "Clojure" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to clojure+unsubscr...@googlegroups.com. > >> For more options, visit https://groups.google.com/d/optout. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > your > > first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/clojure?hl=en > > --- > > You received this message because you are subscribed to the Google Groups > > "Clojure" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to clojure+unsubscr...@googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options
Re: alternative syntax for Clojure? Haskell?
I can't answer your question from my own experience, but there does seem to be a way to develop your own language on the JVM: https://www.eclipse.org/Xtext/index.html You could create a "DSL" to your precise specifications. Regards, Greg -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
On 05/04/14 19:35, Travis Wellman wrote: To be clear, in this topic I'm not interested in the functional purity of Haskell, nor it's libraries or type system, but just the syntax. It's probably not the answer you're looking for but did you check https://github.com/Frege/frege? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: rant / cljs in cljs ? :-)
If that is your criterion, use something that reloads the browser automatically when the js is changed. I use CodeKit personally. On Wednesday, April 2, 2014 10:09:45 PM UTC+2, lypanov wrote: > > I hate REPLs. I also hate large compile times. > For me the hardest part of the ~5s compile time is not waiting, it's the > watching of the progress of the auto build and waiting until exactly that > moment > before pressing reload in the browser. > > That being said, I find "run this currently selected code block in my > connected browser" functionality in editors (lighttable is the one I > use/know) to be > the best solution to this problem. It's painful as hell at first though. > > I had a work around in the past via a fork of noir-cljs which would delay > the load of the .js files until compile completed via some hacks but > now that I've switched to a browser <> editor work flow I find myself > doing as much work as possible in the editor via the "run it in the browser > REPL" > script tag trick from lighttable that I'm no longer even noticing compile > times. I leave them to the end of the pomodoro. > > On Friday, March 21, 2014 7:48:59 AM UTC+1, t x wrote: > >> Hi, >> >> * I'm already using: >> >> :incremental true >> :compiler { :optimizations :none } >> >> * I'm also aware of cljs brepl >> >> >> However: >> >> 1) the cljs compiler is still too slow for my liking (even though it's >> not calling closure) >> >> 2) I don't like the cljs repl nearly as much as I like the clj repl >> >> >> Now, my dumb/stupid question: >> >> Is there any cljs in cljs _slow_ interpreter? I'm perfectly happy >> with an interpreter that runs 10x slower, if, in exchange, I get to >> hit "refresh" and my new code starts running. >> >> Furthermore, I'm _okay_ with their being a big delay every time I >> introduce a new macro from clj land. >> >> >> I realize this sounds spoiled -- but -- the cljs compiler delays are >> really really breaking my flow. >> >> >> Thanks! >> > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
Francois Rey, Yes I've been following that project. They're going for purity, which means reimplementing a lot of standard java stuff in Frege. Cool project, but what I really want is Clojure. Everything Clojure without the parens. So you'd get lists, and homoiconicity, and all the Clojure libs, but it would look different. Part of posting here is to gauge whether, if I wrote such a thing to scratch my own itch, anyone else would like it. So far I'm getting a pretty sincere "no" it seems. It's partially a bad survey because the people here are the people who like it here. Greg, Xtext is new to me, I'll look at it. Antlr is used in a project I'm getting paid for right now, so I might try that. Gary, I think this is the essence of the maintainability problem. The terseness of Clojure is pleasurable to the programmer, and they don't compensate with documentation or longer function names. What you get is a short statement that requires detangling levels of macros and abstractions to understand. Honestly I wish programmers had to pay $20 to write a macro. Macros are great but should very very rarely be used. Granted none of this would be fundamentally changed with a new syntax, but I feel like if one didn't begin a line with a paren, one might begin more lines instead of nesting deeper; I could easily be wrong about that. Travis -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
Without parenthesis you have to resolve ambiguity through other means such as the off-side rule, additional operators. Clojure makes it easy to write dense code that is hard to maintain, but some of your trouble might be resolved by structuring your code differently. One example would be Prismatic's Plumbing https://github.com/prismatic/plumbing I haven't looked to see if anyone has written a version of ML for the JVM, but if they have it may be what you are looking for. http://en.wikipedia.org/wiki/Category:ML_programming_language_family -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
At least in my case, this process of mental macro/functioncall expansion, or 'abstraction-surfing' as I like to call it, got easier over time. I feel like it's been a general skill to hone for programming in general, and lisp emphasizes this more than anything else I've seen, but maybe I just drank the kool-aid :-). I'd like to warp my brain with Haskell someday. On Saturday, April 5, 2014, Tyler Anderson wrote: > Without parenthesis you have to resolve ambiguity through other means such > as the off-side rule, additional operators. Clojure makes it easy to write > dense code that is hard to maintain, but some of your trouble might be > resolved by structuring your code differently. One example would be > Prismatic's Plumbing https://github.com/prismatic/plumbing > > I haven't looked to see if anyone has written a version of ML for the JVM, > but if they have it may be what you are looking for. > http://en.wikipedia.org/wiki/Category:ML_programming_language_family > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to > clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to > clojure+unsubscr...@googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
It's a sincere no from me, but I can tell you I've met plenty of non-clojurites/lispers who sneer at lisp it seems solely due to the parentheses. It seems misguided to me though. On Saturday, April 5, 2014 1:14:36 PM UTC-7, Travis Wellman wrote: > > Francois Rey, > > Yes I've been following that project. They're going for purity, which > means reimplementing a lot of standard java stuff in Frege. Cool project, > but what I really want is Clojure. Everything Clojure without the parens. > So you'd get lists, and homoiconicity, and all the Clojure libs, but it > would look different. > > Part of posting here is to gauge whether, if I wrote such a thing to > scratch my own itch, anyone else would like it. So far I'm getting a pretty > sincere "no" it seems. It's partially a bad survey because the people here > are the people who like it here. > > Greg, Xtext is new to me, I'll look at it. Antlr is used in a project I'm > getting paid for right now, so I might try that. > > Gary, I think this is the essence of the maintainability problem. The > terseness of Clojure is pleasurable to the programmer, and they don't > compensate with documentation or longer function names. What you get is a > short statement that requires detangling levels of macros and abstractions > to understand. Honestly I wish programmers had to pay $20 to write a macro. > Macros are great but should very very rarely be used. Granted none of this > would be fundamentally changed with a new syntax, but I feel like if one > didn't begin a line with a paren, one might begin more lines instead of > nesting deeper; I could easily be wrong about that. > > Travis > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: rant / cljs in cljs ? :-)
or livejs http://livejs.com/ On Sunday, 6 April 2014 04:58:51 UTC+10, Henrik Eneroth wrote: > > If that is your criterion, use something that reloads the browser > automatically when the js is changed. I use CodeKit personally. > > On Wednesday, April 2, 2014 10:09:45 PM UTC+2, lypanov wrote: >> >> I hate REPLs. I also hate large compile times. >> For me the hardest part of the ~5s compile time is not waiting, it's the >> watching of the progress of the auto build and waiting until exactly that >> moment >> before pressing reload in the browser. >> >> That being said, I find "run this currently selected code block in my >> connected browser" functionality in editors (lighttable is the one I >> use/know) to be >> the best solution to this problem. It's painful as hell at first though. >> >> I had a work around in the past via a fork of noir-cljs which would delay >> the load of the .js files until compile completed via some hacks but >> now that I've switched to a browser <> editor work flow I find myself >> doing as much work as possible in the editor via the "run it in the browser >> REPL" >> script tag trick from lighttable that I'm no longer even noticing >> compile times. I leave them to the end of the pomodoro. >> >> On Friday, March 21, 2014 7:48:59 AM UTC+1, t x wrote: >> >>> Hi, >>> >>> * I'm already using: >>> >>> :incremental true >>> :compiler { :optimizations :none } >>> >>> * I'm also aware of cljs brepl >>> >>> >>> However: >>> >>> 1) the cljs compiler is still too slow for my liking (even though it's >>> not calling closure) >>> >>> 2) I don't like the cljs repl nearly as much as I like the clj repl >>> >>> >>> Now, my dumb/stupid question: >>> >>> Is there any cljs in cljs _slow_ interpreter? I'm perfectly happy >>> with an interpreter that runs 10x slower, if, in exchange, I get to >>> hit "refresh" and my new code starts running. >>> >>> Furthermore, I'm _okay_ with their being a big delay every time I >>> introduce a new macro from clj land. >>> >>> >>> I realize this sounds spoiled -- but -- the cljs compiler delays are >>> really really breaking my flow. >>> >>> >>> Thanks! >>> >> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
In the original post: > I had been writing elegant but deeply nested Clojure code that was very difficult to read ... I focus on expressivity, specifically because of the write-only phenomenom. This isn't peculiar to clojure; this happened a lot in the Perl days (so much so, that that's where I remember "write-only code" being coined). I've seen it with Scheme, Lua, and JavaScript as well. Some people see it as a flaw of the language, but it's actually the flexibility of the language that allows it. And that's why many people have said things like this: "Write your code _first_ for people to read. You needn't worry about the compiler, it will have much less trouble understanding it than the people if it's correct." (That's my phrasing.) So, I wouldn't call code "elegant" if _you_ have trouble reading it when you come back to it. The algorithm could be elegant, but not the code. This is just how I use the word, though... I don't get to define it. > Though it's possible to write flatter more linear, more readable, more maintainable code, I didn't really want to, and ... What you wrote sounds to me very much like, "I had some pain, and I learned that what I did caused the pain, and I figured out how to fix the pain... but I'd rather not" That *apparent* contradiction suggests to me that you skipped the important part about what you really like about that, and I'm very curious... Why didn't you want to write the easier-to-read code? -Jason -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
On Saturday, April 5, 2014 5:51:10 PM UTC-7, Jason Felice wrote: > > In the original post: > > > I had been writing elegant but deeply nested Clojure code that was very > difficult to read ... > > I focus on expressivity, specifically because of the write-only > phenomenom. This isn't peculiar to clojure; this happened a lot in the > Perl days (so much so, that that's where I remember "write-only code" being > coined). I've seen it with Scheme, Lua, and JavaScript as well. Some > people see it as a flaw of the language, but it's actually the flexibility > of the language that allows it. > Very true. I often compare Clojure to Perl when it comes up in conversation. It may not be a flaw of the language itself, but I think I can say it's a flaw of most of the code the community has written in the language. I try not to make complaints without looking for a hint of a solution to present as well, and so I'm thinking about the syntax. > > And that's why many people have said things like this: "Write your code > _first_ for people to read. You needn't worry about the compiler, it will > have much less trouble understanding it than the people if it's correct." > (That's my phrasing.) > Good advice rarely taken. > > So, I wouldn't call code "elegant" if _you_ have trouble reading it when > you come back to it. The algorithm could be elegant, but not the code. > This is just how I use the word, though... I don't get to define it. > There is beautiful code, and there are elegant solutions. I use the word differently, but I get your meaning. > > > Though it's possible to write flatter more linear, more readable, more > maintainable code, I didn't really want to, and ... > > What you wrote sounds to me very much like, "I had some pain, and I > learned that what I did caused the pain, and I figured out how to fix the > pain... but I'd rather not" That *apparent* contradiction suggests to me > that you skipped the important part about what you really like about that, > and I'm very curious... Why didn't you want to write the easier-to-read > code? > There's the meat. I feel like the syntax of nested parens leads me and others to think in terms of nested function calls. The fastest way to get Clojure from the brain to the file leaves "write only" code, and we're all impatient. Certainly I take time to beautify and document sometimes, but that will always be secondary to getting it to run. I appreciate your thoughts Jason. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: alternative syntax for Clojure? Haskell?
On Saturday, April 5, 2014 3:04:01 PM UTC-7, Gary Trakhman wrote: > > At least in my case, this process of mental macro/functioncall expansion, > or 'abstraction-surfing' as I like to call it, got easier over time. I > feel like it's been a general skill to hone for programming in general, and > lisp emphasizes this more than anything else I've seen, but maybe I just > drank the kool-aid :-). I'm not too bad at abstraction surfing, but it's always going to be time consuming when you didn't design the abstractions yourself, or designed them long ago. > I'd like to warp my brain with Haskell someday. > I highly recommend it, even if you don't end up using it daily. > > On Saturday, April 5, 2014, Tyler Anderson > > wrote: > >> Without parenthesis you have to resolve ambiguity through other means >> such as the off-side rule, additional operators. Clojure makes it easy to >> write dense code that is hard to maintain, but some of your trouble might >> be resolved by structuring your code differently. One example would be >> Prismatic's Plumbing https://github.com/prismatic/plumbing >> > That's a good one I'll be sure to use next time I write some Clojure. > >> I haven't looked to see if anyone has written a version of ML for the >> JVM, but if they have it may be what you are looking for. >> http://en.wikipedia.org/wiki/Category:ML_programming_language_family >> > There's MLj http://research.microsoft.com/en-us/um/people/nick/mlj.htm -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.