Hacker Newsnew | past | comments | ask | show | jobs | submit | arjan_sch's commentslogin

Title is wrong, the actual release version is 1.19.0



Nice project. Would be good to add a bit more diversity to the skin tones though :)


It would get this guy absolutely murdered if one of the funny faces looked racist.


If you had the Dark Reader extension enabled like I did when I first went to the site...


I didn't even realize until I read your comment


Can we not do that here please

The whole “you’re not allowed to do anything these days for fear of being accused of being racist” thing


You can't please everybody, which leaves your conscience as the deciding factor. If you would rather not draw black people with googly eyes and vacant expressions, I can hardly criticize that. Like you point out, you'll get criticized - but again, it's impossible to make everyone satisfied with this stuff.


Ya you’re right brown people can’t be included in funny or silly things. Good call good call.


Too risky


Related to this, this is old but still a great blogpost:

https://www.evanmiller.org/elixir-ram-and-the-template-of-do...


The 404's changed into 502's.. I guess that's progress. Fingers crossed it's back up soon


A few years back I wrote an Elixir AST explorer, as part of a presentation at ElixirConf EU: https://ast.ninja/


Well with Liveview you go "full server state" for everything that you would normally just use plain JS for. For instance, toggling a checkbox or collapsing a div.

Having latency on such lowlevel interactions might make the UI feel sluggish as a whole.


Yeah certainly, but I'm not sure people are using it that way?

Most examples are to show cool stuff you can do, they're not production vetted. Like most JS examples out there don't really mean that people should be publishing live credentials with their bundles.

I imagine in most cases one would leave everything that is not behind a logged in status as normal routes/pages (signin, landing, contacts, etc). Or if not that those would be things requiring a socket/real-time interface anyway.

For the interactions, I don't think you even need to use alpine.js. Plain setup on DOMContentLoad, CSS Dropdowns/collapsibles that are replaced on JS load, proxying LiveView DOM/Morphdom events (if needed) so other components (even vue,react, etc) can listen to them, and CSS animations.

  import { setup_live } from "./phx/setup_live.js";
  import { setup_dropdowns } from "./interactivity/dropdowns.js";
  import { setup_collapsibles } from "./interactivity/collapsibles.js";
  import { setup_links } from "./interactivity/links.js";
  import { setup_inputs } from "./interactivity/inputs.js";

  function setup() {
      setup_live();
      setup_links();
      setup_dropdowns();
      setup_collapsibles();
      setup_inputs();
  }

  document.addEventListener("DOMContentLoaded", setup);


I went as far as having `onclick` handles and global window functions. Complete heresy. Yes, it's not 100% JS free, but it's pretty much low overhead.

Then LiveView is mostly for your admin dashboards and logged in users views, where it makes it pretty easy to do real-time feedback type of interactions/views and spa like navigation. Since you have proper auth and identification on the user, you can just log them off, rate-limit, block an account, and close their socket if needed.


Have you figured out any good way to have per-page javascript where the JavaScript is only sent over the wire for that pages?


From the top of my head not really, but this would depend on a few things:

- Is it a vendor lib ?

- It's not but is some particular file that is big enough to not make sense including on the root layout?

- It's neither, but functionality that can trigger multiple times and should be only once and only on those pages because it can conflict? or some variation of that?

I think they're all solvable but what makes sense will depend on those, but also on how you're using LiveView (is it LiveView only for logged-in users/some auth, can you set those on the live_view layout...)

But in some cases this is a problem also in spa's, where you have to use a snippet to check if the lib has been loaded, if not add a script tag to the body, or load it through js, etc...


You don't have to. You can totally use JS for these in Liveview


Looks great!

Did not look at it in detail, but I'm wondering about portability, eg how this works with system libraries, like OpenSSL. Is the resulting binary portable to systems with different C libraries than the ones the OTP system was linked against originally?


Erlang compiles and runs fine on ARM architectures in general. It is used extensively on IoT platforms like https://www.nerves-project.org/


Probably not super well tested with a bleeding edge clang compiler though (and even for non-bleeding-edge versions, I'd suspect mostly tested with GCC). Triggering compiler bugs or exposing technically undefined behavior would not be entirely surprising.


True. IIRC Erlang only supports GCC as the build system. I helped fixing a race in the BEAM a while back that only occurred on the latest GCC.


> IIRC Erlang only supports GCC as the build system.

Since gcc doesn't work on Apple Silicon, I assumed the OP must be using clang :).


gcc certainly compiles for ARM and understands Darwin/mach-o. It can probably target iOS. What would the major barrier be for gcc to work?


Given that Apple silicon is pretty new my guess it porting and testing , I would also add not all ARM chips are exactly the same , there will be some minor nuances for sure .

Perhaps it is also some funding and access to the kits and dev time , updating gcc is not a full time job for most of the contributors after all.



This is a great thread, thanks! (And I see that your name is in the thread.)

I gather from there that previous efforts to target iOS are outdated, there is substantial work to handle the Apple ABI, and that it's not been seriously looked at yet.


That's not true. GCC, Clang and MSVC are supported.

http://erlang.org/doc/installation_guide/INSTALL.html


Does it support aarch64? AFAIK, the Apple SoCs these days don't support 32bit ARM anymore.


One of the big differences between Erlang and Elixir is indeed that Elixir allows you to write macros in the language itself, using quote / unquote constructs just like lisps.

This makes it easy to generate code on compile time, which is then executed in runtime without any performance penalty.

A large part of Elixir itself is actually implemented as macros. For instance, the "unless" construct:

  defmacro unless(condition, do: do_clause, else: else_clause) do
    quote do
      if(unquote(condition), do: unquote(else_clause), else: unquote(do_clause))
    end
  end

(code simplified for clarity)


And the if-else construct is also a macro. The whole thing ends up being a case I think.


Esp. when reading the part about 15 working hours per day.


Note that there's only 625 minutes of working during this "15 " hours work day. So working 5 days a week this is less than 60 hours of work per week.


... Without breaks. That's more or less insane. However that's easily adjustable, the article is the same if we read half that number.

It's the complete absence of influence of other people (be it in the form of SOs, kids, coworkers, office environments, meetings, bosses, customers, what have you) that makes it alien to me.

If I could have 4 hours of real, concentrated, productive work on important things each working day, I would massively increase the impact of my work.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: