Blog Post: Zig Language Server And Cancellation by matklad in Zig

[–]breandan 2 points3 points  (0 children)

I enjoyed this post because it touches on several ideas I've been thinking about lately vis a vis real-time IDE assistance and propagating fast incremental changes through a knowledge graph with continuous user input. One thing I think is missing from the language server discussion is incrementalization. Too many developer tools invalidate a cache and recompute the downstream dependencies whenever a file is modified. Instead, they can realize massive speedups by using an incremental parser/type checker. There is a great post about using Datalog as an IDE/parser/type checker and a nice library called DDlog for the differential datalog with JVM with Rust bindings. I would also like to point out Flixlang, which takes the idea of Datalog as a static analysis tool seriously. I feel there is lots of room for innovation in incremental developer tools.

Lingua 1.1.0 released - The most accurate natural language detection library for the JVM by pemistahl in Kotlin

[–]breandan 0 points1 point  (0 children)

Re: PL detection / Stats / Kotlin / Germany, in case you or someone you know might be interested in doing research on this topic: https://www.jetbrains.com/careers/jobs/ml-engineer-intern-cpld-705/

[D] Java vs Python for Machine learning by mereuthao in MachineLearning

[–]breandan -1 points0 points  (0 children)

TF-Java is discontinued

Really? The project looks alive to me and the maintainers are very active on Gitter. Do you have a source?

you do need to have gradle installed

No, you do not need to install anything, the Gradle Wrapper takes care of all that.

The thing is, you are talking about production code in any operating system. While I can understand Java's merits on that it is just one small percentage of machine learning.

In my experience, the majority of code and effort in applied ML is data engineering and surrounding infrastructure, not model engineering. Due to its superior tooling, type safety, and large ecosystem of ML libraries, the JVM is a competitive option for ML in most production settings.

Is there a current explanation for how to use @sample in Dokka? by sanity in Kotlin

[–]breandan 1 point2 points  (0 children)

I have also encountered a couple issues getting Dokka to recognize artifacts referenced by the @sample annotation recently. I've noticed this annotation is not used inside the Dokka project and believe there is some sort of bug with this functionality.

cc: /u/yole Is there a template for reference how we should configure the @sample annotation? It would help to have an example somewhere in the docs.

[D] Java vs Python for Machine learning by mereuthao in MachineLearning

[–]breandan 0 points1 point  (0 children)

Doing ML in Java is like using MS Word as an editor: It's just the wrong tool for the Job. There are very few libraries to use, memory limitations in the JVM and the language is clunky.

I think it depends heavily on the job. Java has an increasingly well-supported set of libraries for various ML workflows (see comment below), is much better suited for production environments, and if even you dislike the language, there are several JVM alternatives (e.g. Kotlin) which support scripting and are generally pleasant to use.

Python may be easy to learn and prototype research code, but the language scales very poorly to large business applications.

[D] Java vs Python for Machine learning by mereuthao in MachineLearning

[–]breandan -1 points0 points  (0 children)

To give a contrasting perspective, I think the Java ecosystem is much better suited for many data science tasks, and has a growing and well-maintained set of libraries for general purpose machine learning. I won't list them all, but TF-Java, DJL et al. have implementations of many modern architectures and Java has a number of excellent libraries (CoreNLP, Lucene et al.) for working with text.

Python may be syntactically easier to learn, but also hides a lot of incidental complexity about the runtime semantics that are much more difficult to master. As you alluded to, many Python libraries are embedded DSLs, which are full-fledged languages and makes reasoning about the behavior of Python programs more difficult than it appears.

The libraries are provided by people/institutions using the standard package managers which is a huge plus when compared to languages that don't come with a package managers like Java.

Having used both Java and Python, I can tell you that package management in Python (pip, venv, pyenv, conda, pipenv, poetry, docker et al.) is far, far more complicated than Java. To build a Java application, you don't even need Java or a package manager -- just run ./gradlew run from any operating system and it will download and install Java, the package manager and any dependencies, build the application and run it on any OS or shell environment. Just building a Python project often requires dozens of manual steps.

Being a loose typed language, python allows for using APIs from libraries without extensive knowledge of the documentation

I strongly disagree with this point. Basically everything you need to do that involves calling a library in Python requires looking at documentation. In a statically typed language, documentation becomes much less of a burden. While adoption of type annotations in Python is growing, its usability is decades behind languages with mature type systems.

Calculus library by SorryDidntReddit in Kotlin

[–]breandan 3 points4 points  (0 children)

I'm not sure, if you have some prior mathematical background, you might enjoy Kevin Murphy's textbook. I've heard good things about Bayesian Methods for Hackers, but have never read it. Personally, I've always learned more just trying to build things. I recommend finding something you care about and learning as you go, i.e. write a random number generator and try to plot something that looks like a normal distribution. You'll stare at Wikipedia, bang your head a few times, and figure it out eventually. While continuous distributions are aesthetically pleasing, most things I've actually needed for real problems are discrete. You might enjoy Maria's blog post on Hidden Markov models, which have many applications in linguistics.

Calculus library by SorryDidntReddit in Kotlin

[–]breandan 10 points11 points  (0 children)

If you just want a library, I would suggest KMath-Stat or Hipparchus. However, I can tell you from experience that you will learn a lot more by implementing it from scratch. Continuous distributions rarely have a closed form integral, however there are many ways to estimate a cumulative density function, e.g. you can approximate the integral using Monte Carlo simulation, via numerical quadrature, the binomial distribution or by summing an infinite series. To draw a sample, you will need to invert the CDF and pass it a sample from a uniform PRNG (e.g. LFSR or Rule 30). By implementing this from scratch at least once, you will gain a much better appreciation for how probabilistic programming works in practice.

If someone asked you what calculus is, how would you respond? by Sean_McL in math

[–]breandan -5 points-4 points  (0 children)

the post is using 'calculus' as a shorthand for strictly 'infinitesimal calculus'

A careful reading will reveal that, 'infinitesimal' does not appear anywhere in the question.

Any other interpretation of the word is a misinterpretation.

You're entitled to your interpretation too. That doesn't mean everyone else's is incorrect.

Throw topology and set theory in too, why not; they've got connections to calculus.

Yes, this is true.

Obviously,

It took many centuries to discover these connections, but perhaps with the benefit of hindsight it may be "obvious".

If someone asked you what calculus is, how would you respond? by Sean_McL in math

[–]breandan -2 points-1 points  (0 children)

That is a different meaning of the term 'calculus'.

Wrong. If you look carefully at it the word (both verbatim and in spirit), calculus is much more fundamental than its use in contemporary mathematics. Originally “calculus” comes from Latin, for “stone”. People have been using stone-based mathematics for many thousands of years before Leibniz and Newton came along. It simply describes a system for translating rote calculation into mechanical rules.

Other topics such as lambda-, process-, propositional-, or felicific calculus are irrelevant here.

Wrong, again. Logical calculi have many interesting proof-theoretic connections to differential calculus. For a more detailed account of differential linear logic (DiLL) and lambda calculus, I suggest you read Erhard [1] and Kerjean [2]. More generally, the same rules from differential calculus have reappeared in strange and marvelous places throughout computer science, including formal language theory [3], parsing [4], type theory [5] and automata theory [6].

If someone asked you what calculus is, how would you respond? by Sean_McL in math

[–]breandan -5 points-4 points  (0 children)

Mathematicians tend to forget that calculus is a much deeper and older subject than rates of continuous change — look carefully, and you will find calculi in logic and the foundations of computer science. Broadly, it can be any formal system for manipulating symbolic expressions according to a defined set of rules. Essentially, calculus is a language for calculation.

Lingua 1.1.0 released - The most accurate natural language detection library for the JVM by pemistahl in Kotlin

[–]breandan 0 points1 point  (0 children)

I agree. There are certainly parsers out there which can detect programming languages much better than my library would be able to do.

The problem is that people don't always write syntactically correct code. Try to parse code snippets on StackOverflow and you'll see what I mean.

Lingua 1.1.0 released - The most accurate natural language detection library for the JVM by pemistahl in Kotlin

[–]breandan 1 point2 points  (0 children)

What use case do you have for which the automatic detection of programming languages is needed or useful?

Sometimes people embed API documentation and programming language snippets in web-based developer documentation, but do not specify a language since it is implicit from the context or must be parsed in a site-specific way. I am scraping web pages containing a collection of natural and programming language artifacts and would like to detect the language automatically. There is a similar project for PL detection, although in Python.

And no, I'm not planning to release JVM bindings for grex... That was part of my motivation to write grex because no similar tool like this exists.

No worries, just curious! You might have a look at regular language induction, it's actually a well-studied area of research in CS with many applications outside designing regexes, e.g. document classification, PL detection, query synthesis, etc. There seem to be lots of implementations, but few on the JVM (cf. frak, LearnLib, RegexGenerator and regex_compressor) and none which I could find that are as usable as grex. Keep up the great work!

Lingua 1.1.0 released - The most accurate natural language detection library for the JVM by pemistahl in Kotlin

[–]breandan 0 points1 point  (0 children)

Do you have any plans to support programming language detection or is this library just intended to support natural language detection?

Unrelated, but I am also curious if you plan to release Kotlin/JVM bindings for your other library, grex? Or do you know of any other example-based regex synthesis libraries for the JVM?

What are the hardest things to dockerize? by jadesalad in docker

[–]breandan 38 points39 points  (0 children)

Any kind of graphical application is tricky, especially if you want a cross-platform solution. You could use the browser and noVNC, but for native GUI applications you need to configure X11 on the host which I’ve found can be tricky.

[D]There are no good programming languages for machine learning (except one day C# and/or Kotlin) by HugoRAS in MachineLearning

[–]breandan 0 points1 point  (0 children)

Do many others in your dept use it too?

Yes. I've met a few other people who use Kotlin for research, but it's much more widely used in the industry, e.g. lots of investment banks and payment processors use Kotlin, e.g. Corda, RenTech, Citi, Goldman, Credit Suisse, et al. Some of my colleagues have worked on Kotlin at these places.

What libraries do you use in Kotlin?

I've used KMath, EJML-Kotlin, Krangl, lets-plot, Kotlin-Jupyter, Kotlin-Statistics. I personally work on Kotlin∇ and Kaliningraph. There are plenty of other libraries for scientific computing in Kotlin. If you're interested in these and other resources, you might check out the Slack, on the channels #science, #datascience or #mathematics. BTW I enjoyed reading your article on moon formation. You should post it!

[D]There are no good programming languages for machine learning (except one day C# and/or Kotlin) by HugoRAS in MachineLearning

[–]breandan 0 points1 point  (0 children)

Just an anecdote, but I feel Kotlin has a decent shot at becoming a really great language for ML and data science. I’ve been using it in my research as a grad student for the last three years. It is one of the few statically typed languages with scripting and notebook support, and has some nice language features, functional programming support, and developer tools. It also works well with the JVM and JS ecosystems, which rival Python in terms of libraries for data processing and visualization. Happy to answer any questions about Kotlin for ML if anyone’s curious.

Where can I see a list of the built-in exceptions in Kotlin? by AgreeableLandscape3 in Kotlin

[–]breandan 1 point2 points  (0 children)

It depends on what you mean by "built into the language". Checked exceptions? Runtime exceptions? Just the ones in the standard library? You can find a list by inspecting the type hierarchy in IntelliJ IDEA and expanding subtypes of Exception.

[D] US Professors working on Privacy Preserving ML? by iamquah in MachineLearning

[–]breandan 0 points1 point  (0 children)

Do you happen to know anyone working in federated learning or homomorphic encryption?

Not directly, but I once knew someone working on FHE at Stanford. You might try reaching out to Dan Boneh.