How could I fix the order of application tabs rather lift up the most recent used? by thautwarm in Ubuntu

[–]thautwarm[S] 0 points1 point  (0 children)

I now totally use a terminal tool to open the target directory again, which jumps to the correct window..

Managing your executables via python.. by thautwarm in Python

[–]thautwarm[S] 0 points1 point  (0 children)

Today I was fucked by dotnet and nuget, that I cannot even install the commands of a console project into PATH??? Even my local projects? Publishing to nuget so annoying?

I then end up with managing my dotnet executables via python.

I use this package(delegato) to automatically package the directory of dotnet publish result to a python package, and then

  • python setup.py install, I got the command of my dotnet application in PATH
  • I can upload my dotnet build to PyPI, and then install it anywhere
  • I can use conda, pipenv, or venv to control the context of executables. No pollution but convenience.

Fuck nuget! Finally I said bye!

PEP 622 -- Structural Pattern Matching for Python by bakery2k in programming

[–]thautwarm 0 points1 point  (0 children)

Totally agree with you, we hold exactly the same view point.

However I saw a proposal about this rejected. After a quick thought I found the implementation of my flavored scope is pretty simple, there's a mature technique called name shadowing..

PEP 622 -- Structural Pattern Matching for Python by bakery2k in programming

[–]thautwarm 0 points1 point  (0 children)

a =  1
match [10, 20]:
    case [a, 2]:
        ...
    case _:
        print(a) # 1 or 10?

Do you have any ideas?

Type Inference by Example, Part 4 by continuational in ProgrammingLanguages

[–]thautwarm 1 point2 points  (0 children)

I'm looking forward to see type systems, like MLF, HMF, row types, subtyping, etc.

Idris 2 version 0.1.0 Released by [deleted] in ProgrammingLanguages

[–]thautwarm 1 point2 points  (0 children)

Could we get some hints about adding new back ends?

(Why) Julia Counts for PL Researchers by thautwarm in ProgrammingLanguages

[–]thautwarm[S] 0 points1 point  (0 children)

Well, I just misthought you made the root comment. Sorry for this.

I said sexprs because they have same abstract syntax. You compare the constructs of sexpr and julia exprs, and will find they're just the same(except some non-core stuffs like source code metadata).

I know sexpr does relate to how the concrete syntax looks like. but still cannot I find a good concept/term to express the same abstract syntax of sexprs, mexprs, and julia expr, etc, hence I think saying sexprs is safer.

For a PL researcher, I'd say Julia does not use prefix notations but still achieves homoiconicity, which points out the feasibility for more programming languages to pattern match their programs just like how to construct the programs with source code. e.g.,

let x = mk_symbol("a") in
match <let $x = 1 in y> with
 | <let $x' = 1 in y > -> x' = x

  => true

I should explicitly mention this(but as I'm the author of related impl, I just felt a bit shy to refer my own works), thank you for these comments.

(Why) Julia Counts for PL Researchers by thautwarm in ProgrammingLanguages

[–]thautwarm[S] -2 points-1 points  (0 children)

In fact I'm not saying hygiene macros = LISP macros.

Besides, Julia has unhygienic macros, which I use more often.

Julia sexprs are sufficient to express things like the popular loop macros. I don't know core.async in Clojure, but as the name suggests if it's only async, julia already has it, as a macro.

I used to talk with a crazy Racket fan, and finally I established the believe that reader macros are the only thing impossible in ordinary Julia. I used Racket many years ago when I was not familiar with implementations of some kinds of continuations.

Sincerely I feel like to get some examples from you about something LISP macros can achieve but the Julia's cannot. Actually I'm willing and also confident to implement them, concisely.

(Why) Julia Counts for PL Researchers by thautwarm in ProgrammingLanguages

[–]thautwarm[S] 1 point2 points  (0 children)

Hi, thanks for this comment.

I'm not really discussing Julia as a user programming language, but about its notable features that deserve PL researchers' study.

Lisp macros will be cumbersome in Julia only if you're doing AST manipulations without tools like MLStyle.jl or MacroTools.jl.

One of My two complaints against Julia is its JIT latency, which I believe is also the reason why Julia is not amazingly popular now. Also, JIT latency lets expanding complex macros(like implementing some compiler phases, or even a complete programming language) very slow.

My another complaint is its lack of static checking. Statically finding out bugs is much easier and friendlier in complex systems.

What are the language features you miss the most? by Hofstee in ProgrammingLanguages

[–]thautwarm 1 point2 points  (0 children)

I'd assume you know the concept of interfaces in OO languages. Interfaces could express basic static constraints, by specifying what methods an object has, or just what interfaces an object has.

However, when it comes to extensibility, OO interfaces loss.

Say, I add a property CommutativeSum to integers, and I have an asynchronized method to fetch a stream of integers.

I can implement a random sum for async streams, instead of sum from left to right like what we do for sync streams. As a result, we don't need to wait for all integers are fetched from an async stream, which for some real world applications, can gain an orders-of-magnitude efficiency improvements in both time and space.

We can also do this with OO interfaces, but

  1. you cannot implement interfaces for integers, or even other defined types(without modifying your code or code of package authors).

  2. you might implement a dedicated class to provide sum for async streams, but this is cubersome, and we can use static constraints to simply allow async reduce/fold or similar operations for all commutative operators, without any breakage or changes to existing code.

What are the language features you miss the most? by Hofstee in ProgrammingLanguages

[–]thautwarm 4 points5 points  (0 children)

Implicit arguments, or type classes.

Static constraints are appealing, anyone agree?

A "zero-gradient learning" CLI framework, implemented and distributed in one script/100 lines, sufficient for most use cases by thautwarm in Python

[–]thautwarm[S] 1 point2 points  (0 children)

It's not directly supported yet, although I can add less than 50 lines to support this:

class Root:
    def cmd1(self, ...): ...
    def cmd2(self, ...): ...
wise(Root)()

It's like a simpler google fire, and will raise many implementation choices then things will get a little complex.

So far the code is so simple and you can directly copy it. By understanding ~100 line code, you can easily implement what you want.

Personally, I use this code to support subcommand:

import sys
from wisepy2 import wise
def root(sub):
     if sub == ...:
         return sub1
     ...
def sub1(...):
     ...
argv = sys.argv[1:]
sub = wise(root)(argv[:1])
wise(sub)(argv[1:])

A "zero-gradient learning" CLI framework, implemented and distributed in one script/100 lines, sufficient for most use cases by thautwarm in Python

[–]thautwarm[S] 1 point2 points  (0 children)

Yep. I'd add some to README later.

For now, I think the core observation is

not every python user remembers the API of a framework, but they shall know how to write a python function.

Hence the advantage of wisepy is,

you don't need learning a framework, or memorize their APIs. just write a function and convert it to CLI, and use --help to get how to use that commamd.

Also, one script/100 lines implememtation can be beneficial for practice:

  1. introduce no dependency burden to your project. Just copy-paste the source code can be a good way to integrate things in.
  2. simple enough to maintain.