Re: [julia-users] constant values from dictionary as compile time constants

2016-04-25 Thread Michael Louwrens
Apr 24, 2016 at 8:43 AM, Tom Breloff <t...@breloff.com> wrote: >> If it's always the same keys, maybe build an immutable type at the very >> beginning? >> >> >>> On Sunday, April 24, 2016, Michael Louwrens >>> <michael.w.louwr...@outlook.

[julia-users] constant values from dictionary as compile time constants

2016-04-24 Thread Michael Louwrens
I use a dictionary to store all the various variables I use in an algorithm. So, there are many functions which look like: function foo(input::Dict) x =2*input[:bar] end Input is created once and never changed. Would abusing Val{T} be an option here? There will only be one value for

[julia-users] Building LLVM 3.7.1 fails on Windows with msys and cygwin

2016-02-10 Thread Michael Louwrens
] Error 2 michaelwl@ubuntu:~/julia$ Would appreciate any advice to solve these! Thanks Michael Louwrens

[julia-users] Re: Building LLVM 3.7.1 fails on Windows with msys and cygwin

2016-02-10 Thread Michael Louwrens
A clean install or Cygwin functioned. I had to do a clean install because Cygwin failed after updating. I seem to have used the experimental version of mingw64 on Cygwin which did not agree with compiling intrinsics. I suspect this newer version may also be in the opensuse mingw that msys2

Re: [julia-users] Re: What features are interesting in a VS Code plug-in?

2015-10-15 Thread Michael Louwrens
Only the .tmlanguage file is used at the moment. Once extension support improves and a package manager is introduced it would probably no longer fit in the textmate repo. For now however, it would have far better visibility there. I doubt many will use it though at this time. Atom is still a

Re: [julia-users] Re: What features are interesting in a VS Code plug-in?

2015-10-15 Thread Michael Louwrens
It's up! Please mention if anything is wrong with the license file. Repo is at: https://github.com/Mike43110/julia.vscode On Thursday, 15 October 2015 18:48:06 UTC+2, David Anthoff wrote: > Great, much appreciated! I don’t have yo installed, I think and will just > wait for your repo to go up.

Re: [julia-users] Suspending Garbage Collection for Performance...good idea or bad idea?

2015-08-01 Thread Michael Louwrens
on wondering if it would have been an improvement! Thanks for the numbers and the explanation, it is much appreciated. The mind does tend to wonder when your code has been running for 12 hours. On Saturday, 1 August 2015 23:59:25 UTC+2, Yichao Yu wrote: On Sat, Aug 1, 2015 at 5:10 PM, Michael

Re: [julia-users] Suspending Garbage Collection for Performance...good idea or bad idea?

2015-08-01 Thread Michael Louwrens
I haven't tested the new generational GC so this may all be moot but: I had a recent thought. Wouldn't a manual free method that frees the object and tells the GC that it this object doesn't exist anymore be useful in some cases? I can imagine anywhere where you have temporary objects allocated

[julia-users] Re: Promotion rules and strings

2015-07-26 Thread Michael Louwrens
the `string` function works (and `x*y` where x and y are strings is really just `string(x,y)`) On Sunday, July 26, 2015 at 6:37:01 AM UTC-4, Michael Louwrens wrote: I noticed that this also happens: julia x =utf16(string 1) string 1 julia y = utf8( string2) string2 julia println(typeof(x

[julia-users] Re: Promotion rules and strings

2015-07-26 Thread Michael Louwrens
I noticed that this also happens: julia x =utf16(string 1) string 1 julia y = utf8( string2) string2 julia println(typeof(x), \t, typeof(y),\t ,typeof(y*x)) UTF16String UTF8String ASCIIString It seems Julia is always promoting to the simplest type that can represent the string. It

[julia-users] Re: Promotion rules and strings

2015-07-26 Thread Michael Louwrens
On Sunday, 26 July 2015 12:18:40 UTC+2, Scott Jones wrote: Could you give an example? I've been trying to fix any Unicode related bugs I've found in 0.4 julia x =utf16(string 1) string 1 julia y = string2 string2 julia println(typeof(x), \t, typeof(y),\t ,typeof(x*y)) UTF16String

[julia-users] Promotion rules and strings

2015-07-26 Thread Michael Louwrens
On 0.3.10 I was playing with strings for amusement and found it strange that while ASCII * UTF8 = UTF8, UTF16/32 = ASCII. Is this intended or should an issue be opened.

Re: [julia-users] Suspending Garbage Collection for Performance...good idea or bad idea?

2015-05-11 Thread Michael Louwrens
I am starting to read Region-Based Memory Management for a Dynamically-Typed Language http://link.springer.com/content/pdf/10.1007/b102225.pdf#page=240 it proposes a second inference system, region inference. I will read it fully in the morning but just scanning through their results they

Re: [julia-users] [Vectorization] Comparison of codes

2015-05-09 Thread Michael Louwrens
Why not just use the nightly build for now? On Saturday, 9 May 2015 11:35:26 UTC+2, Sisyphuss wrote: I tried to build 0.4, but I met the following error: Makefile:141: /Makefile.rules: No such file or directory make[2]: *** No rule to make target `/Makefile.rules'. Stop. make[1]: ***

Re: [julia-users] Suspending Garbage Collection for Performance...good idea or bad idea?

2015-05-09 Thread Michael Louwrens
Have you had any further thought on this? It seems like it could be quite useful for the cases where one intentionally disables the GC for performance reasons - though you guys are incredibly busy! I also read about having the compiler automatically insert frees where it can in Julia and was

Re: [julia-users] setdield! error?

2015-05-06 Thread Michael Louwrens
On Thursday, 7 May 2015 01:39:44 UTC+2, Isaiah wrote: Context? On Wed, May 6, 2015 at 7:18 PM, Michael Louwrens michael.w...@outlook.com javascript: wrote: ERROR: LoadError: TypeError: setfield!: expected Array{ VarLengthIndividual.VarIndividual{G:EA.AbstractGene,I:EA. AbstractInputSet

[julia-users] setdield! error?

2015-05-06 Thread Michael Louwrens
ERROR: LoadError: TypeError: setfield!: expected Array{VarLengthIndividual. VarIndividual{G:EA.AbstractGene,I:EA.AbstractInputSet,R:EA. AbstractResultSet},1}, got Array{VarLengthIndividual.VarIndividual{G:EA.AbstractGene,I:EA. AbstractInputSet,R:EA.AbstractResultSet},1} I am quite confused

[julia-users] Re: THANKS to Julia core developers!

2014-12-18 Thread Michael Louwrens
Adding my sentiments here too. I went from C#, Matlab - Java (University and project requirements) - Python - Julia Julia has been the only language where I have felt free to do as I please! There was a bit of swearing until I figured out how to properly make use of templates and modules. Now

Re: [julia-users] Elementwise operator

2014-11-11 Thread Michael Louwrens
Thanks! I had read that issue last week and I had completely forgotten about it. Will give it a reread now

[julia-users] Elementwise operator

2014-11-10 Thread Michael Louwrens
I was looking at the Devectorise package and was wondering, why not have an operator that calls elementwise operations? While syntax is not something I have considered, using something basic like the example I see r = a .* b + c .* d + a could be expressed as r = .(a * b + c * d + a)

[julia-users] Help needed with adding modules in multiprocessing

2014-10-01 Thread Michael Louwrens
I am having an issue trying to use multiple processors. I get: ERROR: stack overflow while loading C:\Users\Michael\Dropbox\Masters\Masters-Experiments\Experiment1-Julia\main.jl, in expression starting on line 1310 exception on 1: ERROR: stack overflow WARNING: Module call not defined on

[julia-users] Curyying in Julia

2014-09-01 Thread Michael Louwrens
I just wanted to add an example of function currying in Julia. It isn't exactly pretty but it does work! I don't expect it to be performant however. julia function Add(x) return function f(y) return x + y end end Add (generic function with 1 method) julia Add(1)(2)

[julia-users] Currying in Julia

2014-09-01 Thread Michael Louwrens
I just wanted to add an example of function currying in Julia. It isn't exactly pretty but it does work! I don't expect it to be performant however. julia function Add(x) return function f(y) return x + y end end Add (generic function with 1 method) julia

[julia-users] Re: Currying in Julia

2014-09-01 Thread Michael Louwrens
faster! Still, not the worst performing macro at all! Thanks for adding to this. On Monday, 1 September 2014 23:20:33 UTC+2, Michael Louwrens wrote: I just wanted to add an example of function currying in Julia. It isn't exactly pretty but it does work! I don't expect it to be performant

Re: [julia-users] insert! function only for item not items

2014-07-16 Thread Michael Louwrens
is why the return value of the first command above is empty Hope this helps! Cheers, Kevin On Tue, Jul 15, 2014 at 5:23 PM, Michael Louwrens michael.w...@outlook.com javascript: wrote: Should insert! not be able to insert a collection? x = [1,2,7,8] y = [3,4,5,6] insert!(x,2+1,y

[julia-users] insert! function only for item not items

2014-07-15 Thread Michael Louwrens
Should insert! not be able to insert a collection? x = [1,2,7,8] y = [3,4,5,6] insert!(x,2+1,y) Is then unable to complete the insertion and create [1,2,3,4,5,6,7,8]. There is a costlier way to do this at the moment however. splice! almost replicates the required functionality but it replaces

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-07 Thread Michael Louwrens
For this example, yes. Poor type choices make for slow code. I did the beginner tutorials on the Julia Studio website before I wrote this. I may do a far more complex GA which involves variable length chromosomes. If I am lucky enough, I will still get 10x the performance of Python (which

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-06 Thread Michael Louwrens
No, just reporting the times found from the @time macro. On Sunday, 6 July 2014 12:25:58 UTC+2, Stefan Karpinski wrote: Were you timing the whole process execution, including system startup? On Sat, Jul 5, 2014 at 3:19 PM, Michael Louwrens michael.w...@outlook.com javascript: wrote

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-06 Thread Michael Louwrens
I was using Real instead of Float32, that was what was causing the slowdown. (I may be confused, if so I do apologise)

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-06 Thread Michael Louwrens
Aah! Yes, I 1st changed the variables to Float 64, then tested successive calls of the GA to see how well it performed. On Monday, 7 July 2014 03:02:00 UTC+2, Stefan Karpinski wrote: This is the bit I was confused about: On Sat, Jul 5, 2014 at 12:19 PM, Michael Louwrens michael.w

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-06 Thread Michael Louwrens
Karpinski wrote: This is the bit I was confused about: On Sat, Jul 5, 2014 at 12:19 PM, Michael Louwrens michael.w...@outlook.com javascript: wrote: Interestingly, Julia gets 100ms if I simply use @time testFunction(), on par with c++. Using testFunction() @time testFunction() To compile

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-06 Thread Michael Louwrens
Glad the confusion is settled! Sorry that it was worded so poorly! I was interested to see how much of a slowdown was introduced by using oop style functions. Surprisingly the slowdown was only around 15% when the functions were declared in a similar style to below. Type atype

[julia-users] GA implementation slow in Julia compared to other languages

2014-07-05 Thread Michael Louwrens
https://github.com/Mike43110/GA-Spherical-Jl/tree/master Here is my basic implementation of a GA in Julia. Using similar code in c++ I get 100ms, 100 also in node.JS, 170 for c#, 1800 for CPython and 650 for the Python code in Pypy. I expected performance somewhere between the node and the

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-05 Thread Michael Louwrens
I did not know that! What does real refer to? Is int the same?