I'm not a native neither, so obviously I can be wrong (and even in my own language I could be wrong). Do not trust what I say without yourin own researches, I'm only an user who searches and tries to understand, with many mistakes, because it's the way everyone learn. You are right to dispute with anyone here, as it forces us all to search about etymology, disputations are good.
"Javelins were throwing weapons (like hasta) and spears stabbing weapons".
Spears can be divided into 2 broad categories: those designed for thrusting in melee combat [stabbing] and those designed for throwing (usually referred to as javelins).
The javelin page says:
A javelin is a light spear
designed primarily to be thrown, historically as a ranged weapon, but today predominantly for sport. The javelin is almost always thrown by hand, unlike the bow and arrow and slingshot, which shoot projectiles from a mechanism. However, devices do exist to assist the javelin thrower in achieving greater distance, generally called spear-throwers. (...) The word javelin comes from Middle English and it derives from Old French javelin, a diminutive of javelot, which meant spear. The word javelot probably originated from one of the Celtic languages.
(Same page) The Zulu warriors used a long version of the assegai javelin as their primary weapon. The Zulu legendary leader Shaka initiated military reforms in which a short stabbing spear.
So, yes, javelins are designed to be thrown (and could be a stabbing weapon in some cases).
And spears used to stab in mêlée combat. You are right.
The weapon in Roman infantry, for instance, the Romans we see in cities in the peplum movies, are spears, they seem to use them, against civilians, mainly to stab them (they are close, not big distances for throwing).
Hasta (...) is a Latin word meaning "spear". Hastae were carried by early Roman legionaries, in particular they were carried by and gave their name to those Roman soldiers known as hastati. However, during republican times, the hastati were re-armed with pila and gladii and the hasta was only retained by the triarii.
Unlike the pilum, verutum and lancea,
the hasta was not thrown, but used for thrusting.
So, here, you're wrong. Hastae weren't throwing weapon, so hastae are spears, and lanceae are javelins.
The lancea was the Roman auxiliaries' short javelin. [From λόγχη (lonche), the Greek term for lance.]
Arrian made use of the lancea during a battle with the Alans (...) He formed his legionaries into 8 ranks to meet the enemy charge, and equipped the first 4 ranks with pila and the last 4 with lancea,
with which to throw over the heads of their comrades. As such, it is suggested that legionaries were equipped with lancea instead of pila if the occasion called for it.
Spear = Hasta = stabbing (mêlée weapon).
Javelin = Lancea = throwing.
But in the sentence, it's "hasta" and they throw it,
because they did that sometimes.
If it was "lancea", you would have to translate it with "javelin".
Also, for pilum/pila and verutum
Pilum is a very long and thin javelin, we see them on soldiers in peplum too.
And Verutum is still another kind of javelin, and they say it was lighter than the pila.
So, pilum or lancea or verutum = javelin.
And spiculum is another throwing javelin. It appeared later and replaced the pilum, as the main throwing weapon.
It's very specialize terms, and unless being very assiduous in reading war stories or being an historian, I find them difficult to differentiate. They are different weapons for different kinds of soldiers and military uses.
"Javelins are not spears."
I disagree. All javelins are spears (you said it yourself, P_N!); however, not all spears (only those of the light, throwing kind) are javelins. The existence of two words does not rule out overlapping classes. Thus, all boys are children; not all children are boys.