Live data from Hacker News

‘Woof’, a pure Scala 3 logging library

medium.com

31–40 of 50 posts

Re: ‘Woof’, a pure Scala 3 logging library

#31
post #19

Earlier quoted context omitted.

> I remember keeping it simple as an ultimate goal but maybe I am just too for this FP peeing contest? why is it such a frickin' deal to log a message somewhere? Don't know about others but for me it is about being able to easily verify that my logging is setup correctly. Once you write your logging to some monad (the library we use does not require it to be IO) testing it becomes trivial with a WriterT monad where i…

Why would I verify logging which itself is a verification instrument? And, seriously, how hard is it to emit a diagnostic message so I need a test for that to get it right?

There are tests of tests, why wouldn't there exist techniques for the verification of logging?

Re: ‘Woof’, a pure Scala 3 logging library

#32
post #16

Earlier quoted context omitted.

As an observer of this exact phenomenon, I suggest that it is due to the culture that comes with scala. In any given scala-centric organization, there's going to eventually be someone who has mastered the art of talking High Scala. Unless there is someone equally skilled on both dimensions (persuasion and SW eng), and unfortunately, someone approximately as senior, then there is an interative game where added abstrac…

Erik Meijer, one of the early practitioners and contributors of Scala, and a coauthor of Odersky's Coursera courses on Scala, believes that "Mostly Functional Programming Doesn't Work" [1] Note it's "mostly functional" that doesn't work, not functional. He believes you have to go all in to reap its benefits, other way you're just deluding yourself with another faddish "miracle cure". All of the above are Meijer's opi…

Erik Meijer has also brought FP into .NET via VB, a couple of years before Scala was relevant, or F# started to actually matter.

So in a sense, he also tried a miracle cure before changing his mind.

Re: ‘Woof’, a pure Scala 3 logging library

#33

I'm sorry but I don't understand why . It seems like this falls for the same kind of over-engineering which caused log4j's issues in the first place. > Announcing Bark! A logging library written purely in C! Blazingly fast! 0 dependencies! It even prints file and line numbers! #ifdef DEBUG #define LOG(msg, ...) printf("[__FILE__ __LINE__]: " msg, ...) #else #define LOG(msg, ...) #endif

Ah, but does it also plug into syslog and is able do cluster logging via Sun RPC?

Re: ‘Woof’, a pure Scala 3 logging library

#34

Can someone please explain the purpose of a logging library (woof, log4j, etc)? There must be something beyond writing text to an external file, possibly with different error levels, that I'm missing. This is a serious question. I truly do not understand what you gain by depending on an external library for this (seemingly) simple operation and would appreciate some insight. Thanks!

If it's just writing to a file or the screen you don't need much.

But then you need interpolation of arguments. And other appenders, what about logging to the network for aggregation elsewhere. And logging levels. And a couple more features and corner cases.

And before you know it, you're writing a lot of code which could be packaged into a library.

But you don't need to, like with most library stuff you could write it in-house yourself.

Re: ‘Woof’, a pure Scala 3 logging library

#35
post #32
post #16

Earlier quoted context omitted.

Erik Meijer, one of the early practitioners and contributors of Scala, and a coauthor of Odersky's Coursera courses on Scala, believes that "Mostly Functional Programming Doesn't Work" [1] Note it's "mostly functional" that doesn't work, not functional. He believes you have to go all in to reap its benefits, other way you're just deluding yourself with another faddish "miracle cure". All of the above are Meijer's opi…

Erik Meijer has also brought FP into .NET via VB, a couple of years before Scala was relevant, or F# started to actually matter. So in a sense, he also tried a miracle cure before changing his mind.

I don't count it against him that he changed his mind. Changing his mind through experience makes sense to me :)

Re: ‘Woof’, a pure Scala 3 logging library

#36
post #7

Having been primarily a Scala dev for the last 12 years I feel like people have slowly lost their minds over what pragmatic FP in Scala should be. People are willingly recreating the Java situation of 'I don't know the project yet but I know we need Spring!' with these ridiculous libraries from Haskell zealots for no obvious benefit. The ergonomics of this lib out of the box are literally worse for no reason, and wor…

This problem with the scala community exists because it is composed of two different philosophical schools of thought. There's the ML camp, which is where we get all of the awesome pragmatic features of the ML family of languages (Martin Odersky has been very clear that Scala is philosophically an ML-family language). And then we get the Haskell camp, which rightly determined that the Haskell ecosystem was terrible.…

Note Robert Harper, the author of Existential Type and one of the big names in ML, has a bizarre crusade against Haskell.

I find it weird that so many of his articles seem to be lashing out against (the internet perception) of Haskell, almost a popularity contest between ML and Haskell, when the adoption of either language is marginal and could use some cooperation between the two, instead of framing it as a zero-sum competition. ML and Haskell are allies, not enemies.

This obsession is a shame, since Robert Harper is obviously an intelligent person. I remember some of his feuds with people from the Haskell community were... embarrassing.

Most feuds are embarrassing. The proglang community could do with fewer of those.

I don't remember Simon Peyton Jones ever speaking ill of ML, for example. There's an example to follow!

Re: ‘Woof’, a pure Scala 3 logging library

#37
post #29

Earlier quoted context omitted.

Why would I verify logging which itself is a verification instrument? And, seriously, how hard is it to emit a diagnostic message so I need a test for that to get it right?

If you have some rare (rare as in it happens once every few months or something like that) error and you need logging about it. Also testing it ensures nobody by mistake removes that bit of logging by accident.

code reviews would probably be a better fit to prevent that.

Re: ‘Woof’, a pure Scala 3 logging library

#38
post #30

Earlier quoted context omitted.

This problem with the scala community exists because it is composed of two different philosophical schools of thought. There's the ML camp, which is where we get all of the awesome pragmatic features of the ML family of languages (Martin Odersky has been very clear that Scala is philosophically an ML-family language). And then we get the Haskell camp, which rightly determined that the Haskell ecosystem was terrible.…

Add to it the disease that all guest languages suffer from creating idiomatic wrappers instead of just directly calling into the rich ecosystem of the existing platform.

That's true to some extent of the native language as well. Hibernate, for example, is a java(-bean) idiomatic wrapper on top of JDBC. Same goes for Log4J being a wrapper of java.util.logging, etc. Not quite the same thing as what Scala or Clojure have done, but far from just sticking to the basics.

It's one thing to build a wrapper on top of a comprehensive standard library, and another thing altogether to build what is essentially an alternative standard library.

Re: ‘Woof’, a pure Scala 3 logging library

#39
post #29

Earlier quoted context omitted.

If you have some rare (rare as in it happens once every few months or something like that) error and you need logging about it. Also testing it ensures nobody by mistake removes that bit of logging by accident.

code reviews would probably be a better fit to prevent that.

Code reviews are useful, but I've never seen them used as an argument against writing tests.

Re: ‘Woof’, a pure Scala 3 logging library

#40
post #9

I don't get it: Why do we need category theory and monads for every little fart?

Where did you read "category theory" in that article? I'm not familiar with Woof but it looks like an attempt at writing a pure logging lib. What is wrong with that?

Monads got a facelift in Scala 3 with braceless syntax, aka significant indentation

https://dotty.epfl.ch/docs/reference/other-new-features/inde...

Post reply on HN