The same need is also encountered in civil engineering projects when one needs to pass a rope over a chasm.
Even though development had started in the early 1800s, the first practical development to solve this problem didn't happen until 1850, when Captain David A. Lyle, a West Point and MIT graduate, sat down to solve the problem. He designed a short barreled cannon using a custom designed shot and special waterproof braided linen line. The cannon was named the Lyle gun in his honor.
A Lyle gun in use. Click on image to enlarge. Public domain image.
The Lyle gun had a range of about 700 yards. It also had huge recoil and hence, it was mounted on a small cart. The Lyle gun stayed in use until 1952 and similar models were also made by several other companies.
While the Lyle gun was technically a cannon, there were other hand-held line throwing guns being made as well.
Click on image to enlarge. Public domain image.
The above image shows a gun made by the English gunmaker, W.W. Greener, capable of throwing a line about 150 yards or so.
William Schermuly, a British inventor of Dutch origin, came up with the idea of using rocket propulsion to toss the line, instead of using gunpowder. While his early experiments of 1897 just consisted of a rocket in a tube with a line attached to it, he began to work on a better device that could be small, light, accurate, have a long shelf life, safe and simple enough for a child to operate. In 1927, he came up with the concept of a rocket fired from a hand-held pistol, the SRPA (Schermuly Rocket Pistol Apparatus):
Click on image to enlarge.
This device had very little recoil, was not affected by cross-winds, weatherproof and the path of the rocket was visible so that people could easily correct their aim if needed. On top of that, it was light and simple enough that Schermuly got his 8-year old grandson to demonstrate its use to members of the British parliament.
By the time William Schermuly died in 1929, it became compulsory for any vessels over 500 tons to carry line throwers. The company was carried on by his sons and produced many other rocket based products, such as grappling hooks, rescue apparatus and flares during World War II.
Line throwing guns are still in use and they're still being made by some companies, such as Naval Gun Company Inc., which makes the official CG85 Bridger Line Throwing Gun Kit for the US Coast Guard.
H&R Bridger Line throwing gun made by the Naval Gun Company Inc. Click on image to enlarge.
A US Navy sailor aboard the aircraft carrier USS Dwight D. Eiserhower prepares to shoot a line to USNS Tippecanoe.
The line will be used to set up a bigger line and perform refueling and replenishment at sea.
Such apparatus are used by coast guard, navy, firefighters, construction companies, offshore drilling rigs, commercial fishing fleets, tugs, barges etc.