Re: [elm-discuss] Animation not very smooth.

2016-11-02 Thread Nick H
I am guessing your viewGrid function is slowing your code down. This
function is creating a new mesh and passing it to the GPU on every
animation frame.

The solution is to make sure your WebGL.Drawable (line 465, where it says
"GL.Lines gridPoints") is a constant. So extract that into its own
top-level declaration, as you have done with "mesh."

On Wed, Nov 2, 2016 at 1:30 PM, Gaëtan André  wrote:

> Hello everybody,
>
> I am working on cloning Agar.io (https://agar.io/) using functionnal
> languages.
> Everything was going well except that my cell movements are not very
> smooth.
> I first blamed the network connection, but after hacking a standalone
> front-end it seems like Elm might have something to do with it.
>
> From were I am, I don't know where to go to improve fluidity.
>
> I am subscribing to AnimationFrame.diffs to give the pace of the render
> loop.
>
> Here is a gist of my code:
> https://gist.github.com/rvlander/0b956d5d8d0a70f37f6206cb6f9af367
>
> Thanks,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+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 "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Animation not very smooth.

2016-11-02 Thread Gaëtan André
Hello everybody,

I am working on cloning Agar.io (https://agar.io/) using functionnal 
languages. 
Everything was going well except that my cell movements are not very 
smooth. 
I first blamed the network connection, but after hacking a standalone 
front-end it seems like Elm might have something to do with it.

>From were I am, I don't know where to go to improve fluidity.

I am subscribing to AnimationFrame.diffs to give the pace of the render 
loop.

Here is a gist of my code:
https://gist.github.com/rvlander/0b956d5d8d0a70f37f6206cb6f9af367

Thanks,

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: Beginner Question following https://www.elm-tutorial.org/en/

2016-11-02 Thread Frederick Yankowski


Http.send creates a Task. To run a Task you have to create a Cmd Msg from 
it and hand that to the runtime via the return from the init or update 
function.

So rather than passing the task to Task.succeed you probably want to pass 
it to Task.perform instead.

There’s an example at 
https://gist.github.com/fredcy/02a2dff9c8990098ae2666993beb480e#file-http-send-example-elm-L39

The Http package is reputed to be simpler to use in the coming 0.18 release.
​

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Help with beginner program

2016-11-02 Thread Noah Hall
In order to install elm at version 0.16, just do:

npm install -g elm@0.16

In order to re-install elm at version 0.17, just do:

npm install -g elm@0.17.1

On Wed, Nov 2, 2016 at 8:06 PM, Federico Venturini
 wrote:
> Hi everyone!
> I'm writing a brief report on Elm and FRP (functional reactive programming)
> for one of my classes. Since elm 0.16 and 0.17 are completely different, I'm
> basing my report on the comparison between the two and how this affects the
> approach to FRP.
> I've got a good hold of the theoretical part, but I've been asked to write
> an small example of elm in action. I was wanting to do a really simple
> example in both of the version and compare the different approaches.
> First of all, how can I test and compile my code for elm 0.16? Do I need to
> uninstall elm 0.17, download the older version, compile it and test it? Or
> is there a more straight forward way?
> Second, I'm planning on doing a program that basically let you see a funny
> pic of Donald Trump if your mouse is in the right part of the screen and a
> funny pic of Hillary if your mouse is in the left part of the screen. As
> stated, I want to do this for both the versions. Can someone help me out? I
> don't need the full blown solution, just some hints and maybe someone to ask
> questions to. There aren't many tutorials left on the web for the older
> version of Elm..
>
> Thanks in advance,
> Federico
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+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 "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Help with beginner program

2016-11-02 Thread Federico Venturini
Hi everyone! 
I'm writing a brief report on Elm and FRP (functional reactive programming) 
for one of my classes. Since elm 0.16 and 0.17 are completely different, 
I'm basing my report on the comparison between the two and how this affects 
the approach to FRP. 
I've got a good hold of the theoretical part, but I've been asked to write 
an small example of elm in action. I was wanting to do a really simple 
example in both of the version and compare the different approaches.
First of all, how can I test and compile my code for elm 0.16? Do I need to 
uninstall elm 0.17, download the older version, compile it and test it? Or 
is there a more straight forward way?
Second, I'm planning on doing a program that basically let you see a funny 
pic of Donald Trump if your mouse is in the right part of the screen and a 
funny pic of Hillary if your mouse is in the left part of the screen. As 
stated, I want to do this for both the versions. Can someone help me out? I 
don't need the full blown solution, just some hints and maybe someone to 
ask questions to. There aren't many tutorials left on the web for the older 
version of Elm..

Thanks in advance,
Federico

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Supporting dynamic source directories via $ELM_PATH and/or elm-package.js

2016-11-02 Thread Anthony Naddeo
Writing this up as a continuation of 
https://github.com/elm-lang/elm-package/issues/168#issuecomment-257701205

TLDR; If elm-make supported JavaScript configuration files or leveraged 
environmental variables then I would be able to dynamically set the 
sourceDirectories to symlink farms that our internal build system generates.

Onto the issue.

I work at a large company with a very old (but effective and scale-able) 
build system. Without getting into too much detail, it is basically a 
wrapper around other build systems that gives developers the tools to 
generate the right environments before calling underlying build systems. 
For example, in the case of Java, we use our internal build system to wrap 
something like ant. The internal build system will generate the classpath 
based on our internal package management/repository system (just contains 
git repos) which is responsible for pull down packages and managing them in 
a local package cache. So, we do something like this:

$ build 

And under the hood, it will do something like this

$ CLASSPATH=... ant 

You can think of its package cache as an elm-stuff for any build system 
that is associated with a workspace, not associated with a single package. 
This is a very dumbed down case. There is a lot more going on in terms of 
the environment, but in and of itself, ant has no way of knowing how we 
distribute our packages to developers for building, and we can't upload our 
internal source code to something like GitHub.

I've done a lot of work on integrating non-elm JS into our build system and 
in all cases I depended upon features like $NODE_PATH and Webpack's 
resolveRoot/resolveAlias features. Using those, I'm able to use our 
internal tools to generate what should be the include path for JavaScript 
sources. In the end, that path is composed of symlink farms and build 
artifact directories of other internal JavaScript packages. We also have an 
internal build fleet that uses these tools and this is how we deploy code 
(one of the ways at least). Now, we can talk about better ways to handle 
distributing sources, but the fact of the matter is that we have a lot of 
infrastructure and tooling that depends on interoperability with our build 
system, and when tools can't integrate easily then they become hard to 
adopt.

If elm-make supported an elm-package.js file that could execute JavaScript 
code, then I would be able to leverage environmental variables to set the 
"sourceDirectories" dynamically. Likewise, if it leveraged its environment 
or took options in as a command line option then I would be able to set it; 
similar to how webpak configuration can be passed in via the command line. 
This feature would depend on the other stuff that was mentioned in the 
GitHub issue link: the ability to specify packages that are not hosted on 
the public elm repository but are instead somewhere on the local file 
system. We can talk about other solutions within elm, but dynamic 
configuration files and environmental variables seem to be pretty common in 
other build systems so I figured I would start there.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-11-02 Thread Kasey Speakman
On Wednesday, November 2, 2016 at 4:50:21 AM UTC-5, Rupert Smith wrote:
>
> On Tuesday, November 1, 2016 at 5:54:10 PM UTC, Kasey Speakman wrote:
>>
>> In a new project, we are going for something like this.
>>
>>
>> https://www.youtube.com/watch?v=GneIxgl71NM=18=PL9Z-JgiTsOYTdi91N_DlcpWqkCYvMrhA4
>>
>
> What sort of throughput in events/sec are you aiming to support? 
>

Initially, the load will be small and our cloud-provisioned resources will 
reflect that. It will necessarily be multi-tenant and we've had a lot of 
interest expressed among clients. So there is a great potential for growth.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-11-02 Thread Kasey Speakman
On Tuesday, November 1, 2016 at 3:31:07 AM UTC-5, Peter Damoc wrote:
>
> On Tue, Nov 1, 2016 at 2:25 AM, Kasey Speakman  > wrote:
>>
>> So here's a concrete example of how we did it wrong in our legacy system. 
>> To close a trainee's registration as "No Show", an employee has to create 
>> an exam against that registration and grade it as 1%. This is an implicit 
>> concept which our employees and our software understand as "No Show". 
>> Instead of making it explicit by programming in a No Show 
>> button/action/status, we have to *program the employees* (current and 
>> future) to recognize this situation.
>>
>
> Wow... this is so silly that it almost looks like a joke. Unfortunately, 
> I've seen enough to know that it happens. 
>

After thinking on this, I can tell you exactly how it happens. The program 
was made on a contract basis, so either the contractor didn't discover the 
No Show use case, or it was not in the business processes at the time it 
was implemented. Later, a user in charge decides they themselves can 
implement a No Show feature without going through contracting by making 
policy around the data. "If you see a grade of 1, that means it was a No 
Show." The user probably congratulates themselves for saving money. This 
kind of thinking leads to more of this. And that's where we are.

Sometimes this kind of shortcut might be the only way to get things done 
under time/budge pressure, from the user's perspective.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Elm crypto libraries?

2016-11-02 Thread Marcus Roberts
I've not found any yet, but I have had success using ports and crypto-js
for symmetric encryption in my app I'm porting to Elm.

I use the jsrsasign library for RSA on the JS side, and I'll be trying a
ports based approach with that next.





On Wed, Nov 2, 2016 at 2:24 PM, 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> I found 2 that can do SHA:
>
> http://package.elm-lang.org/packages/billstclair/elm-sha256/latest
> http://package.elm-lang.org/packages/spisemisu/elm-sha/latest
>
> I'm actually looking for an RSA implementation?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+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 "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Elm crypto libraries?

2016-11-02 Thread 'Rupert Smith' via Elm Discuss
I found 2 that can do SHA:

http://package.elm-lang.org/packages/billstclair/elm-sha256/latest
http://package.elm-lang.org/packages/spisemisu/elm-sha/latest

I'm actually looking for an RSA implementation?

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-11-02 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 1, 2016 at 1:16:40 PM UTC, Kasey Speakman wrote:
>
>
> http://blog.ploeh.dk/2013/12/03/layers-onions-ports-adapters-its-all-the-same/
>

I agree with this. I was very happy to see in the first couple of 
paragraphs a description of what usually goes wrong in OO implementations - 
inverting the dependency between the data layer and the domain. This is the 
pattern I am currently using. 

http://blog.ploeh.dk/2016/03/18/functional-architecture-is-ports-and-adapters/
>

Was pretty interesting. I agree that somehow implementing in a functional 
way makes the layering seem less onerous. A case of serendipity that the 
awkwardness of IO in functional languages tends to make this pattern a 
natural one.

To some extent, this also applies to a UI in Elm. The 'domain' of a UI is 
related to but not identical to the domain of the services it consumes - 
but there is still a domain. In Elm we implement that with our model, use 
the type system to try and constrain it to dissallow illegal states, and 
generally provide a set of convenience functions for manipulating the model 
or extracting features of interest from it. The view is a port. The 
interface onto the service, with its HTTP endpoints and encoder/decoders is 
another port.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: Metalinguistic abstractions over databases

2016-11-02 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, November 1, 2016 at 5:54:10 PM UTC, Kasey Speakman wrote:
>
> In a new project, we are going for something like this.
>
>
> https://www.youtube.com/watch?v=GneIxgl71NM=18=PL9Z-JgiTsOYTdi91N_DlcpWqkCYvMrhA4
>

What sort of throughput in events/sec are you aiming to support? 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Porting code from WebGL to Elm-WebGL

2016-11-02 Thread Pietro Grandi
Hi Nick,
the "live" link is broken :-)

I'm investigating to build a higher level API just for mesh creation 
(rectangle, square, circle, ngons). I would like to start easy :-)

My goal is to be able to visualize a binary tree on the canvas, using the 
most basic shapes like circles and lines.

Is anyone of you interested in collaborating?
Thanks!

On Sunday, March 13, 2016 at 11:19:54 PM UTC+1, Rex van der Spuy wrote:
>
> A port of Three.js's API to Elm would be fantastic!
> For doing a lot of interactive 3D and games we really do need a high-level 
> API.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.