ages.reduce((a, c) => (a + (c > 18)), 0)
Though usually in production code you'll see this as something like ages.reduce((acc, cur) => {
return acc + c > 18 ? 1 : 0
}, 0)
Which creates some more noise but ups readability349 karma · joined June 1, 2015
ages.reduce((a, c) => (a + (c > 18)), 0)
Though usually in production code you'll see this as something like ages.reduce((acc, cur) => {
return acc + c > 18 ? 1 : 0
}, 0)
Which creates some more noise but ups readabilityReading and understanding an f# code base has always been vastly more simple to me than the incredible indirection of some other codebases (trying to find where the provider for the factory of the abstract class member that’s an interface implemented by 10 almost exactly similar c# classes? Good luck /s)
F# had Jet as the one large success story of a full f# shop, but outside of that there weren't many large companies using a lot of F# (except microsoft internally, and they didn't blog about it _too_ much).
Kotlin on the other hand is seeing server-side adoption in quite a few large companies. Google is recommending it as the server-side JVM language for new services going forward. Airbnb and a handful of other large companies blog about having kotlin services in their architecture.
There's a few reasons I think Kotlin is succeeding where F# hasn't been able to:
* JVM + tooling is a proven and great ecosystem. First-class support for most of your cloud tooling and databases (AWS, Kafka, ElasticSearch, Cassandra, etc).
* It has fantastic editor tooling (given that an IDE company created and maintains it). F# for quite a while has had less-than-average tooling (it's gotten better now with newer versions of FSAC, Ionide, and Rider, but it was _rough_ for a while). It's hard to move to something new that's supposed to be safer when your language server has memory leaks or breaks every X hours. I remember stretches of time where I was just writing F# in vim without syntax highlighting because any editor I tried would constantly throw errors in the middle of me coding. That hasn't happened to me with Kotlin.
* It's close-enough looking to a scripting language with nice features that it's more approachable. Classes and functions look similar to other languages. It even has block parameters that are inviting for rubyists (although the implementation is different). It also has some syntactic sugar to make some things very ergonomic to work with.
* All of the above just works. No big fiddling necessary. The pain points in working with the Java ecosystem are written about and known (largest that come to my mind are coroutines interacting with java threading, exceptions in mixed coroutine/threading environments, and null/optional which Kotlin has some great features built-in to work around).
There's also things like arrow-kt and http4k for those desiring the more functional side of things.
The one thing that continues to baffle me is how little I see in people talking about kotlin in various communities (slack, discord, reddit, etc) compared to how many people are writing it (both for android and for server-side concerns).
The one upside I'll give is that fable has been much better IME than my experience with Kotlin/js. I also prefer F# from a purely language standpoint, but Kotlin is just better to work with.
Biometric unlock on mobile will be a great UX improvement for me.
However, you seem set on making this a combative conversation rather than a collaborative discussion, so I'll end my participation here.
It's not all magic as well. Looking into the internals of EF, ActiveRecord, Hibernate, or other ORMs reveal patterns that once familiarized can help reason about the behavior of complex queries. I only state this to try to work against the commonly found wisdom of "big frameworks are magic" that tends to scare away learning developers from hoping to understand them.
There are intersections and disjunctions of feature sets between the various ORMs, with some features for EF still only available via extensions (or nonexistent). I don't think this makes the Lucid ORM any less of an ORM.
Again, I like EF Core. I simply think that as far as node-based ORMs go, that Lucid is the one I've had the best experience with, so wanted to highlight it.
Which features would you say are the key ones that make Lucid seem more like a query mapper (Dapper, Knex) than an ORM (ActiveRecord, EF)?
Specifically, in my Adonis projects, I'm mostly working with the Model objects through the ORM methods, and only dropping to Knex/SQL when necessary (complex CTE, etc). Since it's such a Model-centric seeming way of development, it naturally seems like an Object-Relational Mapping to me.
Having used it on an actual product and dealing with some of the pain points, it's my go-to since the typescript version (v5) came out.
The ORM uses Knex.js internally, which is very simple to drop into if you just want a query builder. Having Knex be accessible also makes it simple to just write your query in plain sql as well, or as the Lucid ORM has available, just fragments of your query (say the join statement) as raw sql: https://docs.adonisjs.com/reference/database/query-builder#w...
Along with debugging, printing out the sql, and support via the Adonisjs REPL "Ace", it makes for a very nice experience.
It's supposedly been possible for quite a while, but every time I talk to someone (granted only a few people who would actually want to use and benefit from it in their software) about it they say "it's missing X" or something of the sort that makes it a total non-starter.
I would argue that the current interface is broad and can be adapted to a wide range of needs.
The real value I see (and an area I've been exploring recently) is creating abstractions around prompt engineering.
The idea is that at the moment, the better the prompt -> the more relevant the output.
However businesses that act as proxies for chatgpt can take user input -> inject it into their prompt-engineering system -> deliver better results.
As a basic example:
1) You provide an application that helps people maintain their cars
2) You have a freeform question input about specific car maintenance tasks
3) Knowing certain prompt-segments that typically lead to better results for the category of "novice car maintainer", you parse their question, upgrade it with your prompt-generator, then send that question to chatgpt
Additionally, you can go even further by generating the information _before your customers even ask_.
Ask chatgpt what the most common questions are about each piece of car maintenance (could be installation instructions, cost of parts, etc) and have these available straight in the application.
It's as if chatgpt is the database, and prompt engineering systems are the query-optimizers. I know certain things I can alter about a prompt to increase the relevance and usefulness of the results to my target audience.
Additionally, it will be interesting to see how people use learning methods to auto-generate the best prompts (it's a bit of machine-learning on machine-learning happening). I've spoken to one person working in this space, and it's interesting how effectively the outer layer is reversing the prompt-parsing layer buy scoring the end-to-end results.
Currently working with a couple of people in this space and it's exciting the types of results that user-focused engineering can bring to an improved user-experience.
• Remote: Yes
• Willing to relocate: Not at this time
• Technologies: Typescript, Nodejs, React, F#, Python, Erlang, Java, Ruby, Postgres, Kafka, ElasticSearch, Redis, Security, DevOps
• Résumé/CV: https://www.banashek.com/resume.pdf
• Email: jon åt banashek.com
-----------------------------
Hi, I'm Jon.
I've had numerous roles and responsibilities under the umbrella of "techology-related problem-solver". I have a fairly T shaped skill-set and tend to gravitate towards areas where I can have the largest impact. Sometimes that means architecting and building distributed systems solutions and libraries, other times it means working with security teams to improve the Secure SDLC for an engineering group by growing developer mind-share into Shift-Left. My lauded communication skills have enabled me to solve some engineering problems with soft skills alone.
I've worked in the healthcare space for the last ~5 years, and have found my cross-knowledge of development and secure practices to be a boon in leveling-up engineering groups perspectives on handling and protecting sensitive data (HIPAA and friends).
Technology-wise I've worked with quite a few different stacks (most recent noted above) and don't have much trouble picking up new things and diving deep. I tend to stay abreast of technology developments and trends by consuming sites like HN or subreddits for specific languages/technologies (In communities which I'm not directly involved, I check in once a week to see how different groups shape their perspective on discipline-wide problems). I also enjoy the opportunity to dive deep into the source code of an open-source project to answer questions that aren't well documented or blogged about.
Most of my work is closed-source, but I tend to hang around in slack/discord/gitter/etc and try to answer more than I ask.
I'm currently looking for full-time remote opportunities.
I am curious about the "actively take options" part. Other than not allocating resources towards language support in other editors (which is the one thing I remember hearing before), what other actions have they taken?
I would say that Vercel has specific enhancing functionality to make using NextJS "better" than self-hosting it. That seems somewhat similar to me.
Checking on kotlin, it has a foundation, with Google being one of the backers, which seems like a fairly decent way to advertise that it's not completely locked-in.
Also when you say "actively collaborate with an OS vendor to replace an existing language, stagnated on purpose, to help sell Kotlin", are you implying that they are somehow responsible for holding-back and stagnating java? That seems like quite the claim. Java seems to be getting more modern quite rapidly with it's new release cadence.
Great work with Next!
The quote you mention doesn't seem all that different from other companies building paid-for dev-tools that help their userbase in ways not directly related to their project.
This seems similar to Vercel putting out articles about how they make next.js better, when it's obvious that the integration to their system is how they make money.
One could say that:
In the "fortunes" category, the giraffe F# benchmark, which is a single 150 line file used 100% as advertised in the documentation performs better than many java frameworks, some CPP frameworks, etc: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...
However, that's not accurate. It's an incomplete take based on a fragment of the data. It's a matter of data presentation and sympathy/empathy with your audience (IMHO).
The issue here seems to be of data-display and intent of information.
From what David Fowler has to say: https://twitter.com/spetzu/status/1592255871199096833, it does seem as though the engineering portion are using the benchmarks in an expected way. Multiple implementations to see "what perf impact is there to removing X part of the code" piece-by-piece.
The benchmarks display is a comparative-between-frameworks visualization. For that to be realistic, the types of implementations would need to be the same (hence my questioning the "Implementation Approach" column). Instead, you can find various quotes online of people comparing frameworks based on the techempower scores (usually just the fortunes or plaintext), which is disingenuous at best.
I think that a more varied and utilized implementation-approach column could help alleviate this aspect of it.
The other valuable data that doesn't have the best UX for access is: how is the a single framework-test doing over time? You can head to tfb-status and download the data for each run, but then you'll need to correlate commit-ids with your own changes to build a chart.
Either way I can say that I do like the idea of the benchmarks and I've learned some interesting things diving into some of the more stripped framework/implementations found within.
Saw this update for Avalonia that I wanted to share, since the prospects of the new features are exciting.
I've made a couple of small-medium GUIs using it and the experience has been nice.
I use it with F# and an elmish functional-reactive library: https://avaloniacommunity.github.io/Avalonia.FuncUI.Docs/
I also develop on and primarily for linux (pop_os, but use my applications on macos as well).
It's not perfect, and a commonly cited criticism is that the documentation could be more robust, but in the sea of GUI frameworks this is my favorite target if electron is not viable (still IME the most mature and supported).
It is much more prevalent in the f# community (at this point `dotnet restore` is a perfectly fine default until you hit trouble), but isn't limited to just being applied there.
Here's a small gist where I use fable-py to use the python prettymaps project that was posted a week ago on HN: https://gist.github.com/Banashek/1cc3d8435843bcff230906fb037...
Similar in F# land is https://github.com/Zaid-Ajaj/Fable.Remoting While both client and server are designed to be used from F#, they should be able to be used from js/ts as well as c# if desired, though I have not tested that.
I have zero trouble developing on linux.
Building GUI or non-GUI software works fine. I use Rider and work on web systems, a handful of scrapers that feed some data I collect, as well as various small GUI systems.
I think F# might have _the highest number of viable ways_ to build a GUI application if that's what you're looking for.
You can go the fable (F# -> JS transpiler) route and use any of the js tools (electron, nodegui, etc). The popular one's (react, preact, svelte, etc) have type definitions that folks have already written.
F# works with most of the dotnet gui libraries just fine, though I don't know for sure the story about winui, but from people I know working on production systems using it, they recommend to avoid it. So you've still got WPF, etc.
For the newer cross-plat stuff, there is Avalonia, Uno Platform, Xamarin (with the natives) or the newer version MAUI.
---
The thing here is that there aren't really limitations to almost all of the things I've listed above. Transpilation targets work fine, as do the dotnet targets. Almost every one of these also has "Elmish" frameworks (Functional Reactive Programming state management) suited for the purpose:
* React -> Elmish + Feliz * Avalonia -> Avalonia.FuncUI * MAUI -> Fabulous etc
---
I've never felt constrained building GUIs in F#, other than some of the dumpster fire that was Xamarin.Forms and the Xamarin build tools (native targets never gave me any problems that I can remember).
I took a partial Fabulous 1.0 (Xamarin Forms) application that I had only worked a couple days on, and out of anger with Xamarin build tools lifted and shifted to a react-native application. Almost my entire elmish (view-logic layer) was preserved, and I just had to change the view elements out from Xamarin.Forms elements to React Native elements.
---
I don't work with F# too much in an official capacity these days, but it's a decent tool to have as a default.
I remember when kicking the tires on postgrest/postgraphile that I found validation and error handling to be one of the less intuitive areas. Not the actual field-level constraints, but how to adapt it to fit a fast-fail vs slow-fail model.
When I had attempted before, the only ergonomic option was fast-fail (the first check constraint violated would bubble the error upward) rather than slow-fail (collect all invalid fields and return the collection of errors, which IME is more common on average web forms or api requests).
Looking at the single code file and tests, I see only singular field errors. Has a more ergonomic approach to validation-error collection been developed other than writing a large function to iterate the new record fieldwise against the schema?
Just thinking out loud, I don't know how naive that is (see gpl violations) or how something like that would even be economically structured.
Websockets to me don't seem like the ideal approach here, since the communication is just from the server to the client (an update of a data payload once an event occurs in the backend system).
Websockets have quite a bit of technical complexity requiring significant architectural effort to ensure reliability of a service. Ably is a company that offers websockets as a service and has some good blog articles to start you out if you're sure about this path.
What I would recommend with the details provided so far is to either use SSE or long-polling. The "downsides" are often over-exaggerated, and there are lots of businesses that one would assume use websockets that really are just using SSEs because operationally and architecturally it is vastly simpler to reason about.
I can almost guarantee that the complexity of adding another API endpoint will be drastically less than standing up a reliable websocket infrastructure.