You'll Trade Damage For Defense: I think you come out ahead
For the purposes of this argument, I'll assume that we are comparing the halfling to a medium creature that also gets a +2 bonus to dexterity. See AshRandom's excellent answer for how this build compares to a Variant Human.
You lose some damage, sort of:
At most levels, If you used a shortbow while a medium fighter used a longbow, the medium fighter would do a bit more damage. Similarly, if you used a light crossbow (1d8) while a medium fighter used a heavy crossbow, the medium fighter would still do a bit more damage most of the time (in each case, about 1 point more damage per attack, on average).
This may sound like it's a problem that gets worse as you level up (since you attack more often, a damage disparity per attack seems like it will add up). But it may not for a couple of reasons. First, both you and a medium creature will likely want to grab the Feat Crossbow Expert (if Feats are allowed in your game). This will usually allow you to attack with a hand crossbow as a bonus action, giving you an additional attack each turn. That more than makes up for the difference in damage dice, even when you're usually attacking 3 times in a turn: both you and the medium archer will likely be using 1d6 hand crossbows whenever possible.
Second of all, at higher levels you may have access to magical weapons. If you do, you're unlikely to be given access to unlimited options: you'll likely find what you find. So you may not even get access to a longbow at later levels, but rather have to use the magical light crossbow (or whatever).
So at low levels, this problem is very minor (doing 1 point of damage per round less). And at higher levels, the problem may not exist at all.
What you gain:
While you give up some damage, you gain some versatility. If a medium fighter gets surrounded by medium enemies at close range, they cannot effectively escape (without some optional rules), since you normally can't move through an enemy's space unless they are 2 sizes larger or smaller than you. They'd then find themselves attacking with bows at a disadvantage, since an enemy is within 5'. But halflings have access to "Halfling Nimbleness" which enables them to move through the space of creatures which are one size larger than them. So as a halfling, you'd be able to disengage and then move through the enemy's spaces, perhaps even attacking afterwards if you used Action Surge.
Likewise, as a stout halfing archer, you'll be more capable of surviving combat than the medium creature at lower levels, given your higher constitution. This will also be crucial if you go for the "Eldritch Knight" variety (or multiclass), because both your higher Con and halfling Lucky feature will make you more capable of maintaining concentration. Halflings and Humans are the only race that can start off with a +3 bonus in both Dexterity and Con without rolling their stats, and only halflings can do so with a standard array of Ability scores (unless the Variant human uses a feat that gives them +1 in a stat, but that's a bit of a waste of a feat).
From a optimizing point of view, this could be particularly significant around level 13 or 14. If you did go Eldritch Knight, you'll now be able to cast Haste on yourself. If you spent two feats on Sharpshooter and Crossbow Expert before now (which would make a lot of sense), you likely have your CON up to 16 or 18. If you're at 18, this would give you a +9 to Concentration checks. You (unlike other +2 dex races) will thus be in "auto succeed" territory for Concentration saving throws on an attack which did 20 damage or less to you. With Haste's high cost for losing concentration, this will be a serious boon to you at this stage. And if you're only up to a 16 for Con, then you'll only fail a concentration check with a DC of 10 one in four-hundred times, thanks to your Lucky racial feature.
One Real Difference: Range
The longbow's greatest advantage isn't their higher damage die: it's their range. In real medieval warfare, English longbow-men were so deadly on massive battlefields that enemies often threatened to cut off the shooting fingers of any archers they captured (which is why the British still raise two fingers as a sign of defiance and disdain). But in DnD, almost every fight will start within 50-100 feet of an enemy. Otherwise, the archers and Warlocks would just spend 3 or 4 rounds shooting charging enemies while all the other characters stood around doing nothing. Not much fun for them, so the DM is unlikely to craft such a scenario often (sorry to go metagame there, but it's a factor).
So overall, the disadvantages are likely to be minor or nonexistent. In truth, for a balanced fighter-archer, a stout halfling may even be an overall optimal choice.