[julia-users] Re: Specify type for a list of variables

2014-07-21 Thread Noah Brenowitz
That is pretty cool! Thanks. On Sunday, July 20, 2014 7:41:18 PM UTC-4, Pierre-Yves Gérardy wrote: I don't think it is supported out of the box, but you can achieve that with a macro. julia macro as(Typ, names...) res = quote end for n in names

Re: [julia-users] iterate over rows of sparse matrix and get index of nonzeros?

2014-07-21 Thread Florian Oswald
Transposing is fine! Thanks for that! On Sunday, 20 July 2014, Odd Andersen odd.ander...@gmail.com wrote: Sparse matrices in Julia are to my understanding stored as compressed sparse columns. So it is very easy to get the nonzero elements for a given column, but not so easy for rows. To

Re: [julia-users] Re: Julia with LightTable

2014-07-21 Thread Zahirul ALAM
I have it in the following way :app [(:lt.objs.style/set-skin dark) (:lt.objs.langs.julia/julia-path C:\\Julia\\bin\\julia.exe) ] and it works On Sunday, 20 July 2014 22:15:15 UTC-4, Diego Tapias wrote: Thank you @Joshua. That's what I got (I have followed the

Re: [julia-users] Julia with LightTable

2014-07-21 Thread Keno Fischer
Your version of julia may be too old. How did you install julia? On Sun, Jul 20, 2014 at 4:12 PM, Diego Tapias dandrove...@gmail.com wrote: I have got the following error whenever I try to run a Julia Script with the editor LightTable: Couldn't connect to Julia ERROR: REPLCompletions not

[julia-users] Re: Sorting behavior

2014-07-21 Thread Ivar Nesje
1. It clearly isn't. 2. It will not cause any overhead in the common case (because it would be a separate method in Julia). The question is whether this is a case where we should guess what the user intended, or force the user to fix a potential problem. Not sure what we could do about this

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Andrei
Great write up! After some experiments I was able to reduce GC time from 65% to only 15% and see opportunities to do even better. Most important things for me were: 1. Some BLAS functions (especially gemm!, which is pretty flexible). 2. Manual devectorization (@devec didn't work for my case).

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Tim Holy
On Monday, July 21, 2014 02:33:26 PM Andrei wrote: I see one disadvantage of using these tools, however - they are much harder to read. Are there any plans for automatic code optimization on compiler level? There are already many optimizations in place. But there's always more you could do.

[julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2014-07-21 Thread johannibrea
On Saturday, January 25, 2014 8:41:08 PM UTC+1, Johan Sigfrids wrote: On Saturday, January 25, 2014 9:24:17 PM UTC+2, Jason Merrill wrote: mma data = RandomReal[1.,1*^7]; min = .2; max = .3; mma Total@Unitize@Clip[data,{min,max},{0,0}] I claim that it takes *a lot* of experience to

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Andrei
Could you please point me to where these optimizations take place? I see some other transformations (like escape analysis, for example) happening in codegen, are there any other places I should look at? On Mon, Jul 21, 2014 at 2:43 PM, Tim Holy tim.h...@gmail.com wrote: On Monday, July 21,

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Jake Bolewski
Julia-syntax.scm (code lowering to ssa form) and type inference in base (type propagation, data flow analysis, inlining) are other places where julia performs compiler optimizations.

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Tim Holy
codegen is a big one, as are inference.jl, gf.c, and cgutils.cpp. But there are optimization sprinkled throughout (e.g., ccall.cpp). You might be interested in this: https://github.com/JuliaLang/julia/issues/3440 Most of the optimizations so far are low level; most of the higher-level stuff

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Alessandro Jake Andrioni
InplaceOps.jl is another package that can help: it substitutes some matrix operations with their mutable BLAS-based equivalents. On 21 July 2014 10:10, Tim Holy tim.h...@gmail.com wrote: codegen is a big one, as are inference.jl, gf.c, and cgutils.cpp. But there are optimization sprinkled

Re: [julia-users] Re: Sorting behavior

2014-07-21 Thread Leah Hanson
I agree that the `[a b c]` vs `[a, b, c]` syntax is something likely to catch new-to-Julia users. I have personally watched people struggle with that. Programmers familiar with other languages take a bit to understand the vectors vs row-matrixes thing, when they were just expecting a list/array

[julia-users] How to overcome versioning issues?

2014-07-21 Thread Andreas Lobinger
Hello colleagues, i just filed an issue to Gtk (because a basic functionality; getting the cairo context for a canvas; somehow doesn't work, at least in my environment, and it did in former times) and i'd bet a bottle of tomato ketchup on it: For sure it will be solved by git pulling the

Re: [julia-users] Julia with LightTable

2014-07-21 Thread Diego Tapias
Your guess was right @Keno, my version of Julia was very old. I updated to the version 0.3.0 -rc1 and the problem was fixed. Thanks for the help. 2014-07-21 2:19 GMT-05:00 Keno Fischer kfisc...@college.harvard.edu: Your version of julia may be too old. How did you install julia? On Sun, Jul

[julia-users] Re: How to overcome versioning issues?

2014-07-21 Thread Tomas Lycken
I think this problem must be resolved by better practices among package maintainers: in short, the goal must be that as long as you only use (the latest) tagged versions of any packages, everything should Just Work (TM). That means, in short, that if a package maintainer adds functionality that

Re: [julia-users] Re: Sorting behavior

2014-07-21 Thread Ivar Nesje
Warning for 2d row vectors used in context where only a 1d column vector is used could definelty be implemented as help when you get a MethodError. See also https://github.com/JuliaLang/julia/issues/7512. Ivar kl. 16:03:46 UTC+2 mandag 21. juli 2014 skrev Leah Hanson følgende: I agree that

[julia-users] Implementation of Moment Invariants?

2014-07-21 Thread Andrew Gibb
I'm hoping to play around with Geometric Moment Invariants, as (greyscale) image feature descriptors. I get the impression that these might be part of some stats package, but I'm coming at this from the machine vision side, and so don't really know where to look. A few simple google searches

[julia-users] String from a substring

2014-07-21 Thread Ben Ward
This is probably a simple question, I've done a string splitting operation with split(), which has given me an array of SubString types, but I want them to be of type String so as I can feed the bits of the split up string to some method that requires a String type. string(*substring type*)

Re: [julia-users] String from a substring

2014-07-21 Thread Leah Hanson
SubString is a subtype of String, so any function accepting a String should accept a SubString. What function are you calling where this doesn't work? -- Leah On Mon, Jul 21, 2014 at 11:13 AM, Ben Ward axolotlfan9...@gmail.com wrote: This is probably a simple question, I've done a string

Re: [julia-users] String from a substring

2014-07-21 Thread Ben Ward
I'm calling the constructor go a type I made, there's a string field is accepts to fill a string field in the type. On Monday, July 21, 2014 5:17:25 PM UTC+1, Leah Hanson wrote: SubString is a subtype of String, so any function accepting a String should accept a SubString. What function are

Re: [julia-users] String from a substring

2014-07-21 Thread Ben Ward
I've just tested the constructor with a dummy example, and it works so obvious the error is elsewhere, I'll find it and update. On Monday, July 21, 2014 5:17:25 PM UTC+1, Leah Hanson wrote: SubString is a subtype of String, so any function accepting a String should accept a SubString. What

[julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2014-07-21 Thread Zahirul ALAM
I have been using Mathematica regularly for five years now and I am a new user of Julia. As a first serious project I have used Julia to simulate a nonlinear optical pulse propagation problem. I originally have written the codes in Mathematica. The simulation time in Julia was roughly eight

Re: [julia-users] Implementation of Moment Invariants?

2014-07-21 Thread Tim Holy
Nope. Would be really useful for Images.jl. Or you could create your own package, but if so please make sure it interoperates with Images.jl. --Tim On Monday, July 21, 2014 08:50:13 AM Andrew Gibb wrote: I'm hoping to play around with Geometric Moment Invariants, as (greyscale) image feature

Re: [julia-users] Re: Sorting behavior

2014-07-21 Thread Stefan Karpinski
If we introduced Covectors and a row slice of a Matrix was a Covector, then this wouldn't be an issue anymore since we could simply allow sorting both Vectors and Covectors but not Matrices. There's still the open question of what taking a slice that looks like T[1,:,1] should produce. That's a

Re: [julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2014-07-21 Thread Stefan Karpinski
On Mon, Jul 21, 2014 at 9:55 AM, Zahirul ALAM zahirul.a...@gmail.com wrote: One feature I would like to see from IJulia may be is that the input of greek and mathematical symbol in way that looks natural, e.g. using subscript, in division, integration etc as way to input. This will definitely

[julia-users] Parametric types of parametric types?

2014-07-21 Thread andy hayden
I was wondering if there anyone had any rules of thumb for when to create parametric types of a parametric types (if this is even possible?). To give a concrete example, I was messing around to describe/implement elliptic curve point addition: # ring of integers mod P immutable Z{P} :

[julia-users] Re: Parametric types of parametric types?

2014-07-21 Thread Avik Sengupta
So a type parameter is a placeholder, that takes that takes a value from a (optionally constrained) set when the type is instantiated. Thus to say immutable ECPoint{EC{P}} where EC is a concrete type does not make sense. I get the feeling you want to parameterise ECPoint by instances of EC.

Re: [julia-users] Re: Parametric types of parametric types?

2014-07-21 Thread Andy Hayden
I get the feeling you want to parameterise ECPoint by instances of EC. Is that right? This is exactly correct (it does look like this is triangular dispatch, thanks for the link). At the moment, I'm sticking the EC on every point as an attribute: immutable ECPoint{P} x::Z{P}

Re: [julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2014-07-21 Thread Zahirul ALAM
Thanks Stefan. I did find out that I can type \alphatab for Unicode α. My point was more to do with the traditional input / output mode. btw if I am not mistaken I think in markup mode the \alphatab does not work. I guess not even auto complete works in markup mode when pressed tab. May be I

Re: [julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2014-07-21 Thread Stefan Karpinski
Gadfly has recently gotten the ability to do contour plots unless I'm mistaken, so hopefully that helps a bit. The \alphatab business is actually a tab completion trick implemented in the Julia completion backend, rather than in the IJulia/IPython/Jupyter frontend. In markdown mode, you can use

[julia-users] ++ as string concatenation operator

2014-07-21 Thread Hans W Borchers
I was interested to define ++ as operator for concatenating strings. I can define + for this purpose, but for ++ I get julia function ++(x::String, y::String) x * y end ERROR: syntax: expected ( in function definition I looked up // in Rational.jl, but did not

Re: [julia-users] Re: Tips on reducing intermediate garbage?

2014-07-21 Thread Andrei
Thanks a lot for all your answers! Now I need to take a break to learn all these cool stuff and get prepared to such a bright future :) On Mon, Jul 21, 2014 at 11:03 PM, Stefan Karpinski ste...@karpinski.org wrote: Automatic, general loop fusion is something that we want to make possible and

Re: [julia-users] ++ as string concatenation operator

2014-07-21 Thread Jake Bolewski
It is not, look at julia-parser.scm for the list of operators you are able to define. On Monday, July 21, 2014 5:57:41 PM UTC-4, Steve Kelly wrote: I think the issue is that ++ is not an operator in julia. On Mon, Jul 21, 2014 at 5:51 PM, Hans W Borchers hwbor...@gmail.com javascript:

[julia-users] Static Analysis in Julia talk

2014-07-21 Thread Leah Hanson
I've spoken twice about TypeCheck.jl in the past couple of weeks (at JuliaCon and Midwest.io). The Midwest.io talk has been posted: https://www.youtube.com/watch?v=mL1Ow03G8tkfeature=youtu.be Because Midwest.io is a general programming conference, there's background on Julia before we get into

Re: [julia-users] ++ as string concatenation operator

2014-07-21 Thread Hans W Borchers
It is not, look at julia-parser.scm for the list of operators you are able to define. And I thought Julia allows to define operators as users like. Is there a special reason (inconsistency) why ++ would not not be allowed while // is? Could this be changed by an appropriate entry in

Re: [julia-users] ++ as string concatenation operator

2014-07-21 Thread Stefan Karpinski
Julia does not allow user-defined operators. There are just a lot of pre-defined operators. We could add ++ as an operator, but we'd have to decide how it parses and what it's precedence is. In Haskell it's an infix operator used for concatenation. In C it's a prefix and postfix operator that

Re: [julia-users] Static Analysis in Julia talk

2014-07-21 Thread Steve Kelly
This was excellent and informative. Thanks for sharing! On Mon, Jul 21, 2014 at 6:19 PM, Leah Hanson astriea...@gmail.com wrote: I've spoken twice about TypeCheck.jl in the past couple of weeks (at JuliaCon and Midwest.io). The Midwest.io talk has been posted:

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread Cameron McBride
in the REPL, would it be reasonable to have ?? be able to do an apropos() search? Cameron On Fri, Jul 18, 2014 at 4:40 PM, Viral Shah vi...@mayin.org wrote: I think that most new users are unlikely to know about apropos. Perhaps we should put it in the julia banner. We can say something

[julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread Michael Prentiss
+1 On Friday, July 18, 2014 3:40:14 PM UTC-5, Viral Shah wrote: I think that most new users are unlikely to know about apropos. Perhaps we should put it in the julia banner. We can say something like: Type help() for function usage or apropos() to search the documentation. apropos()

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread Ethan Anderes
+1. For some reason my fingers always get tied up when typing apropos

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread John Myles White
There's one complication here, which is that a single ? already changes the mode of the REPL into help mode. So this would have to be a mode only triggerable from inside of help mode. -- John On Jul 21, 2014, at 6:47 PM, Ethan Anderes ethanande...@gmail.com wrote: +1. For some reason my

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread Stefan Karpinski
Would it be crazy to make ? just do apropos? Interestingly, I was just thinking of making ;; trigger sticky shell mode where you have to actively escape to get back to julia mode. On Mon, Jul 21, 2014 at 6:48 PM, John Myles White johnmyleswh...@gmail.com wrote: There's one complication here,

Re: [julia-users] build-in function to find inverse of a matrix

2014-07-21 Thread Viral Shah
That’s not a crazy idea. ? could do help if there is an exact match, and if there is no match, it can just do apropos. -viral On 22-Jul-2014, at 7:20 am, Stefan Karpinski ste...@karpinski.org wrote: Would it be crazy to make ? just do apropos? Interestingly, I was just thinking of making