Witold, that's a ridiculous response. Please re-read my reply. Without
fully knowing the context of the problem, you suggested using Native.
This is not something we encourage in the Elm community. There are
valid reasons as to why not. When recommending it, is it best to know
_everything_ about the situtation. Like I said, it should _never_ be
the first thing you reach for. I emphasised this in both my replies.
Please re-read them.

Dwayne, please come get help on Slack. People are helpful there, and
we will help drill down into the best possible solution for your
problem. :)

On Mon, May 1, 2017 at 1:12 AM, Witold Szczerba <witoldsz....@gmail.com> wrote:
> Noah is always right. He's just a Elm Rock Star, he knows the best. is that
> realy what be said to me or did I miss the point? I have no idea what I was
> thinking when I dreaded to "lecture" him.
>
> Oh, by the way, Dwayne's attempt to follow those golden rules failed. He
> must have missed something obvious, like reimplementing the formatting in
> Elm by his own.
>
> Dustin is right here. If it's trivial then just go for it, Dwayne, really.
> If it's not simple then... suffer, or do what I did and get the job done,
> just do follow all the FP rules and don't feel "bad" about it all.
>
> 01.05.2017 12:15 AM "Erik Lott" <mrerikl...@gmail.com> napisał(a):
>>
>> Noah is right. You don't want to reach for Native for this type of
>> integration. If this can't be smoothly integrated with ports (we've all felt
>> that pain), the next best option is to write the elements of the plug-in
>> that you need in elm.
>>
>> On Sunday, April 30, 2017 at 1:37:04 PM UTC-4, Noah Hall wrote:
>>>
>>> Witold, with all due respect, I am one of the people who has written
>>> the _most_ Native code. I know a thing or two about it. You do not
>>> need to lecture me, and my warning should be heeded.
>>>
>>> Like I said, there are _some_ cases where a Native binding makes
>>> sense. They are few and far between.  These problems are best
>>> discussed on Slack, where we can drill down into the exact use case.
>>> For example, is it only one currency format? If it is, re-writing in
>>> Elm should be trivial.
>>>
>>> On Sun, Apr 30, 2017 at 7:30 PM, Witold Szczerba <witold...@gmail.com>
>>> wrote:
>>> > Noah, this is exactly the kind of problem to be solved by native
>>> > binding.
>>> > Dwayne wants to use his formatting library. This is a classic example
>>> > of
>>> > pure function. Nothing is going to crash if you wrap exception in
>>> > Result and
>>> > check types.
>>> >
>>> > Good advices of self reimplementig everything from scratch in Elm or
>>> > using
>>> > subscriptions for pure functions is nothing but making Elm people
>>> > suffer
>>> > instead of getting things done.
>>> >
>>> > Native bindings are not bad per se. Just use it wisely, be pragmatic or
>>> > we
>>> > will read another "Moving on", by Dwayne Crooks" this time.
>>> >
>>> > 30.04.2017 7:07 PM "Noah Hall" <enal...@gmail.com> napisał(a):
>>> >>
>>> >> Witold, this it not the advice that we give to people exploring such
>>> >> problems in Elm. There are many reasons why Native bindings are bad. A
>>> >> single error in your JS will cause the _entire_ application to crash
>>> >> unrecoverably. Wrapping things as a result will not help you catch
>>> >> those errors. Writing carefully thought out and tested code will.
>>> >> While there are cases where a Native function helps out a lot, it
>>> >> should _never_ be the first thing to reach for.
>>> >>
>>> >>
>>> >> Dwayne, I suggest discussing things on the Elm Slack. It will be
>>> >> easier to get to the exact use case you have for your formatting
>>> >> issue.
>>> >>
>>> >>
>>> >> On Sun, Apr 30, 2017 at 7:03 PM, Witold Szczerba <witold...@gmail.com>
>>> >> wrote:
>>> >> > Ports and subscriptions are for executing actions with effects, in
>>> >> > my
>>> >> > opinion. Native bindings for pure functions are nothing bad. Just
>>> >> > keep
>>> >> > away
>>> >> > from exceptions, use Result in case of possible troubles.
>>> >> >
>>> >> > 30.04.2017 4:00 PM "Dwayne Crooks" <dwayne...@gmail.com> napisał(a):
>>> >> >>
>>> >> >> Thanks guys.
>>> >> >>
>>> >> >> I explored Noah's approach to see how the solution would turn out.
>>> >> >> But
>>> >> >> I
>>> >> >> didn't like it. The code change required to format a list of floats
>>> >> >> as
>>> >> >> money
>>> >> >> is ridiculous. Here's what I started with
>>> >> >>
>>> >> >>
>>> >> >> https://gist.github.com/dwayne/550341a5b27ba3c03ce7eba92d33873d#file-0-start-elm.
>>> >> >> And here's what I ended up with
>>> >> >>
>>> >> >>
>>> >> >> https://gist.github.com/dwayne/550341a5b27ba3c03ce7eba92d33873d#file-1a-useports-elm,
>>> >> >>
>>> >> >>
>>> >> >> https://gist.github.com/dwayne/550341a5b27ba3c03ce7eba92d33873d#file-1b-useports-html.
>>> >> >>
>>> >> >> P.S. The solution still doesn't quite work because all money
>>> >> >> receives
>>> >> >> the
>>> >> >> first incoming subscription message causing them to display the
>>> >> >> same
>>> >> >> formatted value. I didn't bother to fix it because the solution is
>>> >> >> bad
>>> >> >> enough.
>>> >> >>
>>> >> >> I think we can safely rule out ports. Noah, do you have any
>>> >> >> thoughts on
>>> >> >> the code? Did I miss anything?
>>> >> >>
>>> >> >> That leaves us with:
>>> >> >>
>>> >> >> Using a Native module. (Looks like the best compromise for my needs
>>> >> >> in
>>> >> >> the
>>> >> >> short-term.)
>>> >> >> Rewrite in pure Elm. (Looks like the best long-term solution.)
>>> >> >>
>>> >> >> Next step: I will write up a Native solution and see how that goes.
>>> >> >>
>>> >> >> --
>>> >> >> 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...@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...@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...@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...@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.
>
> --
> 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.

Reply via email to