Hacker News new | past | comments | ask | show | jobs | submit | cx1000's comments login

There's always skip http://www.skiplang.com/

> Skip is an experimental programming language developed at Facebook from 2015-2018.


https://github.com/skiplang/skip

> The Skip project concluded in 2018 and Skip is no longer under active development at Facebook.


PEP 582 is in the works to make __pypackages__ the Python equivalent of node_modules. Not sure if it will get accepted but I hope it does.

> a mechanism to automatically recognize a __pypackages__ directory and prefer importing packages installed in this location over user or global site-packages. This will avoid the steps to create, activate or deactivate "virtual environments".

https://www.python.org/dev/peps/pep-0582/


That’s a great idea. I’ve just been playing with the implementation from the PEP, and it makes things really easy.

The speed of simply extracting a bunch of wheels directly in to `__pypackages__/$PYVER/lib/` is a huge benefit. It behaves well if you symlink from a global tree of extracted packages too, like an even simpler version of pundler¹.

If others want to play with it without too much breakage, I massaged the patch on to 3.7². The 3.8 base was a little too big a change for my liking ;)

1. https://github.com/Deepwalker/pundler 2. https://gist.github.com/JNRowe/502f8772861cdd21bff5144c416e4...

Edit: It’s a third of a second to stand up a complete environment with 63 wheels in its dependency tree for the project I'm playing with right now.


That would be great! Any way to upvote or otherwise give the equivalent of a GitHub thumbs up to show support for it?


Hypothesis 1: All successful dynamically-typed programs eventually grow large enough to get rewritten or retrofitted with static types.

Hypothesis 2: All successful statically-typed languages eventually grow large enough to have a dynamically typed scripting language embedded in them.

https://twitter.com/munificentbob/status/988555364252631040


I don't see a contradiction here. (speaking as a Python and Haskell user):

1 - dynamic languages, while granting great freedom, make it easy to shoot yourself in the foot with simple typing bugs, so we cope by adding type checking

2 - many (most?) static type systems are not expressive enough to type some programs, so people embed dynamic solutions to build the stuff they need.

Haskell is pretty decent at typing most stuff I want, but it makes me think about it up front, which is nice sometimes, but not always. Python lets me build stuff quickly and work out the design as I go, but it's hard to make sure everything works as intended. I wish there was something that let me bodge things together, but then constrain them with types when I need to...


Python 3.6 introduced type checking as an option, so you can hack something together in Python, then add types later.


Type hints aren't checked or enforced by the compiler. They're really just special-syntax comments to help the developer (or IDE, as the case may be). I wouldn't call this "type checking".


You can run a type-checking tool (e.g. mypy) which will tell you if you've made any type errors.

Since Python has no 'compile' step, type-checking takes the place of compiling in other languages.


I'm using the type annotations from `typing` in a Python 3.5 project I'm working on, but only as a form of documentation. Unfortunately mypy doesn't work for me – the project heavily uses a namedtuple-style sum type library, and I haven't found a way to make the types it generates work with mypy.

(iirc mypy has builtin support for namedtuple, but doesn't really support other types generated at runtime)


I'm surprised nobody has mentioned Greenspun's tenth rule: https://en.m.wikipedia.org/wiki/Greenspun%27s_tenth_rule


That's probably because it has been quoted enough times to come to provoke nausea, and is just wrong.


While I see a lot of examples of 1), I can't think of one for 2). Which successful statically-typed language has that?


Lua is an example for the C-type languages, and Groovy is an example for Java.


Beanshell is another example for Java, and did it before Apache Groovy did. Beanshell added features like optional typing and terse property syntax to Java, then Groovy extended Beanshell by adding closures to Java. Java has made these scripting languages less relevant lately because of more recent features like lambdas and inferred types.


C++ and JavaScript in the browser that you're using to read this would be a good example of #2.


For 2, I should have said "programs written in statically-typed languages". Oops.

Examples are most text editors: emacs (elisp), Sublime Text (Python), Vim (VimScript), Atom (JavaScript). Many games and game engines: World of WarCraft (Lua), Unreal (UnrealScript), SCUMM, etc.


I'm guessing you meant these hypotheses to seem paradoxical (i.e., dynamic code bases are rewritten in static languages to improve maintainability; static code bases are rewritten in dynamic languages to improve maintainability), but I don't think they are.

Dynamic codebases are rewritten in static languages to improve maintainability and code quality; programs written in static languages include an interpreter as a feature that supports user-defined programs, e.g., a browser's JS engine or emac's text editor and also for specialty domains where code quality is less important than developer velocity and the static language of choice is unnecessarily painful (games).

Assuming I didn't misrepresent your thesis, does this seem more or less accurate to you?


No, I actually didn't intend them to be paradoxical.

My feeling is that statically-typed languages and dynamically-typed languages are each better suited for certain kinds of problems. The former gives you better performance, long-term maintainability, and scales to larger programs. The latter gives you a faster iteration loop, is easier to learn, and is easier to dynamically load.

I think what happens is that any sufficiently large program covers so many different requirements that eventually different parts of the program are best implemented in different styles of language.

If you start statically-typed, you eventually get bogged down by the slow compile-reload cycle, need to dynamically load user-defined code, or what to express parts of the program in something higher level or more declarative. So you end up embedding a scripting or configuration language.

If you start dynamically-typed, eventually your program grows to the point that you either can't maintain it or it isn't fast enough, so you end up trying to bolt a type system onto your existing code or rewriting parts of it in a statically-typed language.

I think the costs for the latter are usually higher than the costs for the former, so I tend to lean towards starting statically-typed, but that's also because I'm comfortable using types.


Ah, thanks for clearing that up. I forgot compilation can take a while. I used to write C++, but the only compiled language I've worked seriously with in the last several years has been Go, which tends to compile in about the same time it takes a Python program to load its imports.


UnrealScrip is explicitly said to be both statically typed and inspired by Java a lot[0][1]. It just had lots of language features dedicated to the game, like networking, state machines, being preemptively multitasked, integration with the editor, etc.

Lua is of course popular and the topic of using it in games has been done to death: Love2D, Grim Fandango, Don't Starve, Cry Engine, Garry's Mod, etc.

Eve Online supposedly uses Stackless Python and I've seen Vampire the Masquerade Bloodlines (early Source engine) use Python.

Valve's wiki lists Squirrel, Lua, Python and Gamemonkey and they are all dynamic but I think Squirrel is the top language there.

I've also seen Angel Script in HPL1 (the Penumbra series by frictional) but it's another static scripting language and it markets this as a feature.

Unity of course has its C# 'scripts' which are static and I found the idea of scripting in such a behemoth of a language very novel when I've first seen it (yes, UnityScript has dynamic capabilities but it has static ones too and most of the users seem to be with C#).

SCUMM (and Z machine and similar) is a very weird case because it seems more like a script in the sense of a scene play (and the S might stand for script but they were naming utilities after gross stuff like CYST, MMUCUS, etc. so it might be shoehorned), not actual programming language, it's tied to the engine/game/genre/assets way more strongly than even Unreal Script was but I didn't do anything with SCUMM so I can't actually say for sure what would happen if you wrote something that didn't make sense (like tell a table to walk somewhere or reference an object or animation or something else that doesn't exist).

Many Naughty Dog games (including Crash Bandicoot games on PS1 which is frankly insane) also used their own Lisp inspired by Scheme called GOOL and then GOAL but I'm not sure how dynamic it was.

There's also a subtle line between embedding a language to make yourself scriptable and making yourself a library written in mix of C, C++ and that language and there is an interesting article on that[3].

GIMP also includes (or used to?) something related to Scheme/Lisp and has a system in place to support multiple scripting languages at once and calls between any of them called Procedural DataBase. Adobe Lightroom includes Lua too.

Id tech engines apparently used another language/technique each major engine version and I don't know the specifics of it at all.

I'm quite interested in the topic of extending applications (and specifically games) in various scripting languages, plugin systems, etc. but I'd not say all static programs grow dynamic scripting capabilities since AngelScript, Pascal Script (:D), Unreal Script and C# are all static 'scripting' languages and scripting in general is about 'scripting' (as in - small or big bits of code that is easy to change and safe to experiment with modifying a larger program in small or big ways), not necessarily dynamic programming (e.g. you could in theory every viably have Lua scripts in a larger Python program or even AngelScript scripts in a Python program to really mix it up and script a dynamic program with a static scripting language). You could also extend a C or C++ program with traditional 1990s/2000s style 'plugins' written in almost anything that can get the required ABI out into a dll/so and load, unload, reload, etc. those at runtime without stopping the main program.

[0] - https://wiki.beyondunreal.com/UnrealScript

[1] - https://api.unrealengine.com/udk/Three/UnrealScriptReference...

[3] - https://twistedmatrix.com/users/glyph/rant/extendit.html


Maybe not languages but certainly frameworks, like Qt and many others, offer a dynamic language layer on top of the C++ or other static language.



Though more "inferred" types rather than dynamic types, scala does allow you to do:

  val s = "String"
Rather than the more strict:

  val s:String = "String"


Type inference has nothing to do with dynamic typing.


I had no idea what you were talking about, so I did my own research (ie - googled "type inference vs dynamic typing") and I stand corrected.

https://herbsutter.com/2008/06/20/type-inference-vs-staticdy...


C and C++ are the basis for Python (CPython) and JavaScript, respectively. Lua was written in C.


I can't think of 2 as written.

But big, successful programs will often do (2).


C# has had a dynamic type built in for years now. It's literally a dynamically typed language embedded within the statically typed C#,which grew out of the work on gradual type systems.


dynamic is just based on COM variant type, before .NET even existed.


C#'s dynamic type has nothing to do with COM.


It shows you never had to implement COM interfaces for Visual Basic Variant type via the IDispatch interface.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms2...

The way dynamic is implemented is exactly following the same idea using DynamicObject instead of IDispatch.

https://docs.microsoft.com/en-us/dotnet/api/system.dynamic.d...

And if you actually bother to read MSDN documentation, one of the use cases for dynamic was to simplify COM automation interop.

https://blogs.msdn.microsoft.com/srivatsn/2008/02/04/dynamic...

https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...


That's not why the dynamic type was created, that was just one side benefit. The dynamic type grew out of the IronPython effort which grew into the DLR in order to better support dynamically typed languages on the CLR, by having reusable polymorphic inline caching for efficient dispatch.

COM integration with the CLR has existed since the beginning, which I used quite extensively many years ago, they just took advantage of the DLR to make it easier.


Still given that it was already available as Variant on Visual Basic before .NET was even an idea, it hardly has anything to do with "which grew out of the work on gradual type systems.".


Visual basic is hardly the first language with a dynamic type, and the DLR is clearly descended from Self, Smalltalk and other dynamically typed languages and started with Iron Python:

https://blogs.msdn.microsoft.com/hugunin/2007/04/30/a-dynami...

VB's variants and COM were not a consideration when conceiving of or designing the DLR, merely a convenient application.

Furthermore, integrating a dynamic type into C#'s type system absolutely built in the work on gradual typing. See their published work: https://www.researchgate.net/publication/221496299_Adding_Dy...


Thanks for the paper, that changes my point of view.


C# `var` syntax, ExpandoObject and the rest of System.Dynamic


C# `var` variables are statically-typed, not dynamically.

Not having to write down the type isn't the same as the type not being determined at compile time, which is what "static" means.


I think they mistyped "100" as "81"


Maybe it's hex. 129% of ICOs are fraudulent.


If it was a hex percentage it would still be 81/100, or in decimal 129/256 = 50.39%


Would rather store percentages in single bytes, so let 0xFF / 0xFF = 100%.

0x81 / 0xFF = 129 / 255 ~= 50.59%


Makes a lot of sense, but maybe a slightly longer bow to draw given that we would never us xx/99 as a percentage in decimal :)


We should also make them all switch to Ubuntu and vim too, right?


Heh, no, fair point (and not what I was suggesting). I just think that Signal is a drop in replacement for WhatsApp and it can start a conversation about privacy and what happens with data.

I didn't say initially that I meant Signal more as a straight replacement for Whatsapp, not FB.


Apple and Google are doing this too: On my iPhone the Gmail app opens things in Chrome, the iOS promoted news stories are opened in Safari, yet I prefer Firefox.


Sort of. Google apps give you the choice to open in Safari or Chrome. Not sure if they allow you to pick a different browser besides those two.


I've never been asked to open things in Safari or Chrome, but then again I am on Android.

For the majority of smartphone users, Gmail just one day started using Chromeframe to open all links without permission.

These behaviors are being used more and more as Google tries to tie your actions together into a single identity.


This may have been wry humor on your part, but of course there is no Safari on Android... I do see the behavior you describe in the News & Weather app, which likes to open links in embedded Chrome Web Views (unless I long-press and then they will offer to open in browser, which happens to be FF).


It doesn't allow choosing FF Focus, which I have installed.


Not to mention that every time the app updates, it will prompt you to use Chrome, even if you've already changed that setting.


It’s not even for every update, that setting seems to revert at least daily for me.

It’s very rare I see google going for a desperate and annoying UX, but this is infuriating - I’m glad I’m not the only one.


Apple has never pretended you could set a default browser on iOS. Microsoft needs another 1.4 billion wake up call.


The fact that Apple hasn’t ever let you set a default browser on iOS isn’t a good thing.

I fault Apple way more for never even offering the option and not letting you replace apps that don’t give you that option. I don’t really care what Microsoft does with their mail app that I never use because I can replace it.

Apple does not even give you the option to replace the SMS app in iOS, which always opens links in safari.

Also, even if Microsoft were behaving as badly as Apple...if Apple can do it why can’t Microsoft? Are you saying that they should never be allowed to change anything?


Apple doesn’t even have a majority market share in mobile phones. If you don’t like what they do you can just buy another phone. That’s not a monopoly.


Try building a successful mobile app without supporting iOS. That’s monopoly.

Furthermore, people are using mobile devices way more than computers now. So even if Microsoft was a monopoly in the past, they aren’t any longer.


That’s not monopoly. Monopoly means that effectively there is only one supplier and in the mobile phone market there are at least two, of which Apple is not even the largest.

Just because it is an important player it is hardly dominant.

Also, just because you don’t deem a market important anymore (and many people would beg to differ with your opinion) doesn’t change wether a party is a monopoly in that market or not.


It's not that simple. There is actually an anti-trust suit against them right now over this, so I guess we'll see...

> An appeals court has ruled that Apple must face antitrust charges in a lawsuit that alleges that the company monopolized the market for iPhone apps.

https://www.pcworld.com/article/3157551/mobile/apple-must-fa...

http://thehill.com/opinion/op-ed/272399-time-to-prosecute-ap...

http://www.businessinsider.com/apple-monopoly-ubs-steven-mil...

https://www.google.com/search?q=apple+is+a+monopoly

I hope they lose and are forced to change their store rules so we can sell apps outside their store because whatever label you apply to their behavior, it's despicable IMO.


My guess is Apple gets a pass because they are not a monopoly ... yet.


Yep. Its not a bad idea at all, stuff like this is what made Chrome huge on Android. A lot of users will never change default settings.

I mean I would love to live in a world were people make informed decisions based on research but that's not happening. Meanwhile advanced users retain the freedom to use whatever browser they want so everyone wins.


If you use pipenv it takes care of the virtualenv stuff behind the scenes for you.


Very true. Who would have predicted Apple overtaking Microsoft?


They may spend it on cigarettes, alcohol, drugs, etc. Or even be exaggerating/faking their circumstances.


  They may spend it on cigarettes, alcohol, drugs
Sure, but so what?

Doesn't a person have a right to escape his miserable circumstances for a short time?

Sure, food or shelter are certainly the more wholesome option. But who am I to judge a person's morality for what he does with a couple francs that I just gave him?


I don't think the expectation is that they may budget a measured amount for alcohol or other drugs, but that by providing them with the means to get more of those things, one may play a small part in what prevents their escape from said miserable circumstances.


But does turning a blind eye help them escape any better than a few dollars and some camaraderie?


> Doesn't a person have a right to escape his miserable circumstances for a short time?

Yes but not on my dime. I'm entirely happy to pay (directly or via taxes) to feed the hungry, shelter the homeless, get them medical care and clean clothes.

But I really don't think buying them cigarettes and light beer is improving their situation in a meaningful way.


It's sad that this is getting downvoted here. We are talking about people in miserable circumstances, and while vices are a longterm negative, I, an educated disciplined and well off person, still can't reliably resist them when I'm feeling down. To begrudge these people their vices is inhuman.


> Sure, but so what?

All those things are harmful.

> Doesn't a person have a right to escape

What if those circumstances are created by the escape?

> But who am I to judge a person's morality

I'm not judging the addict, I'm judging the enabler..


Well, if I am giving my money to a homeless guy begging on the street/public transport, I for sure will not encourage him in his destructive behavior. It means me contributing to his self-destruction with my money. Simply no. How hard is it to understand this?

Personally, I give sometimes few coins to street musicians, but that's it. Homeless in Europe never struggle for life, there is a vast social net that can help them in various ways, if they want. Giving money means confirming that this is affordable lifestyle, and something they should continue doing.


The ted talk "What makes us feel good about our work?" illustrates this perfectly. https://www.ted.com/talks/dan_ariely_what_makes_us_feel_good...

> Now there's good news and bad news here. The bad news is that ignoring the performance of people is almost as bad as shredding their effort in front of their eyes. Ignoring gets you a whole way out there. The good news is that by simply looking at something that somebody has done, scanning it and saying "Uh huh," that seems to be quite sufficient to dramatically improve people's motivations. So the good news is that adding motivation doesn't seem to be so difficult. The bad news is that eliminating motivations seems to be incredibly easy, and if we don't think about it carefully, we might overdo it. So this is all in terms of negative motivation, or eliminating negative motivation.

Which brings us to the totally free, and very low friction way to say thanks: http://saythanks.io

> SayThanks.io provides a handy URL for you to share with your open source projects— it encourages users to send a simple thank you note to you, the creator of that project.

> This simple link can be added to READMEs and project documentation.

> Then, you can enjoy a nice inbox of very small but thoughtful messages from the happy users of the software that you've toiled over. :)


Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: