snearch + programming_language   190

ATS
While the nature of the sophisticated type-checker gives ATS a more nuanced syntax that may harder to grasp, once you master that syntax, you will find that ATS is one of the most fun programming languages to write code in, and that the joy you get from seeing a program that you (and the compiler) know is correct is unparalleled by any other language, hence why I named this series “The Joy of ATS.”
fun_in_programming  ATS  Programming_Language 
9 days ago by snearch
Forth: The Hacker’s Language (2017) | Hacker News
aidenn0 3 hours ago [-]

I don't use forth personally, but it is at a very interesting corner of the envelope.
I find it both easier to implement than C and easier to develop in than C, while being nearly as fast as C, and often lower footprint than C. It's a really good language for "I really don't want to write in assembly, but there are no decent HLLs already implemented for my target"

reply
fun_in_programming  Forth  Programming_Language 
5 weeks ago by snearch
What's a good 'scripting' functional programming language for quick and dirty tasks, like scraping a website or parsing logs, that is fast to prototype in and has lots of easy-to-use libraries? - Quora
I've been perfectly happy using Haskell for shell scripts and one-off tasks. Especially with some of the recent new features like deferred type errors and type holes, Haskell has become very interactive which makes it a solid choice for interactive development and prototyping.

Scripting

Recently, I've been writing most of my shell scripts in Haskell. For example, here's a little pager script I wrote that has a few different command line options and calls out to emacsclient. It's actually quite nice: when I write something like git log in my Emacs shell, it just opens up a new buffer right in the same Emacs session which lets me easily move around the output, copy parts to other buffers or even save it somewhere.

Unfortunately, Haskell is a bit verbose for common script tasks by default. But this isn't a fault of the language—it's just a library problem. And people have written libraries to make shell scripting much nicer, like Shelly. (There are code samples at the very bottom of the readme; it's a shame they're not more prominent.)

One nice thing about using Haskell for scripting like this is that the various parts of Shelly are just normal Haskell values and functions, which makes it very easy to build up abstractions with them. For example, it's just one line of code to wrap up a common command in a function so that y ou don't have to copy and paste parts of it everywhere.

Text

Haskell also has some really great libraries for text wrangling. There's a parser library called Parsec which I've found far easier to use than regular expressions for everything beyond the really trivial. For things like HTML and XML, I've really enjoyed a lightweight library called tagsoup which makes simple tasks pretty concise. For example, here's a little snippet I just wrote for applying a function to every href attribute in an a tag:
Haskell  Scripting  functional  Programming_Language 
march 2019 by snearch
Ask HN: Which functional language has the best ecosystem for a web backend? | Hacker News
Odytrice on Jan 17, 2018 [-]

Well, IMHO It's F#. F# is really good due to it's better tooling and you have access to the plethora of libraries and framework of the .NET Ecosystem. Unlike Scala or Kotlin, F# retains a lot from it's functional roots like - Automatic Currying - ML Type System
Plus it adds some really innovative features like - Type Providers which allows you to lazily/automatically generate Types for real world data/systems which is pretty cool.

Ultimately it boils down to the Runtime/Tools/Ecosystem which is also true for Scala and Kotlin but it retains a lot from it's OCAML Heritage which makes it lean more towards FP than it contemporaries

PS - I didn't mention clojure as I don't consider dynamic languages a good fit for building large codebase backend systems
---
ninofloris on Jan 17, 2018 [-]

We at Crowded (https://crowded.co) have had some very good successes with running F# on .NET Core, both with giraffe and just bare ASP.NET Core. The ecosystem has no shortage of good tooling and libraries, all well maintained by knowledgeable authors. Application performance and our development productivity is excellent, osx/linux tooling took a while to mature but is only getting better than ever now.
The choice we made when .NET Core was still in development (pre 1.0) for it to become our main stack is definitely paying off!
...

xstartup on Jan 17, 2018 [-]

I am also leaning towards F#. What do you use for json serialisation? Any guide which describes basic steps to put together a web api.


edgarsanchez on Jan 17, 2018 [-]

This e-book http://products.tamizhvendan.in/fsharp-applied/ should get you covered, Version II is just out :-)
Webdevelopment  functional  Programming_Language  F#  PRJ  PRJ_choice_of_web_programming_language  Elixir  Phoenix  framework  type_providers  book_recommendation 
february 2019 by snearch
Programming in Scala, 3rd Edition: Amazon.de: Martin Odersky, Lex Spoon, Bill Venners: Fremdsprachige Bücher
I am a data scientist who relies heavily on python and now that my work deals with ever growing data sets I decided to try scala. What I love about this book is that it is not just a scala syntax tutorial but a philosophical adventure into scalable language design as a whole. This makes the book invaluable to developers coming from a modern scripting language background as it changes the way one thinks about writing code. The technical content and writing style are superb - this is the only scala book you will need.
Scala  Programming_Language  book_recommendation 
december 2018 by snearch
Channels, Concurrency, Cores: A New Concurrent ML Implementation (2017) [video] | Hacker News
bjoli 4 hours ago [-]

Not only that, but guile just got a 2-4x speedup in the 2.9 branch (what will become guile 3).
It is a really nice scheme implementation and very capable. The stuff the guix people have done is amazing!

Concurrent ML is my favourite way of writing multi threaded parallel programs. It is a bliss! One can say that reagents in multidirectional ocaml is another step downwards in that it in most regards generalises CNL, but in its base form it is not as simple to work with.

Guile fibers is amazing to work with, and has good repl integration. The performance I am able to get out of it is nothing short of amazing.
Guile  Programming_Language  PROs  Scheme 
october 2018 by snearch
Is Perl6 faster than Perl 5 on average? : perl6
https://tutorial.ponylang.org/ The only VM besides parrot with concurrency safety and not using copy-all. Erlang has a slow VM and passes everything as copy and is still fast (a IO bottleneck cost you min. 50x), but sharing makes the difference. And it's the fastest language around, faster than C++ with OpenMP. And proper syntax and types. Go is nice but limited, Rust is lying all over to its users such as perl5+6. Hype-driven development, such as perl6.

...

[–]reini_urban 2 points 2 days ago
Rust allows memory unsafety: https://doc.rust-lang.org/1.14.0/book/unsafe.html which normal languages only need for their FFI. Here it's a keyword and used all over their stdlib.

Rust is concurrency unsafe. It does not protect from deadlocks and race conditions, but calls it "Fearless Concurrency" https://doc.rust-lang.org/book/second-edition/ch16-00-concurrency.html Instead you need to fear it, and work around with manual mutex and semaphores. Concurrency safety means the compilers does this for you, or the compiler avoids locks at all. Like parrot or pony do. Or fall back to copy-only, no shared data. Which is the desperate slow path Erlang and Go went. There refs are either read-only or copied.

permalinkembedsaveparentreportgive goldreply

----

[–]reini_urban 0 points 9 hours ago
Or perhaps you accept the answer -- and accept that MoarVM could one day approach the JVM's abilities for some workloads -- but think C++ is not remotely the same deal as C.

Nobody in his sane mind will accept that.

This has nothing to do with cperl or perl5. These are dinosaurs and the slowest of all big dynamic languages. Only moar is slower, but that is not considered big.

It has to with analyzing the three fastest dynamic languages around: v8/javascript, and the two lua's with a jit: luajit (= tvmjit) and potion (= p2), which was based on a pre-luajit lua with classes and mop (for ruby). you can also look at guile btw. which would be an excellent backend, much better than moar. tvmjit is based on the very fastest dynamic language design, and got a very good nqp level compared to moar. 50x better and faster. 10x smaller. You could also at pypy/rpython or graal to the mix, but these are already the monsters like v8 or perl6. These can only be improved by a huge compiler expert group, and will never reach the luajit, potion or JVM levels, just by trashing the caches with their dynamic bloat.

If you look at these you'll see that moar will never ever reach any of these capabilities. And with the latest jit plans it became even worse. Startup time is at the JVM level, even worse. Remember perl6 is to be used mostly for smallish scripts, not huge programs and servers. Run-time is at the 100x slower level, not even the 10x slower level, where php,ruby,python,perl5 are. That's trivial to observe by looking at all the bloat carried around at runtime, and what it is compiled to. And the architectural design, as I said before. You can demand a native stdlib, as pypy or common lisp does, when you got a fast VM and compiler, but not with something like perl6/nqp/moar.

There are certain level's you can agree to reach and certain levels which are just out of reach. JVM or luajit/potion are totally out. Even perl5 seems to be out of reach. The typical Moose benchmark comparison is totally bogus, there's nothing worse designed than Moose. (Well, Distzilla would have to carry that bag, but we are talking about OO). You can compare it to the realistic and recommended OO systems in perl5, which are cperl and Mouse, and there perl6 looses badly. Given that perl5 has a horrible VM design, with its broken ABI and stack design, that's quite a feature.
choice_of  Programming_Language  Pony  Erlang  Perl  Perl6  Rust  CONs  Lus  LusJIT  Potion  VM  Parrot  Moar  Insightful  higher_quality  Urban_Reini  cperl  cro  framework  criticism 
june 2018 by snearch
Tiny Pascal (2017) | Hacker News
WalterBright 10 hours ago [-]

I remember when the source code for this was published in BYTE magazine. I figured out every line of it, and I thought how it worked was utterly magical. It was a big factor in me going into compilers.
Compilerbau  Tiny_Pascal  Pascal  Programming_Language  Bright_Walter  D 
june 2018 by snearch
Zonnon – Wikipedia
Der Name Zonnon hat keine weitere Bedeutung. Er wurde gewählt, weil er ähnlich wie „Oberon“ klingt und somit die Kontinuität dieser Programmiersprache ausdrückt. Der Buchstabe Z in Zonnon soll andeuten, dass es sich um die letzte Programmiersprache der Oberon-Modula-Pascal-Familie handelt.
Oberon  Programming_Language  Zonnon 
september 2017 by snearch
New implementation of Git in OCaml | Hacker News
yen223 10 hours ago | unvote [-]

I've been using OCaml for a couple of side projects, and I have been absolutely blown away by the amount of power this language provides. It strikes a nice balance between high-level expressiveness, while not sacrificing on performance.
I feel like OCaml is one of the programming world's best kept secret - if it had better tooling and better marketing, it could have taken over the world. I'm cautiously optimistic about ReasonML for this reason.
reply
Reason  OCaml  PROs  TOP  Inspiration  functional  Programming_Language  Profession  Professional_Software_Development  programming 
august 2017 by snearch
Perl 6 Einführung
Perl 6 ist eine stufenweise typisierte Sprache gradually typed; es erlaubt sowohl statisches als auch dynamisches Typisieren.
Perl6  gradually_typed  Programming_Language 
february 2017 by snearch
ZigBee Alliance stellt universelle Sprache fürs Internet der Dinge vor | heise online
Die Sprache und Abstraktionsschicht Dotdot ist in erster Linie eine Weiterentwicklung der ZigBee Cluster Library. Das Bemühen, Geräte trotz unterschiedlicher Protokolle zusammenzubringen, bleibt lobenswert.
ZigBee  wireless  networking_hardware  Programming_Language  Dotdot  IoT 
january 2017 by snearch
fsharp-cheatsheet
A tuple is a grouping of unnamed but ordered values, possibly of different types:

// Tuple construction
let x = (1, "Hello")

// Triple
let y = ("one", "two", "three")

// Tuple deconstruction / pattern
let (a', b') = x
F#  Tuple  Programming_Language 
may 2016 by snearch
Hello Lua! - Haxe - The Cross-platform Toolkit : programming
I'm going to go the other way on this one. I used it about two years ago and the lack of a "standard" library made it almost useless to me. It seemed like every common operation had a caveat where it behaved differently in one of the target platforms.

That's not necessarily bad, but at that rate it was just easier to write in the targets than try to work around Haxe too. The standard library is also really small; for example there's no JSON support and I think it lacks a cross-language IO. Again, not terrible but it really limits the use-cases if you have to go into each language's libraries and write code for each one individually using guards.

Finally, at least back then it was painfully slow because you had to add in the Haxe library to your target languages too. Java doesn't use native Java Strings, it uses Haxe strings, etc.

>> There's JSON support http://api.haxe.org/haxe/Json.html and a cross-platform IO http://api.haxe.org/haxe/io/
haxe  Programming_Language  multi_platform  transpiler  Lua  programming  games  CONs  criticism 
may 2016 by snearch
Programmiersprache: IBM bringt Swift auf den Server und in die Cloud | heise online
Apples Strategie, Swift unter eine Open-Source-Lizenz und auch für Linux zur Verfügung zu stellen, scheint tatsächlich zu einem größeren Ökosystem zu führen. Beispielsweise wurde kürzlich mit Swifton ein von Ruby on Rails beeinflusstes Webframework für Swift vorgestellt, das unter OS X, aber auch unter Linux läuft. Relativ neu ist darüber hinaus mit RxSwift ein Projekt, das die reaktive Programmierung mit Swift ermöglichen soll.
Swift  Programming_Language  server_side  backend  IBM  framework  Swifton  Webdevelopment  reactive  programming  RxSwift  libraries_programmers_tools 
april 2016 by snearch
Ponyo for Standard ML : programming
[–]eatonphil[S] 10 points 9 hours ago

The biggest advantage Standard ML has is its simplicity. The language is simpler, the tooling is simpler. This doesn't inherently make Standard ML better and worse, but I prefer it. OCaml has complex syntax, syntax extensions, build tools, web servers. Though perhaps no worse than Haskell or Scala.

What I can bring to the table with Ponyo is some tools to make things easier in Standard ML. Furthermore, there is a dearth of knowledge available for Standard ML. If I can do nothing else, I can provide future learners with a well-documented codebase and build tools so they can build the next generation.

And even if the simplicity of Standard ML is not your cup of tea, there is a lot you can learn from it that may help you learn other languages like Haskell, Scala, and OCaml. At least, it has done so for me.
functional  Programming_Language  ML  SML  Ponyo 
march 2016 by snearch
Why I use ggplot2 – Variance Explained
…one place I lose tons of street cred in the data science community is when I talk about ggplot2… ggplot2 is an R package/phenomenon for data visualization. It was created by Hadley Wickham, who is (in my opinion) perhaps the most important statistician/data scientist on the planet. It is one of the best maintained, most important, and really well done R packages. Hadley also supports R software like few other people on the planet.
Statistik  Wickham_Hadley  ggplot2  R  Programming_Language 
february 2016 by snearch
Why I’m joining the Dart team, of all places — Medium
A big reason why I’m perfectly willing to bet my career on Dart is that it’s not just me. There are a lot of smart people who use it and like the experience.
...
Dart  Programming_Language  Google 
january 2016 by snearch
What Can You Put in a Refrigerator? : programming
[–]Jacoby6000 46 points 9 hours ago*

Scala solves this problem really well with typeclasses.

You can define a typeclass like

case class Refrigerated[T](thing: T) // this is just something holding things that have been refrigerated.
trait Refrigeratable[T] { // this is the typeclass
def refrigerate(thing: T): Refrigerated[T]
}

Now we have a refrigerated object that holds some object that's been refrigerated, and it looks like I'm about to do some class composition, but I'm not. Bear with me.

Now, we have some sort of data class

case class Pillow(fluffiness: Int, warmness: Int)

Pretty straight forward, we now have a Pillow with measurable fluffiness and warmth

Next, lets implement refrigerated for pillow.

implicit val pillowRefrigerable: Refrigerable[Pillow] = new Refrigerable[Pillow] {
def refrigerate(pillow: Pillow): Refrigerated[T] =
Refrigerated(pillow.copy(warmness = pillow.warmness / 2))
}

So there's an implementation of Refrigerable for pillow. Refrigerating a pillow just cuts the warmness in half.

So actually using the Refrigerable stuff. There's two ways to go about this. One way is to just use the Refrigerable instance to refrigerate the pillow.

def refrigeratePillow(pillow: Pillow): Refrigerated[Pillow] = pillowRefrigerable.refrigerate(pillow)

Nothing special there. You could basically do that in any language. So how does scala do it better? Well, we can define a refrigerate method for anything Refrigerable like this:

def refrigerate[T](thing: T)(implicit refrigerableInstance: Refrigerable[T]): Refrigerated[T] =
refrigerableInstance.refrigerate(thing)

Now this is really cool. Anything type that we have a Refrigerable instance for, can be used as an argument for refrigerate. And we don't have to explicitly state what Refrigerable instance we're using. Calling it looks like

val refrigeratedThing = refrigerate(anythingWithARefrigerableInstanceHere)

Okay. We still haven't gained a whole lot. All we've done so far, is make it so we don't have to explicitly state what Refrigerable to use. So let's go an extra step. Let's make it so we just call refrigerate on the Object itself rather than passing the object as an argument to a method. This is possible, because scala let's us make extension methods for generics.

implicit class RefrigerableOps[T](thing: T)(implicit refrigerableInstance: Refrigerable[T]) {
def refrigerate: Refrigerated[T] = refrigerableInstance.refrigerate(thing)
}

Okay, now this is really cool. We've defined a method for any type for which we have Refrigerable in scope. This means we can now refrigerate our pillow more easily:

val refrigeratedPillow = myPillow.refrigerate

What?! That's great! And it gets better. Now that we've implemented this boilerplate, giving other things this wonderful syntax is easy. Let's say I want to refrigerate my cousin, because she's too hot.

case class Cousin(hotness: Int)
implicit val refrigerableCousin: Refrigerable[Cousin] = new Refrigerable[Cousin] {
def refrigerate(cousin: Cousin) =
Refrigerated(cousin.copy(hotness = cousin.hotness - 1))
}

Now we can make our cousin less hot! Great!

val refrigeratedCousin = cousin.refrigerate

This is basically a good way to make things open to extension without subclassing it's awesome! This means you can create generic methods with specializations for implementations. For example, prepending to a cons list can be implemented with the normal cons operator, which is O(1), whereas if you were to reuse the same generic implementation, and pick say, the array implementation, you get an O(n) implementation (I think. don't lynch me.).

You can even do more to simplify making the Refrigerable instances. You can effectively make them one liners.
...

[–]kirbyfan64sos 5 points 7 hours ago

In Felix, this whole thing would basically be something like:

// The wrapper type.
struct Refrigerated[T] { value: T; }

// The type class/interface.
open class Refrigable[T] {
virtual fun refrigerate: T -> Refrigerated[T];
}

// A pillow.
struct Pillow { fluffiness: int; warmness: int; }
// The Refrigable instance.
instance Refrigable[Pillow] {
fun refrigerate(pillow: Pillow) =>
Refrigerated$ Pillow (warmness = pillow.warmness / 2,
fluffiness = pillow.fluffiness);
}

// A cousin.
struct Cousin { hotness: int; }
instance Refrigable[Cousin] {
fun refrigerate(c: Cousin) =>
Refrigerated$ Cousin ( hotness = c.hotness - 1 );
}

Now you can do:

pillow := whatever;
refrigerated_pilow := pillow.refrigerate;

I think that's shorter than Scala! ;)
Programming_Language  Felix  Scala  OOP 
november 2015 by snearch
An Interview with Brian Kernighan
M: Maybe you can help by being more concrete: can you recommend us some books, computer science books or otherwise, which you think have had a big influence on you?

K: The only computer science book I read more than once, that I actually pick up every few years and read parts of again, is The Mythical Man-Month by Fred Brooks, a great book. Partly it's very well written and partly the advice in it, even after more than 25 years, is still highly relevant. There are of course details that are different, some things we approach differently because we have more mechanization and more computer horse-power, but there's an enormous amount of good advice in that, so I recommend it highly. That's the only computer science book I can think of that you read for some combination of pleasure and insight.
C  Programming_Language  Kernighan_Brian  Interview  ML  Lebenszweck  Profession  book_recommendation 
september 2015 by snearch
Lambda Nights
Standard-ML is basically a Domain-Specific Language for writing compilers.
— Dr. Lukasz Ziarek
ML  functional  Programming_Language  DSL  Compilerbau 
april 2015 by snearch
Stupid Template Tricks: Snake
By breaking down Nibbler to simple subproblems, implementing it using C++ metaprogramming is not hard. There are probably more clever or efficient ways to implement Snake. But that's not the point. Sure, template metaprogramming uses weird syntax and has major annoyances. But once you get past those initial barriers, you'll find a surprisingly competent functional language.
Snake  game  C++  Templates  functional  programming  Programming_Language 
february 2015 by snearch
F# 2014 – A Retrospective and Call to Action | Hacker News
fsloth 3 hours ago | link

This sounds swell!

BTW: Tomas Petricek's "Real-world functional progamming" as well as "Expert F#" by Don Syme are excellent introductions to the language.

reply
F#  functional  Programming_Language  tutorial  book_recommendation 
december 2014 by snearch
« earlier      
per page:    204080120160

related tags

*BSD  0.9  Ada  ADW  algorithm  Alice_ML  amazon  Android  Apple  assembler  asynchronous_event_processing  ATS  auswerten  backend  BER_MetaOCaml  Bitmanipulations  book_recommendation  borrow_checker  Brach_Gilad  breakout  Bright_Walter  BuckleScript  C  C++  C--  CakeML  Carmack_John  Ceylon  choice_of  citations  Clang  client_side  CLISP  closures  Coffeescript  COMMON_LISP  community  compiler  Compilerbau  CONs  Constructor  Coq  Coro::AnyEvent  Coroutines  cperl  criticism  cro  Crystal  D  Dart  declaration_syntax  dependant_types  dependent_types  Development  Dlang  Dotdot  DSL  dynamic_class_loading  Ecto  Elephant  Elixir  Elm  Emacs  Embedded_Systems  Erlang  Essay  examples  F#  Facebook  factor  Felix  formal_verification  Forth  framework  FreeBSD  Free_Pacal  functional  functrust  fun_in_programming  game  games  Generics  ggplot2  git  GLib  GNOME  GObject  Golang  Google  goprotobuf  gradually_typed  Guards  GUI  Guile  hack  Hashing  Haskell  haxe  Hecl  higher_quality  history  html5  http  http-Server  IBM  Idris  imperative  Informatik  Ingenieur  insightful  Inspiration  Interfaces  Interview  iOS  IoT  iPad  Irken  Java  Javascript  Jester  JGit  JIT  Julia  Julialang  Kernel  Kernighan_Brian  Knuth_Donald_E.  Kotlin  Lazarus_IDE  Lebenszweck  Lerdorf_Rasmus  Lernherausforderung  libraries_programmers_tools  Linux  Linux::Programmierung  LISP  LiveScript  Lua  Lunascript  Lus  LusJIT  Mathematik  McCarthy_John  Metaprogramming  MiniCaml  ML  Moar  model  Modula-2  Moore_Chuck  Mozilla  Multiprocessing  Multithreading  multi_platform  native  Netty  networking_hardware  new-perspective  Nimrod  Nix  no_loops  numerische  Oberon  Oberon-2  Objective-C  Object_Pascal  OCaml  OOP  Opa  Open_Source  Open_Source_projects_to_learn_from  OS_X  Parrot  Parsing  Pascal  Perl  Perl6  Phoenix  Php  php5  Php7  Php8  Physik  pointfree  Poly/ML  pony  Ponylang  Ponyo  Ponyo.Net.Http  Porting_Software  POSIX  Potion  print!!!  PRJ  PRJ_choice_of_web_programming_language  Profession  professional_software_development  Programmierung::Server  programming  Programming_Language  proof  PROs  Protocol_Buffers  Purescript  PureScript  Pyret  Python  Quantenphysik  Quantentheorie  R  Racket  Raspberry_Pi  reactive  Reason  Reflection  REPL  Reverse_Engineering  Ruby  Rust  RxSwift  Scala  Scheme  scripting  serialization  server_side  Siram_Aditya  Skriptsprache  Slash  SML  Snake  Snapshot  Star_Fox  static_typing  Statistik  Stony-Brook  Stärken_und_Schwächen  SVG  Swift  Swifton  System_Programming  Tang_Audrey  Templates  The_Rust_Guide  tinygo  Tiny_Pascal  Tipps_und_Tricks  Tools_Software  TOP  Torvalds_Linus  transpiler  Trend  Tuple  tutorial  Typescript  type_providers  type_safe_builders  Unicorn  unix  Ur  ur/web  Urban_Reini  Vala  Video  VM  volatile  WebAssembly  webdevelopment  WebGL  Webserver  Wickham_Hadley  Windows  wireless  Wissenslücken  XEmacs  Xtend  Zig  ZigBee  Ziglang  Zonnon 

Copy this bookmark:



description:


tags: