Hacker News new | past | comments | ask | show | jobs | submit login

> I doubt you can reboot your current codebase but it seems it should be applicable for a similar set of requirements or a spare-time app.

No kidding. At 85k+ LOC (probably ~70k-75k after removing autogenerated ORM templates) in a language as expressive as Perl... well, I wouldn't look forward to that. And really, if it didn't have a DB abstraction layer at least approaching what I can do with DBIx::Class, I'm not going to contemplate it. Mojolicious takes care of most my webapp needs quite well. As for type checking, what I have isn't perfect, but it's probably worlds better than what you are imagining. I'll cover it below.

> Also, not a write-only language. ;)

    use Moops; # [1].  Uses Kavorka[2] by default for funciton/method signatures

    role NamedThing {
       has name => (is => "ro", isa => Str);
    }
 
    class Person with NamedThing;
 
    class Company with NamedThing;
 
    class Employee extends Person {
       has job_title => (is => "rwp", isa => Str);
       has employer  => (is => "rwp", isa => InstanceOf["Company"]);
    
       method change_job ( Object $employer, Str $title ) {
          $self->_set_job_title($title);
          $self->_set_employer($employer);
       }
    
       method promote ( Str $title ) {
          $self->_set_job_title($title);
       }
    }

    # Now to show of Kavorka's more powerful features
    use Types::Common::Numeric;
    use Types::Common::String;

    fun foo(
       Int $positional_arg1 where { $_ % 2 == 0 } where { $_ > 0 }, # Composes a subset of Int on the fly
       Str $positional_arg2,
       ArrayRef[HashRef|MyObject] $positional_arg3, # Complex type
       DateTime|NonEmptySimpleStr :$start = "NOW", # Named param with default
       DateTime|NonEmptySimpleStr :stop($end)!, # Named param with different bound variable in function, which is optional, so may be undef (which composes Undef into the allowed types)
   ) {
       ...
   }
       
It's not at compile time checking, but man is it useful. If you've been following Perl 6 at all, it's mostly a backport of those features. Particularly useful is the ability to define your own subtypes and use those in the signatures to keep it sane. E.g. declare HTTPMethod, as Str, where { m{\A(GET|POST|PUT|PATCH|DELETE)\Z} }; Perl 6, where at least some of this is compile time checked (obviously complex subtypes cannot be entirely), fills me with some hope. I'm not entirely sold though, that's one beast of a language. It really makes you put your money where your mouth is when it comes to espousing powerful, extensible, expressive languages. I guess time will tell whether all that rope can be effectively used to make a net instead a noose more often than not. :)

> I'm sure you'll find his approach to "secure," configuration management entertaining.

Ha, yeah. I think secure is a bit of a misnomer here though, as it is a fairly novel way to do authorized configuration management, for the time.

> So, your expectation existed in the older schemes in various ways. It can definitely be done in next one.

And after you've filled me with such confidence that they are capable of both speccing a good standard and incentivizing its use at the same time! ;)

> Nah, bro, I want my shed and house build with the assurance of an office building or skyscraper. I mean, I spend a lot of time there with some heavy shit above my head.

I'm a little disappointed that I just image searched for "overengineered shed" and all the results ranged from a low of "hmm, that's what I would probably do with the knowledge and time" to "oh, that's a job well done". The internet has failed me...

1: https://metacpan.org/pod/Moops

2: https://metacpan.org/pod/Kavorka




" If you've been following Perl 6 at all, it's mostly a backport of those features. "

Definitely an improvement over my Perl days. Not sure how well they'll eventually get it under control or not. It is better, though.

" I think secure is a bit of a misnomer here though, as it is a fairly novel way to do authorized configuration management, for the time."

Definitely haha. Quite a few things were improv back then as there existed no tooling. Secure SCM was eventually invented and implemented in various degrees. Wheeler has a nice page on it below. Aegis (maintenance mode) and esp OpenCM (dead link) implemented much of that.

http://www.dwheeler.com/essays/scm-security.html

" I just image searched for "overengineered shed""

Bro, I got you covered. I didn't subscribe to Popular Science for the layperson-oriented, science news. It was for cool shit like the SmartGarage: a truly-engineered garage. They took it down but I found article and vid of its construction. Enjoy! :)

https://books.google.com/books?id=VgAAAAAAMBAJ&lpg=PA111&ots...

https://www.youtube.com/watch?v=4t3sTZCnQHQ




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: